Class: GrapeSimpleAuth::AuthStrategies::Swagger

Inherits:
BaseStrategy
  • Object
show all
Defined in:
lib/grape_simple_auth/auth_strategies/swagger.rb

Instance Attribute Summary

Attributes inherited from BaseStrategy

#api_context

Instance Method Summary collapse

Instance Method Details

#auth_scopesObject



13
14
15
# File 'lib/grape_simple_auth/auth_strategies/swagger.rb', line 13

def auth_scopes
  authorization_type_oauth2.map { |hash| hash[:scope].to_sym }
end

#endpoint_protected?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/grape_simple_auth/auth_strategies/swagger.rb', line 5

def endpoint_protected?
  has_authorizations? && !!authorization_type_oauth2
end

#has_auth_scopes?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/grape_simple_auth/auth_strategies/swagger.rb', line 9

def has_auth_scopes?
  endpoint_protected? && !authorization_type_oauth2.empty?
end