Skip to content

Commit 3e3dfa4

Browse files
author
MB Burch
committed
Add additional config options
1 parent 3821543 commit 3e3dfa4

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

pkg/config/config.go

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,36 @@ import (
77
var (
88
accessTokenField = field.StringField(
99
"token",
10+
field.WithDisplayName("Personal access token"),
1011
field.WithDescription("The GitHub access token used to connect to the GitHub API."),
12+
field.WithRequired(true),
13+
field.WithIsSecret(true),
1114
)
1215
orgsField = field.StringSliceField(
1316
"orgs",
17+
field.WithDisplayName("Organizations"),
1418
field.WithDescription("Limit syncing to specific organizations."),
1519
)
1620
instanceUrlField = field.StringField(
1721
"instance-url",
22+
field.WithDisplayName("GitHub instance URL"),
1823
field.WithDescription(`The GitHub instance URL to connect to. (default "https://github.com")`),
1924
)
2025
appIDField = field.StringField(
2126
"app-id",
27+
field.WithDisplayName("GitHub App ID"),
2228
field.WithDescription("The GitHub App to connect to."),
2329
)
2430

2531
appPrivateKeyPath = field.StringField(
2632
"app-privatekey-path",
33+
field.WithDisplayName("GitHub App private key (.pem)"),
2734
field.WithDescription("Path to private key that is used to connect to the GitHub App"),
35+
field.WithIsSecret(true),
2836
)
2937
syncSecrets = field.BoolField(
3038
"sync-secrets",
39+
field.WithDisplayName("Sync secrets"),
3140
field.WithDescription(`Whether to sync secrets or not`),
3241
)
3342
fieldRelationships = []field.SchemaFieldRelationship{
@@ -43,11 +52,17 @@ var (
4352
)
4453

4554
//go:generate go run ./gen
46-
var Config = field.NewConfiguration([]field.SchemaField{
47-
accessTokenField,
48-
orgsField,
49-
instanceUrlField,
50-
syncSecrets,
51-
appIDField,
52-
appPrivateKeyPath,
53-
}, field.WithConstraints(fieldRelationships...))
55+
var Config = field.NewConfiguration(
56+
[]field.SchemaField{
57+
accessTokenField,
58+
orgsField,
59+
instanceUrlField,
60+
syncSecrets,
61+
appIDField,
62+
appPrivateKeyPath,
63+
},
64+
field.WithConstraints(fieldRelationships...),
65+
field.WithConnectorDisplayName("GitHub v2"),
66+
field.WithHelpUrl("/docs/baton/github-v2"),
67+
field.WithIconUrl("/static/app-icons/github.svg"),
68+
)

0 commit comments

Comments
 (0)