From 3102b338bf1b9d4487c5a5b0d9ae2cddfffc3829 Mon Sep 17 00:00:00 2001 From: Ruide Zhang Date: Mon, 25 Sep 2023 10:37:39 -0700 Subject: [PATCH] output token byte unparsed --- cmd/gen_token.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/gen_token.go b/cmd/gen_token.go index f6f98e95..1893b93d 100644 --- a/cmd/gen_token.go +++ b/cmd/gen_token.go @@ -110,7 +110,7 @@ The OIDC token includes claims regarding the authentication of the user by the a attestAgent := agent.CreateAttestationAgent(rwc, attestationKeys[key][keyAlgo], verifierClient, principalFetcher) - fmt.Fprintf(messageOutput(), "Fetching attestation verifier OIDC token\n") + fmt.Fprintf(debugOutput(), "Fetching attestation verifier OIDC token\n") token, err := attestAgent.Attest(ctx) if err != nil { return fmt.Errorf("failed to retrieve attestation service token: %v", err) @@ -139,12 +139,14 @@ The OIDC token includes claims regarding the authentication of the user by the a return fmt.Errorf("failed to format claims: %w", err) } + fmt.Fprintf(debugOutput(), string(claimsString)+"\n") + if output == "" { - fmt.Fprintf(messageOutput(), string(claimsString)+"\n") + fmt.Fprintf(messageOutput(), string(token)+"\n") } if output != "" { - out := []byte(string(claimsString)) + out := []byte(token) if _, err := dataOutput().Write(out); err != nil { return fmt.Errorf("failed to write attestation report: %v", err) }