LDAP: consistently name the LDAP entities (#17203)

This commit is contained in:
Oleg Gaidarenko
2019-05-22 15:30:03 +03:00
committed by GitHub
parent 87688930a2
commit 9b7f9dd9be
17 changed files with 71 additions and 71 deletions
+4 -4
View File
@@ -40,7 +40,7 @@ type AuthProxy struct {
header string
enabled bool
LdapAllowSignup bool
LDAPAllowSignup bool
AuthProxyAutoSignUp bool
whitelistIP string
headerType string
@@ -88,8 +88,8 @@ func New(options *Options) *AuthProxy {
headerType: setting.AuthProxyHeaderProperty,
headers: setting.AuthProxyHeaders,
whitelistIP: setting.AuthProxyWhitelist,
cacheTTL: setting.AuthProxyLdapSyncTtl,
LdapAllowSignup: setting.LdapAllowSignup,
cacheTTL: setting.AuthProxyLDAPSyncTtl,
LDAPAllowSignup: setting.LDAPAllowSignup,
AuthProxyAutoSignUp: setting.AuthProxyAutoSignUp,
}
}
@@ -213,7 +213,7 @@ func (auth *AuthProxy) LoginViaLDAP() (int64, *Error) {
// Have to sync grafana and LDAP user during log in
user, err := user.Upsert(&user.UpsertArgs{
ReqContext: auth.ctx,
SignupAllowed: auth.LdapAllowSignup,
SignupAllowed: auth.LDAPAllowSignup,
ExternalUser: extUser,
})
if err != nil {
+5 -5
View File
@@ -300,7 +300,7 @@ func TestMiddlewareContext(t *testing.T) {
setting.AuthProxyEnabled = true
setting.AuthProxyWhitelist = ""
setting.AuthProxyAutoSignUp = true
setting.LdapEnabled = true
setting.LDAPEnabled = true
setting.AuthProxyHeaderName = "X-WEBAUTH-USER"
setting.AuthProxyHeaderProperty = "username"
name := "markelog"
@@ -326,7 +326,7 @@ func TestMiddlewareContext(t *testing.T) {
})
middlewareScenario(t, "should create an user from a header", func(sc *scenarioContext) {
setting.LdapEnabled = false
setting.LDAPEnabled = false
setting.AuthProxyAutoSignUp = true
bus.AddHandler("test", func(query *m.GetSignedInUserQuery) error {
@@ -354,7 +354,7 @@ func TestMiddlewareContext(t *testing.T) {
})
middlewareScenario(t, "should get an existing user from header", func(sc *scenarioContext) {
setting.LdapEnabled = false
setting.LDAPEnabled = false
bus.AddHandler("test", func(query *m.GetSignedInUserQuery) error {
query.Result = &m.SignedInUser{OrgId: 2, UserId: 12}
@@ -379,7 +379,7 @@ func TestMiddlewareContext(t *testing.T) {
middlewareScenario(t, "should allow the request from whitelist IP", func(sc *scenarioContext) {
setting.AuthProxyWhitelist = "192.168.1.0/24, 2001::0/120"
setting.LdapEnabled = false
setting.LDAPEnabled = false
bus.AddHandler("test", func(query *m.GetSignedInUserQuery) error {
query.Result = &m.SignedInUser{OrgId: 4, UserId: 33}
@@ -405,7 +405,7 @@ func TestMiddlewareContext(t *testing.T) {
middlewareScenario(t, "should not allow the request from whitelist IP", func(sc *scenarioContext) {
setting.AuthProxyWhitelist = "8.8.8.8"
setting.LdapEnabled = false
setting.LDAPEnabled = false
bus.AddHandler("test", func(query *m.GetSignedInUserQuery) error {
query.Result = &m.SignedInUser{OrgId: 4, UserId: 33}