Skip to content

Commit 67b95b9

Browse files
committed
fix: vault secrets
1 parent 0c1ce7d commit 67b95b9

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

packages/rls-demo/__tests__/vault-secrets.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ beforeAll(async () => {
2121
expect(vaultSchemaExists[0].exists).toBe(true);
2222

2323
// grant access to vault schema for testing
24-
await pg.any(
25-
`GRANT USAGE ON SCHEMA vault TO public;
24+
await pg.any(
25+
`GRANT USAGE ON SCHEMA vault TO public;
2626
GRANT SELECT ON ALL TABLES IN SCHEMA vault TO service_role;
2727
GRANT SELECT ON ALL TABLES IN SCHEMA vault TO anon;
2828
GRANT SELECT ON ALL TABLES IN SCHEMA vault TO authenticated;
@@ -69,13 +69,13 @@ describe('tutorial: vault secrets table access', () => {
6969

7070
it('should verify service_role can query secrets structure', async () => {
7171
db.setContext({ role: 'service_role' });
72-
const columns = await db.any(
73-
`SELECT column_name, data_type
74-
FROM information_schema.columns
75-
WHERE table_schema = 'vault' AND table_name = 'secrets'
76-
ORDER BY ordinal_position`
77-
);
78-
expect(Array.isArray(columns)).toBe(true);
72+
const columns = await db.any(
73+
`SELECT column_name, data_type
74+
FROM information_schema.columns
75+
WHERE table_schema = 'vault' AND table_name = 'secrets'
76+
ORDER BY ordinal_position`
77+
);
78+
expect(Array.isArray(columns)).toBe(true);
7979
const names = columns.map((r: any) => r.column_name);
8080
expect(names).toEqual(expect.arrayContaining([
8181
'id', 'name', 'description', 'secret', 'key_id', 'nonce', 'created_at', 'updated_at'
@@ -99,15 +99,15 @@ describe('tutorial: vault secrets table access', () => {
9999

100100
it('should verify relrowsecurity status on secrets', async () => {
101101
db.setContext({ role: 'service_role' });
102-
const rlsStatus = await db.any(
103-
`SELECT c.relrowsecurity
104-
FROM pg_class c
105-
JOIN pg_namespace n ON n.oid = c.relnamespace
106-
WHERE n.nspname = 'vault' AND c.relname = 'secrets'`
107-
);
102+
const rlsStatus = await db.any(
103+
`SELECT c.relrowsecurity
104+
FROM pg_class c
105+
JOIN pg_namespace n ON n.oid = c.relnamespace
106+
WHERE n.nspname = 'vault' AND c.relname = 'secrets'`
107+
);
108108
expect(Array.isArray(rlsStatus)).toBe(true);
109109
expect(rlsStatus.length).toBeGreaterThan(0);
110-
expect(typeof rlsStatus[0].relrowsecurity).toBe('boolean');
110+
expect(typeof rlsStatus[0].relrowsecurity).toBe('boolean');
111111
});
112112

113113
it('should verify anon access to secrets based on rls', async () => {

0 commit comments

Comments
 (0)