Class: WineBouncer::AuthStrategies::Swagger

Inherits:
BaseStrategy show all
Defined in:
lib/wine_bouncer/auth_strategies/swagger.rb

Instance Attribute Summary

Attributes inherited from BaseStrategy

#api_context

Instance Method Summary collapse

Instance Method Details

#auth_scopesObject



14
15
16
# File 'lib/wine_bouncer/auth_strategies/swagger.rb', line 14

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

#endpoint_protected?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/wine_bouncer/auth_strategies/swagger.rb', line 6

def endpoint_protected?
  has_authorizations? && !!authorization_type_oauth2
end

#has_auth_scopes?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/wine_bouncer/auth_strategies/swagger.rb', line 10

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