-
Notifications
You must be signed in to change notification settings - Fork 785
/
types.go
47 lines (38 loc) · 1.17 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package auth
import (
"github.com/jenkins-x/jx/pkg/vault"
)
type AuthServer struct {
URL string `json:"url"`
Users []*UserAuth `json:"users"`
Name string `json:"name"`
Kind string `json:"kind"`
CurrentUser string `json:"currentuser"`
}
type UserAuth struct {
Username string `json:"username"`
ApiToken string `json:"apitoken"`
BearerToken string `json:"bearertoken"`
Password string `json:"password,omitempty"`
}
type AuthConfig struct {
Servers []*AuthServer `json:"servers"`
DefaultUsername string `json:"defaultusername"`
CurrentServer string `json:"currentserver"`
PipeLineUsername string `json:"pipelineusername"`
PipeLineServer string `json:"pipelineserver"`
}
// AuthConfigService implements the generic features of the ConfigService because we don't have superclasses
type AuthConfigService struct {
config *AuthConfig
saver ConfigSaver
}
// FileAuthConfigSaver is a ConfigSaver that saves its config to the local filesystem
type FileAuthConfigSaver struct {
FileName string
}
// VaultAuthConfigSaver is a ConfigSaver that saves configs to Vault
type VaultAuthConfigSaver struct {
vaultClient vault.Client
secretName string
}