Skip to content
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

Update OIDC configuration UI #16935

Merged
merged 41 commits into from
Oct 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e0c5dd3
Update OIDC configuration UI.
ba1ash Oct 11, 2024
2e22ab2
Remove has_actions
oliverguenther Oct 14, 2024
db82830
Extend form validation
oliverguenther Oct 14, 2024
ef21f6e
Extract metadata_url getter
oliverguenther Oct 14, 2024
e857bcd
Add mapping
oliverguenther Oct 14, 2024
19eab3b
Same button layout as saml
oliverguenther Oct 14, 2024
77b8da4
Don't walk through sections without edit_mode
oliverguenther Oct 14, 2024
a1dd527
Hash builder with mapping
oliverguenther Oct 14, 2024
4e897fb
Allow custom icon
oliverguenther Oct 14, 2024
980dd1c
Move migration to engine
oliverguenther Oct 14, 2024
3b4ccfd
Format migration text
oliverguenther Oct 14, 2024
533312b
Configuration mapper
oliverguenther Oct 14, 2024
30fae2b
Rename seeder
oliverguenther Oct 14, 2024
7247a23
Remove form_post security impact option
oliverguenther Oct 14, 2024
a72c0cb
Allow seeding with path config as shown in docs
oliverguenther Oct 15, 2024
15490f2
Reintroduce sections, add one for mapping
oliverguenther Oct 15, 2024
7ecd5df
Fix inflection
oliverguenther Oct 15, 2024
7c873eb
Extend spec to use absolute URL
oliverguenther Oct 15, 2024
6fe5456
Feature spec
oliverguenther Oct 15, 2024
7b8bbee
Contract specs
oliverguenther Oct 15, 2024
fc4908c
Config mapper spec
oliverguenther Oct 15, 2024
2f3e7da
Service specs
oliverguenther Oct 15, 2024
524a459
Add claims
oliverguenther Oct 16, 2024
dcc293c
Remove metadata_url from discoverable attribute check
oliverguenther Oct 16, 2024
3312cc9
Allow path based attributes after all
oliverguenther Oct 16, 2024
718d934
Fix generation of provider classes from new config
oliverguenther Oct 16, 2024
d0390a2
Skip metadata check for built-in
oliverguenther Oct 16, 2024
46eb11a
Remove unused providers helper
oliverguenther Oct 16, 2024
d5987fa
Remove state lambda
oliverguenther Oct 16, 2024
0959dca
Set default issuer
oliverguenther Oct 16, 2024
15dcc76
Allow setting omniauth direct login provider to the new auth providers
oliverguenther Oct 16, 2024
7989cdb
Show delete warning for deleting SSO providers (#16981)
oliverguenther Oct 17, 2024
5bb581a
Parse tenant from previous config
oliverguenther Oct 17, 2024
343063a
Parse limit_self_registration
oliverguenther Oct 17, 2024
e9ef120
Also map host
oliverguenther Oct 17, 2024
32d4da1
Fix and add test for self-registration
oliverguenther Oct 18, 2024
65fb080
Re-enable custom attribute mapping spec
oliverguenther Oct 18, 2024
0d15a67
Add post_logout_redirect_uri
oliverguenther Oct 21, 2024
32afae1
Allow admin mapping
oliverguenther Oct 21, 2024
98e9d57
Add migration spec
oliverguenther Oct 21, 2024
6ac6af4
Better option mapping
oliverguenther Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Better option mapping
  • Loading branch information
oliverguenther committed Oct 21, 2024
commit 6ac6af4a4b69fe75302f752e9b2f797150d7a297
Original file line number Diff line number Diff line change
@@ -60,7 +60,6 @@ def self.model
url: { allow_blank: true, allow_nil: true, schemes: %w[http https] },
if: -> { model.post_logout_redirect_uri_changed? }


OpenIDConnect::Provider::MAPPABLE_ATTRIBUTES.each do |attr|
attribute :"mapping_#{attr}"
end
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ def initialize(configuration)
end

def call! # rubocop:disable Metrics/AbcSize
options = mapped_options(configuration.deep_stringify_keys)
options = configuration.deep_stringify_keys

{
"slug" => options["name"],
@@ -57,7 +57,12 @@ def call! # rubocop:disable Metrics/AbcSize
"token_endpoint" => extract_url(options, "token_endpoint"),
"userinfo_endpoint" => extract_url(options, "userinfo_endpoint"),
"end_session_endpoint" => extract_url(options, "end_session_endpoint"),
"jwks_uri" => extract_url(options, "jwks_uri")
"jwks_uri" => extract_url(options, "jwks_uri"),
"mapping_login" => options.dig("attribute_map", "login"),
"mapping_mail" => options.dig("attribute_map", "email"),
"mapping_firstname" => options.dig("attribute_map", "first_name"),
"mapping_lastname" => options.dig("attribute_map", "last_name"),
"mapping_admin" => options.dig("attribute_map", "admin")
}.compact
end

@@ -102,21 +107,5 @@ def base_url(options)
scheme: options["scheme"] || "https"
).to_s
end

def mapped_options(options)
extract_mapping(options)

options.compact
end

def extract_mapping(options)
return unless options["attribute_map"]

options["mapping_login"] = options["attribute_map"]["login"]
options["mapping_mail"] = options["attribute_map"]["email"]
options["mapping_firstname"] = options["attribute_map"]["first_name"]
options["mapping_lastname"] = options["attribute_map"]["last_name"]
options["mapping_admin"] = options["attribute_map"]["admin"]
end
end
end