module Doorkeeper::ApplicationMixin::ClassMethods

def by_uid(uid)

Returns:
  • (Doorkeeper::Application, nil) - Application instance or nil

Parameters:
  • uid (#to_s) -- UID (any object that responds to `#to_s`)
def by_uid(uid)
  find_by(uid: uid.to_s)
end

def by_uid_and_secret(uid, secret)

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

Parameters:
  • secret (#to_s) -- secret (any object that responds to `#to_s`)
  • uid (#to_s) -- UID (any object that responds to `#to_s`)
def by_uid_and_secret(uid, secret)
  app = by_uid(uid)
  return unless app
  return app if secret.blank? && !app.confidential?
  return unless app.secret_matches?(secret)
  app
end

def fallback_secret_strategy

Unless configured, there will be no fallback
Determine the fallback storing strategy
#
def fallback_secret_strategy
  ::Doorkeeper.config.application_secret_fallback_strategy
end

def secret_strategy

Unless configured otherwise, uses the plain secret strategy
Determines the secret storing transformer
#
def secret_strategy
  ::Doorkeeper.config.application_secret_strategy
end