module Doorkeeper::AccessGrantMixin::ClassMethods

def by_token(token)

Returns:
  • (Doorkeeper::AccessGrant, nil) -

Parameters:
  • token (#to_s) -- token value (any object that responds to `#to_s`)
def by_token(token)
  find_by_plaintext_token(:token, token)
end

def fallback_secret_strategy

Returns:
  • (Doorkeeper::SecretStoring::Base) -
def fallback_secret_strategy
  ::Doorkeeper.config.token_secret_fallback_strategy
end

def generate_code_challenge(code_verifier)

Returns:
  • (#to_s) - An encoded code challenge based on the provided verifier

Parameters:
  • code_verifier (#to_s) -- a one time use value (any object that responds to `#to_s`)
def generate_code_challenge(code_verifier)
  Base64.urlsafe_encode64(Digest::SHA256.digest(code_verifier), padding: false)
end

def pkce_supported?

def pkce_supported?
  column_names.include?("code_challenge")
end

def revoke_all_for(application_id, resource_owner, clock = Time)

Parameters:
  • resource_owner (ActiveRecord::Base, Integer) --
  • application_id (Integer) --
def revoke_all_for(application_id, resource_owner, clock = Time)
  by_resource_owner(resource_owner)
    .where(
      application_id: application_id,
      revoked_at: nil,
    )
    .update_all(revoked_at: clock.now.utc)
end

def secret_strategy

Returns:
  • (Doorkeeper::SecretStoring::Base) -
def secret_strategy
  ::Doorkeeper.config.token_secret_strategy
end