Module: Kadmin::Auth

Defined in:
lib/kadmin/auth.rb,
lib/kadmin/auth/user.rb,
lib/kadmin/auth/user_store.rb,
lib/kadmin/auth/configuration.rb,
lib/kadmin/auth/unauthorized_error.rb

Defined Under Namespace

Classes: Configuration, UnauthorizedError, User, UserStore

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.test_userObject

Returns the value of attribute test_user.



13
14
15
# File 'lib/kadmin/auth.rb', line 13

def test_user
  @test_user
end

Class Method Details

.configObject



19
20
21
# File 'lib/kadmin/auth.rb', line 19

def config
  return @config ||= Kadmin::Auth::Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



23
24
25
26
# File 'lib/kadmin/auth.rb', line 23

def configure
  yield(config) if block_given?
  return config
end

.omniauth_providerObject



28
29
30
# File 'lib/kadmin/auth.rb', line 28

def omniauth_provider
  return config.oauth_credentials.present? ? :google_oauth2 : :developer
end

.usersObject



15
16
17
# File 'lib/kadmin/auth.rb', line 15

def users
  @users ||= config.user_store_class.new
end