Module: Safire::Protocols::Behaviours Abstract Private
- Included in:
- Smart
- Defined in:
- lib/safire/protocols/behaviours.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Abstract contract that all Safire protocol implementations must satisfy.
Include this module in a protocol class to declare conformance with the Safire protocol interface. Each method raises NotImplementedError by default; concrete protocol classes must override every method.
Instance Method Summary collapse
-
#authorization_url ⇒ Object
abstract
private
Builds the authorization request URL/data.
-
#refresh_token ⇒ Object
abstract
private
Exchanges a refresh token for a new access token.
-
#register_client ⇒ Object
abstract
private
Dynamically registers this client with the authorization server (RFC 7591).
-
#request_access_token ⇒ Object
abstract
private
Exchanges an authorization code for an access token.
-
#request_backend_token ⇒ Object
abstract
private
Requests an access token using the client credentials grant (SMART Backend Services).
-
#server_metadata ⇒ Object
abstract
private
Returns protocol-specific server metadata from discovery.
-
#token_response_valid? ⇒ Boolean
abstract
private
Validates a token response for compliance with this protocol’s specification.
Instance Method Details
#authorization_url ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Builds the authorization request URL/data.
20 21 22 |
# File 'lib/safire/protocols/behaviours.rb', line 20 def (...) raise NotImplementedError, "#{self.class}#authorization_url is not implemented" end |
#refresh_token ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Exchanges a refresh token for a new access token.
32 33 34 |
# File 'lib/safire/protocols/behaviours.rb', line 32 def refresh_token(...) raise NotImplementedError, "#{self.class}#refresh_token is not implemented" end |
#register_client ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Dynamically registers this client with the authorization server (RFC 7591).
SMART App Launch 2.2.0 encourages implementers to consider the OAuth 2.0 Dynamic Client Registration Protocol for an out-of-the-box solution. Implementations should override this method when registration is supported.
55 56 57 |
# File 'lib/safire/protocols/behaviours.rb', line 55 def register_client(...) raise NotImplementedError, "#{self.class}#register_client is not implemented" end |
#request_access_token ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Exchanges an authorization code for an access token.
26 27 28 |
# File 'lib/safire/protocols/behaviours.rb', line 26 def request_access_token(...) raise NotImplementedError, "#{self.class}#request_access_token is not implemented" end |
#request_backend_token ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Requests an access token using the client credentials grant (SMART Backend Services).
44 45 46 |
# File 'lib/safire/protocols/behaviours.rb', line 44 def request_backend_token(...) raise NotImplementedError, "#{self.class}#request_backend_token is not implemented" end |
#server_metadata ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns protocol-specific server metadata from discovery.
14 15 16 |
# File 'lib/safire/protocols/behaviours.rb', line 14 def (...) raise NotImplementedError, "#{self.class}#server_metadata is not implemented" end |
#token_response_valid? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Validates a token response for compliance with this protocol’s specification.
38 39 40 |
# File 'lib/safire/protocols/behaviours.rb', line 38 def token_response_valid?(...) raise NotImplementedError, "#{self.class}#token_response_valid? is not implemented" end |