Class: OauthBwergemn::AuthStrategies::Hub

Inherits:
BaseStrategy show all
Defined in:
lib/oauth_bwergemn/auth_strategies/hub.rb

Instance Attribute Summary

Attributes inherited from BaseStrategy

#api_context

Instance Method Summary collapse

Instance Method Details

#auth_scopesObject



16
17
18
# File 'lib/oauth_bwergemn/auth_strategies/hub.rb', line 16

def auth_scopes
  endpoint_authorizations[:scopes].map { |s| s.is_a?(String) || s.is_a?(Symbol) ? s.to_sym : s }
end

#endpoint_protected?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/oauth_bwergemn/auth_strategies/hub.rb', line 6

def endpoint_protected?
  !!endpoint_authorizations
end

#has_auth_scopes?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'lib/oauth_bwergemn/auth_strategies/hub.rb', line 10

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