-
Notifications
You must be signed in to change notification settings - Fork 261
Expand file tree
/
Copy pathage_secret_key.go
More file actions
40 lines (37 loc) · 1.15 KB
/
age_secret_key.go
File metadata and controls
40 lines (37 loc) · 1.15 KB
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
package sops
import (
"github.com/1Password/shell-plugins/sdk"
"github.com/1Password/shell-plugins/sdk/importer"
"github.com/1Password/shell-plugins/sdk/provision"
"github.com/1Password/shell-plugins/sdk/schema"
"github.com/1Password/shell-plugins/sdk/schema/credname"
"github.com/1Password/shell-plugins/sdk/schema/fieldname"
)
func AgeSecretKey() schema.CredentialType {
return schema.CredentialType{
Name: credname.SecretKey,
DocsURL: sdk.URL("https://github.com/getsops/sops#encrypting-using-age"),
ManagementURL: nil,
Fields: []schema.CredentialField{
{
Name: fieldname.PrivateKey,
MarkdownDescription: "Age secret key used by SOPS for encryption and decryption.",
Secret: true,
Composition: &schema.ValueComposition{
Prefix: "AGE-SECRET-KEY-",
Charset: schema.Charset{
Uppercase: true,
Digits: true,
},
},
},
},
DefaultProvisioner: provision.EnvVars(defaultEnvVarMapping),
Importer: importer.TryAll(
importer.TryEnvVarPair(defaultEnvVarMapping),
),
}
}
var defaultEnvVarMapping = map[string]sdk.FieldName{
"SOPS_AGE_KEY": fieldname.PrivateKey,
}