module Doorkeeper::ApplicationMixin::ClassMethods

:nodoc

Public Instance Methods

by_uid(uid) click to toggle source

Returns an instance of the Doorkeeper::Application with specific UID.

@param uid [#to_s] UID (any object that responds to ‘#to_s`)

@return [Doorkeeper::Application, nil] Application instance or nil

if there is no record with such UID
# File lib/doorkeeper/models/application_mixin.rb, line 42
def by_uid(uid)
  find_by(uid: uid.to_s)
end
by_uid_and_secret(uid, secret) click to toggle source

Returns an instance of the Doorkeeper::Application with specific UID and secret.

Public/Non-confidential applications will only find by uid if secret is blank.

@param uid [#to_s] UID (any object that responds to ‘#to_s`) @param secret [#to_s] secret (any object that responds to `#to_s`)

@return [Doorkeeper::Application, nil]

Application instance or nil if there is no record with such credentials
# File lib/doorkeeper/models/application_mixin.rb, line 26
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
fallback_secret_strategy() click to toggle source

Determine the fallback storing strategy Unless configured, there will be no fallback

# File lib/doorkeeper/models/application_mixin.rb, line 56
def fallback_secret_strategy
  ::Doorkeeper.config.application_secret_fallback_strategy
end
secret_strategy() click to toggle source

Determines the secret storing transformer Unless configured otherwise, uses the plain secret strategy

# File lib/doorkeeper/models/application_mixin.rb, line 49
def secret_strategy
  ::Doorkeeper.config.application_secret_strategy
end