move token to constant

Signed-off-by: Paul Whitehead <pwhitehead@splunk.com>
This commit is contained in:
Paul Whitehead 2024-05-09 15:15:09 -06:00
parent 910ca56d58
commit 8bed53266e
2 changed files with 4 additions and 3 deletions

View File

@ -1 +0,0 @@
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNzEwMzUxNjM4LCJpc3MiOiJodHRwczovL2V4YW1wbGUuY29tIiwiYXVkIjoiaHR0cHM6Ly9leGFtcGxlLmNvbSIsImV4cCI6MTc0MTg4NzYwOH0.yu4G8_3ZDsWA1wJC4jZjh9FCEGbW0eke1ffFw1Xhvvw

View File

@ -32,6 +32,8 @@ import (
logf "github.com/cert-manager/cert-manager/pkg/logs"
)
const jwt string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJzdHMuYW1hem9uYXdzLmNvbSIsImV4cCI6MTc0MTg4NzYwOCwiaWF0IjoxNzEwMzUxNjM4LCJpc3MiOiJodHRwczovL2V4YW1wbGUuY29tIiwibmFtZSI6IkpvaG4gRG9lIiwic3ViIjoiMTIzNDU2Nzg5MCJ9.SfuV3SW-vEdV-tLFIr2PK2DnN6QYmozygav5OeoH36Q"
func makeRoute53Provider(ts *httptest.Server) (*DNSProvider, error) {
cfg, err := config.LoadDefaultConfig(
context.TODO(),
@ -228,7 +230,7 @@ func TestAssumeRole(t *testing.T) {
{
name: "should assume role with web identity",
role: "my-role",
webIdentityToken: "../../../../../hack/webIdentityToken",
webIdentityToken: jwt,
expErr: false,
expCreds: creds,
mockSTS: &mockSTS{
@ -241,7 +243,7 @@ func TestAssumeRole(t *testing.T) {
},
{
name: "require role when using assume role with web identity",
webIdentityToken: "../../../../../hack/webIdentityToken",
webIdentityToken: jwt,
expErr: true,
expCreds: nil,
mockSTS: &mockSTS{