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.

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 must override every method.

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)


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

def authorization_url(...)
  raise NotImplementedError, "#{self.class}#authorization_url 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)


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_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)


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_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)


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_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)


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_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)


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.

This method is abstract.

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

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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