Skip to content

Commit

Permalink
Skip metadata check for built-in
Browse files Browse the repository at this point in the history
otherwise they will appear incomplete, even though they are complete
  • Loading branch information
oliverguenther committed Oct 16, 2024
1 parent 2c89420 commit 02a6af9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions modules/openid_connect/app/models/openid_connect/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ def seeded_from_env?
(Setting.seed_oidc_provider || {}).key?(slug)
end

def basic_details_configured?
display_name.present? && (oidc_provider == "microsoft_entra" ? tenant.present? : true)
end

def advanced_details_configured?
client_id.present? && client_secret.present?
end

def metadata_configured?
return true if google? || entra_id?

DISCOVERABLE_ATTRIBUTES_MANDATORY.all? do |mandatory_attribute|
public_send(mandatory_attribute).present?
end
Expand All @@ -61,8 +59,16 @@ def mapping_configured?
end
end

def google?
oidc_provider == "google"
end

def entra_id?
oidc_provider == "microsoft_entra"
end

def configured?
basic_details_configured? && advanced_details_configured? && metadata_configured?
display_name.present? && advanced_details_configured? && metadata_configured?
end

def icon
Expand Down

0 comments on commit 02a6af9

Please sign in to comment.