Class: WineBouncer::AuthStrategies::Default

Inherits:
BaseStrategy show all
Defined in:
lib/wine_bouncer/auth_strategies/default.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/default.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/default.rb', line 6

def endpoint_protected?
  !!endpoint_authorizations
end

#has_auth_scopes?Boolean



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

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