Skip to content

Commit 806d7da

Browse files
committed
refactor: sql/OIDC ready to test
1 parent 3ffd52a commit 806d7da

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

obp-api/src/main/scripts/sql/OIDC/cre_v_oidc_clients.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ ORDER BY client_name;
3434
COMMENT ON VIEW v_oidc_clients IS 'Read-only view of consumer table for OIDC service access. Only includes active consumers. Note: grant_types and scopes are hardcoded defaults - consider adding these fields to consumer table for full OIDC compliance.';
3535

3636
-- Grant SELECT permission on the OIDC view (oidc_user - read-only access)
37+
-- not sure OIDC_USER needs this.
3738
GRANT SELECT ON v_oidc_clients TO :OIDC_USER;
3839

3940
\echo 'OIDC clients view created successfully.'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- =============================================================================
2+
-- GIVE READ ACCESS TO OBP USERS AND WRITE ACCESS TO OBP CONSUMERS
3+
-- =============================================================================
4+
-- This orchestration script grants OIDC_ADMIN_USER read access to user-related views
5+
-- and full CRUD access to consumer/client management
6+
-- by including the necessary component scripts
7+
8+
-- Include variable definitions and database connection
9+
\i set_and_connect.sql
10+
11+
-- Create the OIDC users
12+
-- TODO check if we need both here.
13+
\i cre_OIDC_USER.sql
14+
\i cre_OIDC_ADMIN_USER.sql
15+
16+
-- Create all three views (which include the necessary GRANT statements)
17+
\i cre_v_oidc_users.sql
18+
\i cre_v_oidc_clients.sql
19+
\i cre_v_oidc_admin_clients.sql
20+
21+
\echo 'Bye from give_read_access_to_obp_users_and_write_access_to_obp_consumers.sql'

obp-api/src/main/scripts/sql/OIDC/give_read_access_to_obp_users.sql

Whitespace-only changes.

obp-api/src/main/scripts/sql/OIDC/give_read_access_to_obp_users_and_write_access_to_obp_consumers.sql

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- =============================================================================
2+
-- GIVE READ ACCESS TO OBP USERS
3+
-- =============================================================================
4+
-- This orchestration script grants OIDC_USER read access to user-related views
5+
-- by including the necessary component scripts
6+
7+
-- Include variable definitions and database connection
8+
\i set_and_connect.sql
9+
10+
-- Create the OIDC user if it doesn't exist
11+
\i cre_OIDC_USER.sql
12+
13+
-- Create the v_oidc_users view (which includes GRANT SELECT to OIDC_USER)
14+
\i cre_v_oidc_users.sql
15+
16+
\echo 'Bye from give_read_access_to_obp_users.sql'

0 commit comments

Comments
 (0)