aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/admin_auth_ldap.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/admin_auth_ldap.go')
-rw-r--r--cmd/admin_auth_ldap.go62
1 files changed, 31 insertions, 31 deletions
diff --git a/cmd/admin_auth_ldap.go b/cmd/admin_auth_ldap.go
index 91276f221f..cfa1a23235 100644
--- a/cmd/admin_auth_ldap.go
+++ b/cmd/admin_auth_ldap.go
@@ -11,7 +11,7 @@ import (
"code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/services/auth/source/ldap"
- "github.com/urfave/cli"
+ "github.com/urfave/cli/v2"
)
type (
@@ -25,117 +25,117 @@ type (
var (
commonLdapCLIFlags = []cli.Flag{
- cli.StringFlag{
+ &cli.StringFlag{
Name: "name",
Usage: "Authentication name.",
},
- cli.BoolFlag{
+ &cli.BoolFlag{
Name: "not-active",
Usage: "Deactivate the authentication source.",
},
- cli.BoolFlag{
+ &cli.BoolFlag{
Name: "active",
Usage: "Activate the authentication source.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "security-protocol",
Usage: "Security protocol name.",
},
- cli.BoolFlag{
+ &cli.BoolFlag{
Name: "skip-tls-verify",
Usage: "Disable TLS verification.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "host",
Usage: "The address where the LDAP server can be reached.",
},
- cli.IntFlag{
+ &cli.IntFlag{
Name: "port",
Usage: "The port to use when connecting to the LDAP server.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "user-search-base",
Usage: "The LDAP base at which user accounts will be searched for.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "user-filter",
Usage: "An LDAP filter declaring how to find the user record that is attempting to authenticate.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "admin-filter",
Usage: "An LDAP filter specifying if a user should be given administrator privileges.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "restricted-filter",
Usage: "An LDAP filter specifying if a user should be given restricted status.",
},
- cli.BoolFlag{
+ &cli.BoolFlag{
Name: "allow-deactivate-all",
Usage: "Allow empty search results to deactivate all users.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "username-attribute",
Usage: "The attribute of the user’s LDAP record containing the user name.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "firstname-attribute",
Usage: "The attribute of the user’s LDAP record containing the user’s first name.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "surname-attribute",
Usage: "The attribute of the user’s LDAP record containing the user’s surname.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "email-attribute",
Usage: "The attribute of the user’s LDAP record containing the user’s email address.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "public-ssh-key-attribute",
Usage: "The attribute of the user’s LDAP record containing the user’s public ssh key.",
},
- cli.BoolFlag{
+ &cli.BoolFlag{
Name: "skip-local-2fa",
Usage: "Set to true to skip local 2fa for users authenticated by this source",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "avatar-attribute",
Usage: "The attribute of the user’s LDAP record containing the user’s avatar.",
},
}
ldapBindDnCLIFlags = append(commonLdapCLIFlags,
- cli.StringFlag{
+ &cli.StringFlag{
Name: "bind-dn",
Usage: "The DN to bind to the LDAP server with when searching for the user.",
},
- cli.StringFlag{
+ &cli.StringFlag{
Name: "bind-password",
Usage: "The password for the Bind DN, if any.",
},
- cli.BoolFlag{
+ &cli.BoolFlag{
Name: "attributes-in-bind",
Usage: "Fetch attributes in bind DN context.",
},
- cli.BoolFlag{
+ &cli.BoolFlag{
Name: "synchronize-users",
Usage: "Enable user synchronization.",
},
- cli.BoolFlag{
+ &cli.BoolFlag{
Name: "disable-synchronize-users",
Usage: "Disable user synchronization.",
},
- cli.UintFlag{
+ &cli.UintFlag{
Name: "page-size",
Usage: "Search page size.",
})
ldapSimpleAuthCLIFlags = append(commonLdapCLIFlags,
- cli.StringFlag{
+ &cli.StringFlag{
Name: "user-dn",
Usage: "The user’s DN.",
})
- cmdAuthAddLdapBindDn = cli.Command{
+ cmdAuthAddLdapBindDn = &cli.Command{
Name: "add-ldap",
Usage: "Add new LDAP (via Bind DN) authentication source",
Action: func(c *cli.Context) error {
@@ -144,7 +144,7 @@ var (
Flags: ldapBindDnCLIFlags,
}
- cmdAuthUpdateLdapBindDn = cli.Command{
+ cmdAuthUpdateLdapBindDn = &cli.Command{
Name: "update-ldap",
Usage: "Update existing LDAP (via Bind DN) authentication source",
Action: func(c *cli.Context) error {
@@ -153,7 +153,7 @@ var (
Flags: append([]cli.Flag{idFlag}, ldapBindDnCLIFlags...),
}
- cmdAuthAddLdapSimpleAuth = cli.Command{
+ cmdAuthAddLdapSimpleAuth = &cli.Command{
Name: "add-ldap-simple",
Usage: "Add new LDAP (simple auth) authentication source",
Action: func(c *cli.Context) error {
@@ -162,7 +162,7 @@ var (
Flags: ldapSimpleAuthCLIFlags,
}
- cmdAuthUpdateLdapSimpleAuth = cli.Command{
+ cmdAuthUpdateLdapSimpleAuth = &cli.Command{
Name: "update-ldap-simple",
Usage: "Update existing LDAP (simple auth) authentication source",
Action: func(c *cli.Context) error {