Module: Doorkeeper::Request
- Extended by:
- Request
- Included in:
- Request
- Defined in:
- lib/doorkeeper/request.rb,
lib/doorkeeper/request/code.rb,
lib/doorkeeper/request/token.rb,
lib/doorkeeper/request/password.rb,
lib/doorkeeper/request/refresh_token.rb,
lib/doorkeeper/request/authorization_code.rb,
lib/doorkeeper/request/client_credentials.rb
Defined Under Namespace
Classes: AuthorizationCode, ClientCredentials, Code, Password, RefreshToken, Token
Instance Method Summary collapse
-
#authorization_strategy(strategy) ⇒ Object
Available authorization strategies: :code, :token.
- #get_strategy(strategy) ⇒ Object
-
#token_strategy(strategy) ⇒ Object
Available token strategies: :password, :client_credentials, :authorization_code, :refresh_token.
Instance Method Details
#authorization_strategy(strategy) ⇒ Object
Available authorization strategies: :code, :token
14 15 16 17 18 |
# File 'lib/doorkeeper/request.rb', line 14 def (strategy) get_strategy strategy rescue NameError raise Errors::InvalidAuthorizationStrategy end |
#get_strategy(strategy) ⇒ Object
28 29 30 31 |
# File 'lib/doorkeeper/request.rb', line 28 def get_strategy(strategy) raise Errors::MissingRequestStrategy unless strategy.present? "Doorkeeper::Request::#{strategy.to_s.camelize}".constantize end |
#token_strategy(strategy) ⇒ Object
Available token strategies: :password, :client_credentials, :authorization_code, :refresh_token
22 23 24 25 26 |
# File 'lib/doorkeeper/request.rb', line 22 def token_strategy(strategy) get_strategy strategy rescue NameError raise Errors::InvalidTokenStrategy end |