Module: Doorkeeper::ApplicationMixin::ClassMethods
- Defined in:
- lib/doorkeeper/models/application_mixin.rb
Overview
:nodoc
Instance Method Summary collapse
-
#by_uid(uid) ⇒ Doorkeeper::Application?
Returns an instance of the Doorkeeper::Application with specific UID.
-
#by_uid_and_secret(uid, secret) ⇒ Doorkeeper::Application?
Returns an instance of the Doorkeeper::Application with specific UID and secret.
-
#fallback_secret_strategy ⇒ Object
Determine the fallback storing strategy Unless configured, there will be no fallback.
-
#secret_strategy ⇒ Object
Determines the secret storing transformer Unless configured otherwise, uses the plain secret strategy.
Instance Method Details
#by_uid(uid) ⇒ Doorkeeper::Application?
Returns an instance of the Doorkeeper::Application with specific UID.
42 43 44 |
# 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) ⇒ Doorkeeper::Application?
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.
26 27 28 29 30 31 32 33 |
# 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 ⇒ Object
Determine the fallback storing strategy Unless configured, there will be no fallback
56 57 58 |
# File 'lib/doorkeeper/models/application_mixin.rb', line 56 def fallback_secret_strategy ::Doorkeeper.config.application_secret_fallback_strategy end |
#secret_strategy ⇒ Object
Determines the secret storing transformer Unless configured otherwise, uses the plain secret strategy
49 50 51 |
# File 'lib/doorkeeper/models/application_mixin.rb', line 49 def secret_strategy ::Doorkeeper.config.application_secret_strategy end |