-
Notifications
You must be signed in to change notification settings - Fork 0
/
automation.go
101 lines (82 loc) · 2.58 KB
/
automation.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package horizon
type CompliancePolicy struct {
AuthorizedSigningAlgorithms []string `json:"authorizedSigningAlgorithms,omitempty"`
AuthorizedCas []string `json:"authorizedCas,omitempty"`
}
type Policy struct {
Name string `json:"name"`
Profile string `json:"profile"`
TrustChains []string `json:"trustChains,omitempty"`
ExecutionPolicy string `json:"executionPolicy,omitempty"`
CompliancePolicy *CompliancePolicy `json:"compliancePolicy,omitempty"`
}
type InitParameter struct {
Module string `json:"module"`
Profile string `json:"profile"`
}
func (p *InitParameter) GetModule() Module {
return Module(p.Module)
}
func (p *InitParameter) GetProfile() string {
return p.Profile
}
type InitParameters interface {
GetModule() Module
GetProfile() string
}
type EstInitParameters struct {
Profile string `json:"profile"`
KeyType string `json:"keyType"`
AuthorizationMode string `json:"authorizationMode"`
EnrollmentMode string `json:"enrollmentMode"`
CsrInfoIgnored bool `json:"csrInfoIgnored"`
}
func (p *EstInitParameters) GetModule() Module {
return Est
}
func (p *EstInitParameters) GetProfile() string {
return p.Profile
}
type AcmeExternalInitParameters struct {
Profile string `json:"profile"`
KeyType string `json:"keyType"`
AcmeUrl string `json:"acmeUrl"`
AllowedAuthorizationMethod []string `json:"allowedAuthorizationMethod"`
RequireEAB bool `json:"requireEAB"`
}
func (p *AcmeExternalInitParameters) GetModule() Module {
return AcmeExternal
}
func (p *AcmeExternalInitParameters) GetProfile() string {
return p.Profile
}
type AcmeInitParameters struct {
Profile string `json:"profile"`
KeyType string `json:"keyType"`
TlsAlpn01Port int `json:"tlsAlpn01Port"`
Http01Port int `json:"http01Port"`
}
func (p *AcmeInitParameters) GetModule() Module {
return Acme
}
func (p *AcmeInitParameters) GetProfile() string {
return p.Profile
}
type ScepInitParameters struct {
Profile string `json:"profile"`
KeyType string `json:"keyType"`
CsrInfoIgnored bool `json:"csrInfoIgnored"`
AuthorizationMode string `json:"authorizationMode"`
}
func (p *ScepInitParameters) GetModule() Module {
return Scep
}
func (p *ScepInitParameters) GetProfile() string {
return p.Profile
}
type Report struct {
IsRunnable bool `json:"runnable"`
// If renewable, renew, else enroll
// Is a pointer for compatibility with 2.4
IsRenewable *bool `json:"renewable"`
}