Class: GrapeSimpleAuth::AuthStrategies::Swagger
- Inherits:
-
BaseStrategy
- Object
- BaseStrategy
- GrapeSimpleAuth::AuthStrategies::Swagger
- Defined in:
- lib/grape_simple_auth/auth_strategies/swagger.rb
Instance Attribute Summary
Attributes inherited from BaseStrategy
Instance Method Summary collapse
- #auth_scopes ⇒ Object
- #endpoint_protected? ⇒ Boolean
- #has_auth_scopes? ⇒ Boolean
- #optional_endpoint? ⇒ Boolean
Instance Method Details
#auth_scopes ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/grape_simple_auth/auth_strategies/swagger.rb', line 17 def auth_scopes if optional_endpoint? optional_oauth2.map { |hash| hash[:scope].to_sym } else .map { |hash| hash[:scope].to_sym } end end |
#endpoint_protected? ⇒ Boolean
9 10 11 |
# File 'lib/grape_simple_auth/auth_strategies/swagger.rb', line 9 def endpoint_protected? && !! end |
#has_auth_scopes? ⇒ Boolean
13 14 15 |
# File 'lib/grape_simple_auth/auth_strategies/swagger.rb', line 13 def has_auth_scopes? endpoint_protected? && !.empty? end |
#optional_endpoint? ⇒ Boolean
5 6 7 |
# File 'lib/grape_simple_auth/auth_strategies/swagger.rb', line 5 def optional_endpoint? && !!optional_oauth2 end |