Skip to content

Commit

Permalink
chore: move tsa url print out behind -v flag (notaryproject#996)
Browse files Browse the repository at this point in the history
Resolves notaryproject#992

Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts authored Jul 24, 2024
1 parent 45b123b commit 9c15eec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/notation/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

corex509 "github.com/notaryproject/notation-core-go/x509"
"github.com/notaryproject/notation-go"
"github.com/notaryproject/notation-go/log"
"github.com/notaryproject/notation/cmd/notation/internal/experimental"
"github.com/notaryproject/notation/internal/cmd"
"github.com/notaryproject/notation/internal/envelope"
Expand Down Expand Up @@ -198,6 +199,8 @@ func runSign(command *cobra.Command, cmdOpts *signOpts) error {
}

func prepareSigningOpts(ctx context.Context, opts *signOpts) (notation.SignOptions, error) {
logger := log.GetLogger(ctx)

mediaType, err := envelope.GetEnvelopeMediaType(opts.SignerFlagOpts.SignatureFormat)
if err != nil {
return notation.SignOptions{}, err
Expand All @@ -220,7 +223,7 @@ func prepareSigningOpts(ctx context.Context, opts *signOpts) (notation.SignOptio
}
if opts.tsaServerURL != "" {
// timestamping
fmt.Printf("Configured to timestamp with TSA %q\n", opts.tsaServerURL)
logger.Infof("Configured to timestamp with TSA %q", opts.tsaServerURL)
signOpts.Timestamper, err = tspclient.NewHTTPTimestamper(httputil.NewClient(ctx, &http.Client{Timeout: timestampingTimeout}), opts.tsaServerURL)
if err != nil {
return notation.SignOptions{}, fmt.Errorf("cannot get http timestamper for timestamping: %w", err)
Expand Down

0 comments on commit 9c15eec

Please sign in to comment.