module Doorkeeper::ApplicationMixin::ClassMethods
:nodoc
Public Instance Methods
Source
# File lib/doorkeeper/models/application_mixin.rb, line 42 def by_uid(uid) find_by(uid: uid.to_s) end
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
Source
# 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
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
Source
# File lib/doorkeeper/models/application_mixin.rb, line 56 def fallback_secret_strategy ::Doorkeeper.config.application_secret_fallback_strategy end
Determine the fallback storing strategy Unless configured, there will be no fallback
Source
# File lib/doorkeeper/models/application_mixin.rb, line 49 def secret_strategy ::Doorkeeper.config.application_secret_strategy end
Determines the secret storing transformer Unless configured otherwise, uses the plain secret strategy