Class: Gitlab::Auth::Ldap::User
Constant Summary
Constants inherited
from OAuth::User
OAuth::User::SigninDisabledForProviderError, OAuth::User::SignupDisabledError
Instance Attribute Summary
Attributes inherited from OAuth::User
#auth_hash
Instance Method Summary
collapse
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
Methods inherited from OAuth::User
#bypass_two_factor?, #find_and_update!, find_by_uid_and_provider, #gl_user, #initialize, #new?, #persisted?, #save, #valid?
Instance Method Details
#auth_hash=(auth_hash) ⇒ Object
45
46
47
|
# File 'lib/gitlab/auth/ldap/user.rb', line 45
def auth_hash=(auth_hash)
@auth_hash = Gitlab::Auth::Ldap::AuthHash.new(auth_hash)
end
|
#block_after_signup? ⇒ Boolean
25
26
27
|
# File 'lib/gitlab/auth/ldap/user.rb', line 25
def block_after_signup?
ldap_config.block_auto_created_users
end
|
#find_user ⇒ Object
16
17
18
|
# File 'lib/gitlab/auth/ldap/user.rb', line 16
def find_user
find_by_uid_and_provider || find_by_email || build_new_user
end
|
#ldap_config ⇒ Object
41
42
43
|
# File 'lib/gitlab/auth/ldap/user.rb', line 41
def ldap_config
Gitlab::Auth::Ldap::Config.new(auth_hash.provider)
end
|
#protocol_name ⇒ Object
49
50
51
|
# File 'lib/gitlab/auth/ldap/user.rb', line 49
def protocol_name
'LDAP'
end
|
#should_save? ⇒ Boolean
21
22
23
|
# File 'lib/gitlab/auth/ldap/user.rb', line 21
def should_save?
gl_user.changed? || gl_user.identities.any?(&:changed?)
end
|
#valid_sign_in? ⇒ Boolean
33
34
35
36
37
38
39
|
# File 'lib/gitlab/auth/ldap/user.rb', line 33
def valid_sign_in?
super && allowed?
end
|