Class: WineBouncer::AuthStrategies::Protected

Inherits:
BaseStrategy
  • Object
show all
Defined in:
lib/wine_bouncer/auth_strategies/protected.rb

Instance Attribute Summary

Attributes inherited from BaseStrategy

#api_context

Instance Method Summary collapse

Instance Method Details

#auth_scopesObject



16
17
18
# File 'lib/wine_bouncer/auth_strategies/protected.rb', line 16

def auth_scopes
  endpoint_authorizations[:scopes].map(&:to_sym)
end

#endpoint_protected?Boolean



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

def endpoint_protected?
  has_authorizations?
end

#has_auth_scopes?Boolean



10
11
12
13
14
# File 'lib/wine_bouncer/auth_strategies/protected.rb', line 10

def has_auth_scopes?
  endpoint_authorizations &&
    endpoint_authorizations.key?(:scopes) &&
    endpoint_authorizations[:scopes].any?
end