-
Notifications
You must be signed in to change notification settings - Fork 787
/
types.go
51 lines (41 loc) · 978 Bytes
/
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
48
49
50
51
package auth
import (
"github.com/jenkins-x/jx/pkg/vault"
)
const (
DefaultWritePermissions = 0760
)
type AuthServer struct {
URL string
Users []*UserAuth
Name string
Kind string
CurrentUser string
}
type UserAuth struct {
Username string
ApiToken string
BearerToken string
Password string `yaml:"password,omitempty"`
}
type AuthConfig struct {
Servers []*AuthServer
DefaultUsername string
CurrentServer string
PipeLineUsername string
PipeLineServer string
}
// 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
}