Module: Safire::Protocols::Behaviours Abstract Private

Included in:
Smart, Udap
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.

This module is abstract.

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 override the methods they support so unsupported flows fail explicitly through the shared contract.

Instance Method Summary collapse

Instance Method Details

#authorization_urlObject

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.

This method is abstract.

Builds the authorization request URL/data.

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/safire/protocols/behaviours.rb', line 21

def authorization_url(...)
  raise NotImplementedError, "#{self.class}#authorization_url is not implemented"
end

#cancel_registrationObject

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.

This method is abstract.

Cancels an existing dynamic client registration.

Implementations should override this method when the protocol supports a cancellation lifecycle operation.

Raises:

  • (NotImplementedError)


66
67
68
# File 'lib/safire/protocols/behaviours.rb', line 66

def cancel_registration(...)
  raise NotImplementedError, "#{self.class}#cancel_registration is not implemented"
end

#refresh_tokenObject

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.

This method is abstract.

Exchanges a refresh token for a new access token.

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/safire/protocols/behaviours.rb', line 33

def refresh_token(...)
  raise NotImplementedError, "#{self.class}#refresh_token is not implemented"
end

#register_clientObject

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.

This method is abstract.

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.

Raises:

  • (NotImplementedError)


56
57
58
# File 'lib/safire/protocols/behaviours.rb', line 56

def register_client(...)
  raise NotImplementedError, "#{self.class}#register_client is not implemented"
end

#request_access_tokenObject

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.

This method is abstract.

Exchanges an authorization code for an access token.

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/safire/protocols/behaviours.rb', line 27

def request_access_token(...)
  raise NotImplementedError, "#{self.class}#request_access_token is not implemented"
end

#request_backend_tokenObject

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.

This method is abstract.

Requests an access token using the client credentials grant (SMART Backend Services).

Raises:

  • (NotImplementedError)


45
46
47
# File 'lib/safire/protocols/behaviours.rb', line 45

def request_backend_token(...)
  raise NotImplementedError, "#{self.class}#request_backend_token is not implemented"
end

#server_metadataObject

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.

This method is abstract.

Returns protocol-specific server metadata from discovery.

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/safire/protocols/behaviours.rb', line 15

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.

This method is abstract.

Validates a token response for compliance with this protocol's specification.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/safire/protocols/behaviours.rb', line 39

def token_response_valid?(...)
  raise NotImplementedError, "#{self.class}#token_response_valid? is not implemented"
end