Class: Inferno::DSL::AuthInfo
- Inherits:
-
Object
- Object
- Inferno::DSL::AuthInfo
- Defined in:
- lib/inferno/dsl/auth_info.rb
Overview
AuthInfo provide 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 only
- symmetric
- Symmetric confidential (i.e., with a static client id and
secret)
- asymmetric
- Symmetric confidential (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
class AuthInfoExampleSuite < Inferno::TestSuite input :url, title: ‘Base FHIR url’
group do title ‘Perform public authorization’ input :fhir_auth, type: :auth_info, options: { mode: ‘auth’, components: [ { name: :auth_type, default: ‘public’, locked: true } ] }
# Some tests here to perform authorization end
group do title ‘FHIR API Tests’ input :fhir_auth, type: :auth_info, options: { mode: ‘access’ }
fhir_client do
url :url
auth_info :fhir_auth # NOT YET IMPLEMENTED
end
# Some tests here to access FHIR API end end
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 The http method which will be used(Thehttpmethodwhichwillbeused) ⇒ Object
to perform the request to the authorization endpoint.
-
#auth_type The type of authorization to be performed.(Thetypeofauthorizationtobeperformed.) ⇒ Object
One of
public
,symmetric
,asymmetric
, orbackend_services
. -
#auth_url The url of the authorization endpoint(Theurloftheauthorizationendpoint) ⇒ Object
-
#client ⇒ Object
Returns the value of attribute client.
-
#client_id ⇒ Object
-
#client_secret ⇒ Object
-
#encryption_algorithm The encryption algorithm which(Theencryptionalgorithmwhich) ⇒ Object
will be used to sign the JWT client credentials.
-
#expires_in The lifetime of the access token in seconds(Thelifetimeoftheaccesstoken) ⇒ Object
-
#issue_time An iso8601 formatted string representing the(Aniso8601formattedstringrepresentingthe) ⇒ Object
time the access token was issued.
-
#jwks A JWKS (including private keys) which will be used(AJWKS(including private keys)) ⇒ Object
instead of Inferno’s default JWKS if provided.
-
#kid The key id for the keys to be used to sign the JWT(Thekeyid) ⇒ Object
client credentials.
-
#name ⇒ Object
-
#pkce_code_challenge_method Either `S256` (default) or(Either`S256`(default)) ⇒ Object
plain
. -
#pkce_support Whether PKCE will be used during(WhetherPKCEwillbeusedduring) ⇒ Object
authorization.
-
#redirect_url ⇒ Object
-
#refresh_token ⇒ Object
-
#requested_scopes The scopes which will be requested(Thescopeswhichwillberequested) ⇒ Object
during authorization.
-
#token_url The url of the auth server's token endpoint(Theurloftheauthserver's token endpoint) ⇒ Object
Instance Attribute Details
#access_token ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#auth_request_method The http method which will be used(Thehttpmethodwhichwillbeused) ⇒ Object
to perform the request to the authorization endpoint. Either get
(default) or post
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#auth_type The type of authorization to be performed.(Thetypeofauthorizationtobeperformed.) ⇒ Object
One of public
, symmetric
, asymmetric
, or backend_services
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#auth_url The url of the authorization endpoint(Theurloftheauthorizationendpoint) ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#client ⇒ Object
Returns the value of attribute client.
96 97 98 |
# File 'lib/inferno/dsl/auth_info.rb', line 96 def client @client end |
#client_id ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#client_secret ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#encryption_algorithm The encryption algorithm which(Theencryptionalgorithmwhich) ⇒ Object
will be used to sign the JWT client credentials. Either es384
(default) or rs384
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#expires_in The lifetime of the access token in seconds(Thelifetimeoftheaccesstoken) ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#issue_time An iso8601 formatted string representing the(Aniso8601formattedstringrepresentingthe) ⇒ Object
time the access token was issued
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#jwks A JWKS (including private keys) which will be used(AJWKS(including private keys)) ⇒ Object
instead of Inferno’s default JWKS if provided
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#kid The key id for the keys to be used to sign the JWT(Thekeyid) ⇒ Object
client credentials. When blank, the first key for the selected encryption algorithm will be used
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#name ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#pkce_code_challenge_method Either `S256` (default) or(Either`S256`(default)) ⇒ Object
plain
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#pkce_support Whether PKCE will be used during(WhetherPKCEwillbeusedduring) ⇒ Object
authorization. Either enabled
or disabled
.
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#redirect_url ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#refresh_token ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#requested_scopes The scopes which will be requested(Thescopeswhichwillberequested) ⇒ Object
during authorization
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|
#token_url The url of the auth server's token endpoint(Theurloftheauthserver's token endpoint) ⇒ Object
|
# File 'lib/inferno/dsl/auth_info.rb', line 98
|