Skip to content

Commit

Permalink
add timeout flag to attest cli command (#785)
Browse files Browse the repository at this point in the history
Signed-off-by: Brian DeHamer <[email protected]>
  • Loading branch information
bdehamer authored Oct 4, 2023
1 parent f52ee51 commit cc42dae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-olives-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sigstore/cli': minor
---

Add timeout flag to attest command
5 changes: 3 additions & 2 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $ npm install -g @sigstore/cli
$ sigstore COMMAND
running command...
$ sigstore (--version)
@sigstore/cli/0.2.1 darwin-arm64 node-v18.12.1
@sigstore/cli/0.3.0 darwin-arm64 node-v18.12.1
$ sigstore --help [COMMAND]
USAGE
$ sigstore COMMAND
Expand All @@ -31,7 +31,7 @@ attest the supplied file
USAGE
$ sigstore attest FILE [--json] [--fulcio-url <value>] [--rekor-url <value>] [--tsa-server-url <value>]
[--tlog-upload] [--oidc-client-id <value>] [--oidc-client-secret <value>] [--oidc-issuer <value>]
[--oidc-redirect-url <value>] [-t <value>] [-o <value>]
[--oidc-redirect-url <value>] [-t <value>] [-o <value>] [--timeout <value>]
ARGUMENTS
FILE file to attest
Expand All @@ -46,6 +46,7 @@ FLAGS
--oidc-issuer=<value> [default: https://oauth2.sigstore.dev/auth] OIDC provider to be used to issue ID token
--oidc-redirect-url=<value> OIDC redirect URL
--rekor-url=<value> [default: https://rekor.sigstore.dev] URL to the Rekor transparency log
--timeout=<value> [default: 5] timeout in seconds for API requests
--[no-]tlog-upload whether or not to upload entry to the transparency log
--tsa-server-url=<value> URL to the Timestamping Authority
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/src/commands/attest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ export default class Attest extends Command {
required: false,
aliases: ['output', 'out'],
}),
timeout: Flags.integer({
description: 'timeout in seconds for API requests',
default: 5,
required: false,
}),
};

static override args = {
Expand Down Expand Up @@ -100,6 +105,7 @@ export default class Attest extends Command {
tsaServerURL: flags['tsa-server-url'],
tlogUpload: flags['tlog-upload'],
identityProvider,
timeout: flags.timeout * 1000,
};

const bundle = await fs
Expand Down

0 comments on commit cc42dae

Please sign in to comment.