-
Notifications
You must be signed in to change notification settings - Fork 6
/
path_config_ca.go
70 lines (58 loc) · 1.86 KB
/
path_config_ca.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
/*
* Copyright (c) 2019 Entrust Datacard Corporation.
* All rights reserved.
*/
package main
import (
"github.com/hashicorp/vault/logical"
"github.com/hashicorp/vault/logical/framework"
)
func pathConfig(b *backend) *framework.Path {
ret := &framework.Path{
Pattern: "config/" + framework.GenericNameRegex("roleName"),
Operations: map[logical.Operation]framework.OperationHandler{
logical.ReadOperation: &framework.PathOperation{Callback: b.opReadConfigRole},
logical.UpdateOperation: &framework.PathOperation{Callback: b.opWriteConfigRole},
},
HelpSynopsis: "CAGW Configuration",
HelpDescription: "Configures CAGW parameters including client cert and key.",
Fields: map[string]*framework.FieldSchema{},
}
ret.Fields["pem_bundle"] = &framework.FieldSchema{
Type: framework.TypeString,
Default: "",
Description: `PEM encoded client certificate and key.`,
Required: true,
}
ret.Fields["roleName"] = &framework.FieldSchema{
Type: framework.TypeString,
Default: "",
Description: `Role configuration identifier`,
Required: true,
}
ret.Fields["ca_id"] = &framework.FieldSchema{
Type: framework.TypeString,
Default: "",
Description: `CA identifier`,
Required: false,
}
ret.Fields["profile_id"] = &framework.FieldSchema{
Type: framework.TypeString,
Default: "",
Description: `Profile identifier to use for this role configuration`,
Required: false,
}
ret.Fields["url"] = &framework.FieldSchema{
Type: framework.TypeString,
Default: "",
Description: `URL for CAGW including base context path`,
Required: true,
}
ret.Fields["cacerts"] = &framework.FieldSchema{
Type: framework.TypeString,
Default: "",
Description: "PEM encoded CA certificate chain. Not needed if the gateway's " +
"certificate is publicly trusted.",
}
return ret
}