Skip to content

Commit

Permalink
Update README and default values
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Garf <[email protected]>
  • Loading branch information
stgarf committed Mar 4, 2024
1 parent 5eced6b commit 6d8e155
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ The following config options are supported:
| GITSIGN_TIMESTAMP_CERT_CHAIN || | Path to PEM encoded certificate chain for RFC3161 Timestamp Authority verification. |
| GITSIGN_FULCIO_ROOT || | Path to PEM encoded certificate for Fulcio CA (additional alias: SIGSTORE_ROOT_FILE) |
| GITSIGN_REKOR_MODE || online | Rekor storage mode to operate in. One of [online, offline] (default: online)<br>online - Commit SHAs are stored in Rekor, requiring online verification for all commit objects.<br>offline - Hashed commit content is stored in Rekor, with Rekor attributes necessary for offline verification being stored in the commit itself.<br>Note: online verification will be deprecated in favor of offline in the future. |
| GITSIGN_AUTOCLOSE || false | If true, autoclose the browser window after `GITSIGN_AUTOCLOSE_TIME`. |
| GITSIGN_AUTOCLOSE_TIMEOUT || 10 | If `GITSIGN_AUTOCLOSE` is true, this is how long to wait until the window is closed. |
| GITSIGN_AUTOCLOSE || true | If true, autoclose the browser window after `GITSIGN_AUTOCLOSE_TIME`. |
| GITSIGN_AUTOCLOSE_TIMEOUT || 6 | If `GITSIGN_AUTOCLOSE` is true, this is how long to wait until the window is closed. |

For environment variables that support `Sigstore Prefix`, the values may be
provided with either a `GITSIGN_` or `SIGSTORE_` prefix - e.g.
Expand Down
10 changes: 5 additions & 5 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type Config struct {
CommitterEmail string
MatchCommitter bool

// Autoclose specifies whether to close window after sucessful authentication
// Autoclose specifies whether to close window after successful authentication
Autoclose bool
// AutocloseTimeout specifies the time to wait before closing the window
AutocloseTimeout int
Expand All @@ -106,8 +106,8 @@ func Get() (*Config, error) {
Issuer: "https://oauth2.sigstore.dev/auth",
// TODO: default to offline
RekorMode: "online",
Autoclose: false,
AutocloseTimeout: 10,
Autoclose: true,
AutocloseTimeout: 6,
}

// Get values from config file.
Expand Down Expand Up @@ -220,8 +220,8 @@ func applyGitOptions(out *Config, cfg map[string]string) {
if i, err := strconv.Atoi(v); err == nil && i > 0 {
out.AutocloseTimeout = i
} else {
log.Printf("invalid gitsign.autocloseTimeout value %q, defaulting to 10", v)
out.AutocloseTimeout = 10
log.Printf("invalid gitsign.autocloseTimeout value %q, defaulting to 6", v)
out.AutocloseTimeout = 6
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func TestGet(t *testing.T) {
RedirectURL: "example.com",
ConnectorID: "bar",
RekorMode: "online",
Autoclose: false,
AutocloseTimeout: 10,
Autoclose: true,
AutocloseTimeout: 6,
}

execFn = func() (io.Reader, error) {
Expand Down

0 comments on commit 6d8e155

Please sign in to comment.