-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interface updates to Authn-OIDC code redirect authentication flow
This commit updates the previously implemented authn-oidc workflow to adhere to the small changes in interface defined in the authn-jwt refactor
- Loading branch information
1 parent
fa1fb4d
commit 102c9d0
Showing
9 changed files
with
113 additions
and
33 deletions.
There are no files selected for viewing
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
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
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
45 changes: 45 additions & 0 deletions
45
app/domain/authentication/authn_oidc/v2/data_objects/authenticator_contract.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# frozen_string_literal: true | ||
|
||
module Authentication | ||
module AuthnOidc | ||
module V2 | ||
module DataObjects | ||
|
||
# This class handles all validation for the JWT authenticator. This contract | ||
# is executed against the data gleaned from Conjur variables when the authenicator | ||
# is loaded via the AuthenticatorRepository. | ||
|
||
class AuthenticatorContract < Dry::Validation::Contract | ||
option :utils | ||
|
||
schema do | ||
required(:account).value(:string) | ||
required(:service_id).value(:string) | ||
required(:provider_uri).value(:string) | ||
required(:client_id).value(:string) | ||
required(:client_secret).value(:string) | ||
required(:claim_mapping).value(:string) | ||
|
||
optional(:redirect_uri).value(:string) | ||
optional(:response_type).value(:string) | ||
optional(:provider_scope).value(:string) | ||
optional(:name).value(:string) | ||
optional(:token_ttl).value(:string) | ||
end | ||
|
||
# Verify that `provider_uri` has a secret value set if variable is present | ||
rule(:provider_uri, :service_id, :account) do | ||
if values[:provider_uri].empty? | ||
utils.failed_response( | ||
key: key, | ||
error: Errors::Conjur::RequiredSecretMissing.new( | ||
"#{values[:account]}:variable:conjur/authn-jwt/#{values[:service_id]}/provider-uri" | ||
) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
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
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
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
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
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