module Setsuzoku::AuthStrategy
The API Authentication Interface definition. Any AuthStrategy
that implements this interface must implement all abstract methods defined by AuthStrategy
.
Defines all necessary methods for handling authentication for any authentication strategy.
Attributes
credential[RW]
service[RW]
Public Class Methods
new(service:, **args)
click to toggle source
Initialize the auth_strategy and provide reference to service.
@param service [Service] the new instance of service with its correct strategies.
@return [AuthStrategy] the new instance of auth_strategy
# File lib/setsuzoku/auth_strategy.rb, line 43 def initialize(service:, **args) self.service = service self.set_credential!(self.class.credential_class.stub_credential) unless self.plugin.registered_instance self.config_context = args self end
Public Instance Methods
auth_credential_valid?()
click to toggle source
# File lib/setsuzoku/auth_strategy.rb, line 77 def auth_credential_valid?; end
new_credential!(**args)
click to toggle source
# File lib/setsuzoku/auth_strategy.rb, line 84 def new_credential!(**args); end
set_credential!(credential)
click to toggle source
Assign the credential to the auth_strategy.
@return [void]
# File lib/setsuzoku/auth_strategy.rb, line 65 def set_credential!(credential) if credential self.credential = credential credential.auth_strategy = self end end