Skip to content

Commit 73469c3

Browse files
ahellegitclaude
andauthored
test: skip TestInvalidAPIKeyRejected when auth is disabled (#41)
The non-RBAC e2e pass runs the service with no CYBORGDB_SERVICE_ROOT_KEY, so authentication is disabled and any key is accepted — making the "invalid key must be rejected" assertion fail. Skip the test when no root key is configured (auth off); it still runs in the RBAC pass where auth is enforced. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5457376 commit 73469c3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

test/comprehensive_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ func compTestIndex(t *testing.T) *cyborgdb.EncryptedIndex {
6565
func TestInvalidAPIKeyRejected(t *testing.T) {
6666
// Catches: auth bypass, missing auth enforcement on server.
6767
// A bad API key must be rejected on any mutating operation.
68+
if os.Getenv("CYBORGDB_SERVICE_ROOT_KEY") == "" {
69+
t.Skip("auth disabled (no CYBORGDB_SERVICE_ROOT_KEY) — the service accepts any key")
70+
}
6871
ctx, cancel := context.WithTimeout(context.Background(), baseTimeout)
6972
defer cancel()
7073

0 commit comments

Comments
 (0)