mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
[#171] change proposed PasswordPath to PasswordName
This commit is contained in:
+36
-1
@@ -28,16 +28,51 @@ type Exit struct {
|
||||
}
|
||||
|
||||
type GlobalOptions struct {
|
||||
// AuthenticationMethod is the method we use to authenticate with the jira serivce. Possible values are "api-token" or "session".
|
||||
// The default is "api-token" when the service endpoint ends with "atlassian.net", otherwise it "session". Session authentication
|
||||
// will promt for user password and use the /auth/1/session-login endpoint.
|
||||
AuthenticationMethod figtree.StringOption `yaml:"authentication-method,omitempty" json:"authentication-method,omitempty"`
|
||||
|
||||
// Endpoint is the URL for the Jira service. Something like: https://go-jira.atlassian.net
|
||||
Endpoint figtree.StringOption `yaml:"endpoint,omitempty" json:"endpoint,omitempty"`
|
||||
|
||||
// Insecure will allow you to connect to an https endpoint with a self-signed SSL certificate
|
||||
Insecure figtree.BoolOption `yaml:"insecure,omitempty" json:"insecure,omitempty"`
|
||||
|
||||
// Login is the id used for authenticating with the Jira service. For "api-token" AuthenticationMethod this is usually a
|
||||
// full email address, something like "user@example.com". For "session" AuthenticationMethod this will be something
|
||||
// like "user", which by default will use the same value in the `User` field.
|
||||
Login figtree.StringOption `yaml:"login,omitempty" json:"login,omitempty"`
|
||||
|
||||
// PasswordSource specificies the method that we fetch the password. Possible values are "keyring" or "pass".
|
||||
// If this is unset we will just prompt the user. For "keyring" this will look in the OS keychain, if missing
|
||||
// then prompt the user and store the password in the OS keychain. For "pass" this will look in the PasswordDirectory
|
||||
// location using the `pass` tool, if missing prompt the user and store in the PasswordDirectory
|
||||
PasswordSource figtree.StringOption `yaml:"password-source,omitempty" json:"password-source,omitempty"`
|
||||
|
||||
// PasswordDirectory is only used for the "pass" PasswordSource. It is the location for the encrypted password
|
||||
// files used by `pass`. Effectively this overrides the "PASSWORD_STORE_DIR" environment variable
|
||||
PasswordDirectory figtree.StringOption `yaml:"password-directory,omitempty" json:"password-directory,omitempty"`
|
||||
PasswordPath figtree.StringOption `yaml:"password-path,omitempty" json:"password-path,omitempty"`
|
||||
|
||||
// PasswordName is the the name of the password key entry stored used with PasswordSource `pass`.
|
||||
PasswordName figtree.StringOption `yaml:"password-name,omitempty" json:"password-name,omitempty"`
|
||||
|
||||
// Quiet will lower the defalt log level to suppress the standard output for commands
|
||||
Quiet figtree.BoolOption `yaml:"quiet,omitempty" json:"quiet,omitempty"`
|
||||
|
||||
// SocksProxy is used to configure the http client to access the Endpoint via a socks proxy. The value
|
||||
// should be a ip address and port string, something like "127.0.0.1:1080"
|
||||
SocksProxy figtree.StringOption `yaml:"socksproxy,omitempty" json:"socksproxy,omitempty"`
|
||||
|
||||
// UnixProxy is use to configure the http client to access the Endpoint via a local unix domain socket used
|
||||
// to proxy requests
|
||||
UnixProxy figtree.StringOption `yaml:"unixproxy,omitempty" json:"unixproxy,omitempty"`
|
||||
|
||||
// User is use to represent the user on the Jira service. This can be different from the username used to
|
||||
// authenticate with the service. For example when using AuthenticationMethod `api-token` the Login is
|
||||
// typically an email address like `username@example.com` and the User property would be someting like
|
||||
// `username` The User property is used on Jira service API calls that require a user to associate with
|
||||
// an Issue (like assigning a Issue to yourself)
|
||||
User figtree.StringOption `yaml:"user,omitempty" json:"user,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@ func (o *GlobalOptions) keyName() string {
|
||||
}
|
||||
|
||||
if o.PasswordSource.Value == "pass" {
|
||||
if o.PasswordPath.Value != "" {
|
||||
return fmt.Sprintf("%s/%s", o.PasswordPath, user)
|
||||
if o.PasswordName.Value != "" {
|
||||
return o.PasswordName.Value
|
||||
}
|
||||
return fmt.Sprintf("GoJira/%s", user)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user