-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(oidc): OIDC Prompt #4053
Merged
Merged
feat(oidc): OIDC Prompt #4053
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Boundary OIDC method today does not support passing in prompts during authentication. Prompts are optional OIDC parameters that determine the behaviour of authentication server: https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest ## Changes Schema changes for supporting `prompts` for OIDC auth method. - New `auth_oidc_prompt` table which contains all the prompts for OIDC auth method - New `auth_oidc_prompt_enm` table which contains possible enum values for a prompt - Currently supported: - `none`: The Authorization Server MUST NOT display any authentication or consent user interface pages - `login`: The Authorization Server SHOULD prompt the End-User for reauthentication - `consent`: The Authorization Server SHOULD prompt the End-User for consent before returning information to the Client - `select_account`: The Authorization Server SHOULD prompt the End-User to select a user account - `oidc_auth_method_with_value_obj` view has been updated to return `prompt` value
* feat(oidc-prompt): repository changes for OIDC Prompt Boundary OIDC method does not currently support passing in prompts during authentication. This change adds the capability of passing OIDC prompts. Prompts are optional OIDC parameters that determine the behaviour of the authentication server: https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest ### Changes - Update create, read, write and delete repository changes to support new `Prompt` option for OIDC auth method - Update test helper functions to support creating a test auth method with prompts
* feat(oidc-prompt): OIDC Prompt API Boundary OIDC method does not currently support passing in prompts during authentication. This change adds the capability of passing OIDC prompts. Prompts are optional OIDC parameters that determine the behaviour of the authentication server: https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest ### Changes - Add `prompt` option for OIDC auth method CLI create and update - Pass configured prompt during OIDC authentication - Add `prompt` API validation for create and update - Add missed tests for prompt, immutable fields test, handler test
github-actions
bot
added
api
core/db
core/auth
core
core/proto
api/authmethods
core/sql
core/daemon
labels
Nov 20, 2023
Database schema diff between To understand how these diffs are generated and some limitations see the FunctionsUnchanged Tablesdiff --git a/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt.sql b/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt.sql
new file mode 100644
index 000000000..a888e2cc6
--- /dev/null
+++ b/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt.sql
@@ -0,0 +1,44 @@
+--
+-- postgresql database dump
+--
+
+-- dumped from database version 13.13
+-- dumped by pg_dump version 14.10 (ubuntu 14.10-1.pgdg22.04+1)
+
+set statement_timeout = 0;
+set lock_timeout = 0;
+set idle_in_transaction_session_timeout = 0;
+set client_encoding = 'utf8';
+set standard_conforming_strings = on;
+select pg_catalog.set_config('search_path', '', false);
+set check_function_bodies = false;
+set xmloption = content;
+set client_min_messages = warning;
+set row_security = off;
+
+set default_tablespace = '';
+
+set default_table_access_method = heap;
+
+--
+-- name: auth_oidc_prompt; type: table; schema: public; owner: -
+--
+
+create table public.auth_oidc_prompt (
+ create_time public.wt_timestamp,
+ oidc_method_id public.wt_public_id not null,
+ prompt text not null
+);
+
+
+--
+-- name: table auth_oidc_prompt; type: comment; schema: public; owner: -
+--
+
+comment on table public.auth_oidc_prompt is 'auth_oidc_prompt entries are the prompts allowed for an oidc auth method.';
+
+
+--
+-- postgresql database dump complete
+--
+
diff --git a/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm.sql b/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm.sql
new file mode 100644
index 000000000..d76f67889
--- /dev/null
+++ b/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm.sql
@@ -0,0 +1,36 @@
+--
+-- postgresql database dump
+--
+
+-- dumped from database version 13.13
+-- dumped by pg_dump version 14.10 (ubuntu 14.10-1.pgdg22.04+1)
+
+set statement_timeout = 0;
+set lock_timeout = 0;
+set idle_in_transaction_session_timeout = 0;
+set client_encoding = 'utf8';
+set standard_conforming_strings = on;
+select pg_catalog.set_config('search_path', '', false);
+set check_function_bodies = false;
+set xmloption = content;
+set client_min_messages = warning;
+set row_security = off;
+
+set default_tablespace = '';
+
+set default_table_access_method = heap;
+
+--
+-- name: auth_oidc_prompt_enm; type: table; schema: public; owner: -
+--
+
+create table public.auth_oidc_prompt_enm (
+ name text not null,
+ constraint only_predefined_auth_oidc_prompts_allowed check ((name = any (array['none'::text, 'login'::text, 'consent'::text, 'select_account'::text])))
+);
+
+
+--
+-- postgresql database dump complete
+--
+
diff --git a/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/public auth_oidc_prompt.sql b/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/public auth_oidc_prompt.sql
new file mode 100644
index 000000000..983a687da
--- /dev/null
+++ b/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/public auth_oidc_prompt.sql
@@ -0,0 +1,22 @@
+--
+-- postgresql database dump
+--
+
+-- dumped from database version 13.13
+-- dumped by pg_dump version 14.10 (ubuntu 14.10-1.pgdg22.04+1)
+
+set statement_timeout = 0;
+set lock_timeout = 0;
+set idle_in_transaction_session_timeout = 0;
+set client_encoding = 'utf8';
+set standard_conforming_strings = on;
+select pg_catalog.set_config('search_path', '', false);
+set check_function_bodies = false;
+set xmloption = content;
+set client_min_messages = warning;
+set row_security = off;
+
+--
+-- postgresql database dump complete
+--
+
diff --git a/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/public auth_oidc_prompt_enm.sql b/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/public auth_oidc_prompt_enm.sql
new file mode 100644
index 000000000..983a687da
--- /dev/null
+++ b/.schema-diff/tables_4dca1fbedefd52566a98102fe5dd9af3d16428a8/public auth_oidc_prompt_enm.sql
@@ -0,0 +1,22 @@
+--
+-- postgresql database dump
+--
+
+-- dumped from database version 13.13
+-- dumped by pg_dump version 14.10 (ubuntu 14.10-1.pgdg22.04+1)
+
+set statement_timeout = 0;
+set lock_timeout = 0;
+set idle_in_transaction_session_timeout = 0;
+set client_encoding = 'utf8';
+set standard_conforming_strings = on;
+select pg_catalog.set_config('search_path', '', false);
+set check_function_bodies = false;
+set xmloption = content;
+set client_min_messages = warning;
+set row_security = off;
+
+--
+-- postgresql database dump complete
+--
+ Viewsdiff --git a/.schema-diff/views_b6df5693b53b6d3f3e12e6328b19199b756884cb/oidc_auth_method_with_value_obj.sql b/.schema-diff/views_4dca1fbedefd52566a98102fe5dd9af3d16428a8/oidc_auth_method_with_value_obj.sql
index 34ff1f0c8..a85cdadfa 100644
--- a/.schema-diff/views_b6df5693b53b6d3f3e12e6328b19199b756884cb/oidc_auth_method_with_value_obj.sql
+++ b/.schema-diff/views_4dca1fbedefd52566a98102fe5dd9af3d16428a8/oidc_auth_method_with_value_obj.sql
@@ -43,6 +43,7 @@ select
null::text as auds,
null::bytea as certs,
null::text as claims_scopes,
+ null::text as prompts,
null::text as account_claim_maps;
@@ -50,7 +51,7 @@ select
-- name: view oidc_auth_method_with_value_obj; type: comment; schema: public; owner: -
--
-comment on view public.oidc_auth_method_with_value_obj is 'oidc auth method with its associated value objects (algs, auds, certs, scopes) as columns with | delimited values';
+comment on view public.oidc_auth_method_with_value_obj is 'oidc auth method with its associated value objects (algs, auds, certs, scopes, prompts) as columns with | delimited values';
-- Triggersdiff --git a/.schema-diff/triggers_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt default_create_time_column.sql b/.schema-diff/triggers_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt default_create_time_column.sql
new file mode 100644
index 000000000..b12e11932
--- /dev/null
+++ b/.schema-diff/triggers_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt default_create_time_column.sql
@@ -0,0 +1,29 @@
+--
+-- postgresql database dump
+--
+
+-- dumped from database version 13.13
+-- dumped by pg_dump version 14.10 (ubuntu 14.10-1.pgdg22.04+1)
+
+set statement_timeout = 0;
+set lock_timeout = 0;
+set idle_in_transaction_session_timeout = 0;
+set client_encoding = 'utf8';
+set standard_conforming_strings = on;
+select pg_catalog.set_config('search_path', '', false);
+set check_function_bodies = false;
+set xmloption = content;
+set client_min_messages = warning;
+set row_security = off;
+
+--
+-- name: auth_oidc_prompt default_create_time_column; type: trigger; schema: public; owner: -
+--
+
+create trigger default_create_time_column before insert on public.auth_oidc_prompt for each row execute function public.default_create_time();
+
+
+--
+-- postgresql database dump complete
+--
+
diff --git a/.schema-diff/triggers_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt immutable_columns.sql b/.schema-diff/triggers_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt immutable_columns.sql
new file mode 100644
index 000000000..f3a094bd3
--- /dev/null
+++ b/.schema-diff/triggers_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt immutable_columns.sql
@@ -0,0 +1,29 @@
+--
+-- postgresql database dump
+--
+
+-- dumped from database version 13.13
+-- dumped by pg_dump version 14.10 (ubuntu 14.10-1.pgdg22.04+1)
+
+set statement_timeout = 0;
+set lock_timeout = 0;
+set idle_in_transaction_session_timeout = 0;
+set client_encoding = 'utf8';
+set standard_conforming_strings = on;
+select pg_catalog.set_config('search_path', '', false);
+set check_function_bodies = false;
+set xmloption = content;
+set client_min_messages = warning;
+set row_security = off;
+
+--
+-- name: auth_oidc_prompt immutable_columns; type: trigger; schema: public; owner: -
+--
+
+create trigger immutable_columns before update on public.auth_oidc_prompt for each row execute function public.immutable_columns('create_time', 'oidc_method_id', 'prompt');
+
+
+--
+-- postgresql database dump complete
+--
+
diff --git a/.schema-diff/triggers_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm immutable_columns.sql b/.schema-diff/triggers_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm immutable_columns.sql
new file mode 100644
index 000000000..4014ef273
--- /dev/null
+++ b/.schema-diff/triggers_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm immutable_columns.sql
@@ -0,0 +1,29 @@
+--
+-- postgresql database dump
+--
+
+-- dumped from database version 13.13
+-- dumped by pg_dump version 14.10 (ubuntu 14.10-1.pgdg22.04+1)
+
+set statement_timeout = 0;
+set lock_timeout = 0;
+set idle_in_transaction_session_timeout = 0;
+set client_encoding = 'utf8';
+set standard_conforming_strings = on;
+select pg_catalog.set_config('search_path', '', false);
+set check_function_bodies = false;
+set xmloption = content;
+set client_min_messages = warning;
+set row_security = off;
+
+--
+-- name: auth_oidc_prompt_enm immutable_columns; type: trigger; schema: public; owner: -
+--
+
+create trigger immutable_columns before update on public.auth_oidc_prompt_enm for each row execute function public.immutable_columns('name');
+
+
+--
+-- postgresql database dump complete
+--
+ IndexesUnchanged Constraintsdiff --git a/.schema-diff/constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm_pkey.sql b/.schema-diff/constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm_pkey.sql
new file mode 100644
index 000000000..2f1b73caa
--- /dev/null
+++ b/.schema-diff/constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm_pkey.sql
@@ -0,0 +1,2 @@
+-- name: auth_oidc_prompt_enm auth_oidc_prompt_enm_pkey; type: constraint; schema: public; owner: -
+ add constraint auth_oidc_prompt_enm_pkey primary key (name);
diff --git a/.schema-diff/constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_pkey.sql b/.schema-diff/constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_pkey.sql
new file mode 100644
index 000000000..64de46a37
--- /dev/null
+++ b/.schema-diff/constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_pkey.sql
@@ -0,0 +1,2 @@
+-- name: auth_oidc_prompt auth_oidc_prompt_pkey; type: constraint; schema: public; owner: -
+ add constraint auth_oidc_prompt_pkey primary key (oidc_method_id, prompt); Foreign Key Constraintsdiff --git a/.schema-diff/fk_constraints_b6df5693b53b6d3f3e12e6328b19199b756884cb/auth_oidc_method_fkey.sql b/.schema-diff/fk_constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_method_fkey.sql
index 978c3d5dc..89a20f6af 100644
--- a/.schema-diff/fk_constraints_b6df5693b53b6d3f3e12e6328b19199b756884cb/auth_oidc_method_fkey.sql
+++ b/.schema-diff/fk_constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_method_fkey.sql
@@ -12,3 +12,5 @@
add constraint auth_oidc_method_fkey foreign key (oidc_method_id) references public.auth_oidc_method(public_id) on update cascade on delete cascade;
-- name: auth_oidc_managed_group auth_oidc_method_fkey; type: fk constraint; schema: public; owner: -
add constraint auth_oidc_method_fkey foreign key (auth_method_id) references public.auth_oidc_method(public_id) on update cascade on delete cascade;
+-- name: auth_oidc_prompt auth_oidc_method_fkey; type: fk constraint; schema: public; owner: -
+ add constraint auth_oidc_method_fkey foreign key (oidc_method_id) references public.auth_oidc_method(public_id) on update cascade on delete cascade;
diff --git a/.schema-diff/fk_constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm_fkey.sql b/.schema-diff/fk_constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm_fkey.sql
new file mode 100644
index 000000000..2af2b5a7d
--- /dev/null
+++ b/.schema-diff/fk_constraints_4dca1fbedefd52566a98102fe5dd9af3d16428a8/auth_oidc_prompt_enm_fkey.sql
@@ -0,0 +1,2 @@
+-- name: auth_oidc_prompt auth_oidc_prompt_enm_fkey; type: fk constraint; schema: public; owner: -
+ add constraint auth_oidc_prompt_enm_fkey foreign key (prompt) references public.auth_oidc_prompt_enm(name) on update cascade on delete restrict; |
jimlambrt
approved these changes
Nov 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work. ty!
elimt
added a commit
that referenced
this pull request
Dec 5, 2023
Update changelog with OIDC Prompts feature #4053
elimt
added a commit
that referenced
this pull request
Dec 5, 2023
Update changelog with OIDC Prompts feature #4053
psekar
pushed a commit
that referenced
this pull request
Dec 5, 2023
Update changelog with OIDC Prompts feature #4053
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Boundary OIDC method does not currently support passing in prompts during authentication. This change adds the capability of passing OIDC prompts. Prompts are optional OIDC parameters that determine the behaviour of the authentication server: https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
API
select_account
promptCLI
select_account
prompt