Class: Inferno::DSL::AuthInfo
- Inherits:
-
Object
- Object
- Inferno::DSL::AuthInfo
- Defined in:
- lib/inferno/dsl/auth_info.rb
Overview
AuthInfo provides a user with a single input which contains the information needed for a FHIR client to perform authorization and refresh an access token when necessary.
AuthInfo supports the following auth_type
:
public
- Client id onlysymmetric
- Confidential symmetric (i.e., with a static client id and secret)asymmetric
- Confidential asymmetric (i.e., a client id with a signed JWT rather than a client secret)backend_services
When configuring an AuthInfo input, the invdidual fields are exposed as
components
in the input’s options, and can be configured there similar
to normal inputs.
The AuthInfo input type supports two different modes in the UI. Different fields will be presented to the user depending on which mode is selected:
auth
- This presents the inputs needed to perform authorization, and is appropriate to use as an input to test groups which perform authorization.access
- This presents the inputs needed to access resources assuming that authorization has already happened, and is appropriate to use as an input to test groups which access resources using previously granted authorization.
Constant Summary collapse
- ATTRIBUTES =
[ :auth_type, :use_discovery, :token_url, :auth_url, :requested_scopes, :client_id, :client_secret, :redirect_url, # TODO: does this belong here? :pkce_support, :pkce_code_challenge_method, :auth_request_method, :encryption_algorithm, :kid, :jwks, :access_token, :refresh_token, :issue_time, :expires_in, :name ].freeze
Instance Attribute Summary collapse
-
#access_token ⇒ Object
-
#auth_request_method ⇒ Object
The http method which will be used to perform the request to the authorization endpoint.
-
#auth_type ⇒ Object
The type of authorization to be performed.
-
#auth_url ⇒ Object
The url of the authorization endpoint.
-
#client ⇒ Object
Returns the value of attribute client.
-
#client_id ⇒ Object
-
#client_secret ⇒ Object
-
#encryption_algorithm ⇒ Object
The encryption algorithm which will be used to sign the JWT client credentials.
-
#expires_in ⇒ Object
The lifetime of the access token in seconds.
-
#issue_time ⇒ Object
An iso8601 formatted string representing the time the access token was issued.
-
#jwks ⇒ Object
A JWKS (including private keys) which will be used instead of Inferno’s default JWKS if provided.
-
#kid ⇒ Object
The key id for the keys to be used to sign the JWT client credentials.
-
#name ⇒ Object
-
#pkce_code_challenge_method ⇒ Object
Either
S256
(default) orplain
. -
#pkce_support ⇒ Object
Whether PKCE will be used during authorization.
-
#redirect_url ⇒ Object
-
#refresh_token ⇒ Object
-
#requested_scopes ⇒ Object
The scopes which will be requested during authorization.
-
#token_url ⇒ Object
The url of the auth server’s token endpoint.
Class Method Summary collapse
-
.default_auth_type_component ⇒ Hash
Returns the default configuration for the “auth_type” component.
-
.default_auth_type_component_without_backend_services ⇒ Hash
Returns the default configuration for the “auth_type” component without the option for backend services auth.
Instance Method Summary collapse
-
#asymmetric_auth? ⇒ Boolean
Returns true when using confidential asymmetric auth.
-
#backend_services_auth? ⇒ Boolean
Returns true when using backend services auth.
-
#get_auth_request? ⇒ Boolean
Returns true when using GET as the authorization request method.
-
#pkce_enabled? ⇒ Boolean
Returns true when pkce is enabled.
-
#plain_code_challenge_method? ⇒ Boolean
Returns true when using the palin pkce code challenge method.
-
#post_auth_request? ⇒ Boolean
Returns true when using POST as the authorization request method.
-
#public_auth? ⇒ Boolean
Returns true when using public auth.
-
#s256_code_challenge_method? ⇒ Boolean
Returns true when using the S256 pkce code challenge method.
-
#symmetric_auth? ⇒ Boolean
Returns true when using confidential symmetric auth.
Instance Attribute Details
#access_token ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#auth_request_method ⇒ Object
The http method which will be used to perform the request to the authorization endpoint.
Either get
(default) or post
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#auth_type ⇒ Object
The type of authorization to be performed. One of public
, symmetric
, asymmetric
, or backend_services
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#auth_url ⇒ Object
The url of the authorization endpoint
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#client ⇒ Object
Returns the value of attribute client.
98 99 100 |
# File 'lib/inferno/dsl/auth_info.rb', line 98 def client @client end |
#client_id ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#client_secret ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#encryption_algorithm ⇒ Object
The encryption algorithm which will be used to sign the JWT client credentials.
Either es384
(default) or rs384
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#expires_in ⇒ Object
The lifetime of the access token in seconds
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#issue_time ⇒ Object
An iso8601 formatted string representing the time the access token was issued
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#jwks ⇒ Object
A JWKS (including private keys) which will be used instead of Inferno’s default JWKS if provided
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#kid ⇒ Object
The key id for the keys to be used to sign the JWT client credentials. When blank, the first key for the selected encryption algorithm will be used
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#name ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#pkce_code_challenge_method ⇒ Object
Either S256
(default) or plain
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#pkce_support ⇒ Object
Whether PKCE will be used during authorization. Either enabled
or disabled
.
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#redirect_url ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#refresh_token ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#requested_scopes ⇒ Object
The scopes which will be requested during authorization
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
#token_url ⇒ Object
The url of the auth server’s token endpoint
|
# File 'lib/inferno/dsl/auth_info.rb', line 100
|
Class Method Details
.default_auth_type_component ⇒ Hash
Returns the default configuration for the “auth_type” component
316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/inferno/dsl/auth_info.rb', line 316 def self.default_auth_type_component { name: :auth_type, options: { list_options: [ { label: 'Public', value: 'public' }, { label: 'Confidential Symmetric', value: 'symmetric' }, { label: 'Confidential Asymmetric', value: 'asymmetric' }, { label: 'Backend Services', value: 'backend_services' } ] } } end |
.default_auth_type_component_without_backend_services ⇒ Hash
Returns the default configuration for the “auth_type” component without the option for backend services auth
333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/inferno/dsl/auth_info.rb', line 333 def self.default_auth_type_component_without_backend_services { name: :auth_type, options: { list_options: [ { label: 'Public', value: 'public' }, { label: 'Confidential Symmetric', value: 'symmetric' }, { label: 'Confidential Asymmetric', value: 'asymmetric' } ] } } end |
Instance Method Details
#asymmetric_auth? ⇒ Boolean
Returns true when using confidential asymmetric auth
360 361 362 |
# File 'lib/inferno/dsl/auth_info.rb', line 360 def asymmetric_auth? auth_type&.casecmp? 'asymmetric' end |
#backend_services_auth? ⇒ Boolean
Returns true when using backend services auth
366 367 368 |
# File 'lib/inferno/dsl/auth_info.rb', line 366 def backend_services_auth? auth_type&.casecmp? 'backend_services' end |
#get_auth_request? ⇒ Boolean
Returns true when using GET as the authorization request method
372 373 374 |
# File 'lib/inferno/dsl/auth_info.rb', line 372 def get_auth_request? auth_request_method&.casecmp? 'get' end |
#pkce_enabled? ⇒ Boolean
Returns true when pkce is enabled
384 385 386 |
# File 'lib/inferno/dsl/auth_info.rb', line 384 def pkce_enabled? pkce_support&.casecmp? 'enabled' end |
#plain_code_challenge_method? ⇒ Boolean
Returns true when using the palin pkce code challenge method
396 397 398 |
# File 'lib/inferno/dsl/auth_info.rb', line 396 def plain_code_challenge_method? pkce_code_challenge_method&.casecmp? 'plain' end |
#post_auth_request? ⇒ Boolean
Returns true when using POST as the authorization request method
378 379 380 |
# File 'lib/inferno/dsl/auth_info.rb', line 378 def post_auth_request? auth_request_method&.casecmp? 'post' end |
#public_auth? ⇒ Boolean
Returns true when using public auth
348 349 350 |
# File 'lib/inferno/dsl/auth_info.rb', line 348 def public_auth? auth_type&.casecmp? 'public' end |
#s256_code_challenge_method? ⇒ Boolean
Returns true when using the S256 pkce code challenge method
390 391 392 |
# File 'lib/inferno/dsl/auth_info.rb', line 390 def s256_code_challenge_method? pkce_code_challenge_method&.casecmp? 'S256' end |
#symmetric_auth? ⇒ Boolean
Returns true when using confidential symmetric auth
354 355 356 |
# File 'lib/inferno/dsl/auth_info.rb', line 354 def symmetric_auth? auth_type&.casecmp? 'symmetric' end |