Skip to content

Commit 3beafc8

Browse files
committed
Add RLS to oauth2 access/refresh token tables
1 parent 85c1e9a commit 3beafc8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

supabase/migrations/20240810183922_create_oauth2_tables.sql

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ CREATE TABLE "public"."oauth2_client_access_tokens" (
4343
enabled boolean DEFAULT TRUE NOT NULL
4444
scopes TEXT[] NOT NULL
4545
);
46+
ALTER TABLE "public"."oauth2_client_access_tokens" ENABLE ROW LEVEL SECURITY;
47+
CREATE INDEX "idx_oauth2_access_tokens_client_id" ON "public"."oauth2_client_access_tokens"("client_id");
4648

4749
-- table storing the refresh tokens for clients
4850
CREATE TABLE "public"."oauth2_client_refresh_tokens" (
@@ -53,4 +55,6 @@ CREATE TABLE "public"."oauth2_client_refresh_tokens" (
5355
refresh_token_expires_at TIMESTAMPTZ NOT NULL,
5456
enabled boolean DEFAULT TRUE NOT NULL
5557
scopes TEXT[] NOT NULL
56-
);
58+
);
59+
ALTER TABLE "public"."oauth2_client_refresh_tokens" ENABLE ROW LEVEL SECURITY;
60+
CREATE INDEX "idx_oauth2_refresh_tokens_client_id" ON "public"."oauth2_client_refresh_tokens"("client_id");

0 commit comments

Comments
 (0)