diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 690c09f3..5ee7f8bc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -236,7 +236,7 @@ jobs: node-version: 22 - name: Prune stale Docker networks - run: docker network prune -f + run: docker network prune -f || true - name: Boot local stack run: docker compose -f docker-compose.yml -f .github/docker-compose.ci.yml up -d traefik redis mysql-debug edge-broker php1 php2 php3 php4 php5 caddy @@ -248,7 +248,7 @@ jobs: --exclude='./.phpunit.cache' --exclude='./build/logs' -C services/nginx/app -cf - . - | docker compose -f docker-compose.yml -f .github/docker-compose.ci.yml exec -T php1 tar -C /var/www/html -xf - + | docker compose -f docker-compose.yml -f .github/docker-compose.ci.yml exec -T php1 tar --no-same-owner -C /var/www/html -xf - - name: Resolve dependencies run: | diff --git a/scripts/php-ci-test.sh b/scripts/php-ci-test.sh index c66244c5..7e61b8bd 100644 --- a/scripts/php-ci-test.sh +++ b/scripts/php-ci-test.sh @@ -143,7 +143,7 @@ tar \ --exclude='./.phpunit.cache' \ --exclude='./build/logs' \ -C services/nginx/app -cf - . \ - | docker compose $compose_files exec -T php1 tar -C /var/www/html -xf - + | docker compose $compose_files exec -T php1 tar --no-same-owner -C /var/www/html -xf - docker compose $compose_files exec -T php1 sh -lc 'rm -rf /var/www/repo-root && mkdir -p /var/www/repo-root' tar \ @@ -152,7 +152,7 @@ tar \ Dockerfile.coolify-api \ services/php/Dockerfile \ services/php/php-fpm-pool.conf \ - | docker compose $compose_files exec -T php1 tar -C /var/www/repo-root -xf - + | docker compose $compose_files exec -T php1 tar --no-same-owner -C /var/www/repo-root -xf - composer_install diff --git a/services/nginx/app/tests/Api/AuthApiTest.php b/services/nginx/app/tests/Api/AuthApiTest.php index a195c07e..826b6228 100644 --- a/services/nginx/app/tests/Api/AuthApiTest.php +++ b/services/nginx/app/tests/Api/AuthApiTest.php @@ -250,14 +250,13 @@ it('scopes passkey challenges to the requested principal type', function (): voi expect($userCredentialIds)->toContain('customer-passkey-credential'); expect($userCredentialIds)->not->toContain('subuser-passkey-credential'); - $tokenRepo = new \objects\tokens_o(); $subuserChallengeToken = (string)($subuserChallenge->data()['challenge_token'] ?? ''); $userChallengeToken = (string)($userChallenge->data()['challenge_token'] ?? ''); if ($subuserChallengeToken !== '') { - $tokenRepo->delete($subuserChallengeToken); + api_fixtures()->cleanupDeleteWhere('tokens', ['token' => $subuserChallengeToken]); } if ($userChallengeToken !== '') { - $tokenRepo->delete($userChallengeToken); + api_fixtures()->cleanupDeleteWhere('tokens', ['token' => $userChallengeToken]); } }); diff --git a/services/nginx/app/tests/Support/Api/ApiSchemaBootstrap.php b/services/nginx/app/tests/Support/Api/ApiSchemaBootstrap.php index d3df88ce..e9f2b10b 100644 --- a/services/nginx/app/tests/Support/Api/ApiSchemaBootstrap.php +++ b/services/nginx/app/tests/Support/Api/ApiSchemaBootstrap.php @@ -649,6 +649,26 @@ CREATE TABLE IF NOT EXISTS `tokens` ( KEY `idx_tokens_user_id` (`user_id`), KEY `idx_tokens_type` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +SQL, + 'passkeys' => <<<'SQL' +CREATE TABLE IF NOT EXISTS `passkeys` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT NOT NULL, + `is_subuser` TINYINT(1) NOT NULL DEFAULT 0, + `credential_id` VARCHAR(4096) NOT NULL, + `public_key` TEXT NOT NULL, + `algorithm` VARCHAR(32) NOT NULL, + `transports` JSON NULL, + `sign_count` INT NOT NULL DEFAULT 0, + `backup_state` JSON NULL, + `name` VARCHAR(255) NULL, + `created_at` DATETIME NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `deleted_at` DATETIME NULL, + PRIMARY KEY (`id`), + KEY `idx_passkeys_user` (`user_id`, `is_subuser`), + KEY `idx_passkeys_deleted_at` (`deleted_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci SQL, 'customer_attributes' => <<<'SQL' CREATE TABLE IF NOT EXISTS `customer_attributes` (