identity: support jwt expiration and rotation (#18262)

Implements expirations and renewals for alternate workload identity tokens.
This commit is contained in:
Michael Schurter
2023-09-08 14:50:34 -07:00
committed by GitHub
parent 22cbb913db
commit ef24e40b39
12 changed files with 706 additions and 54 deletions

20
testutil/file.go Normal file
View File

@@ -0,0 +1,20 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package testutil
import (
"os"
"path/filepath"
testing "github.com/mitchellh/go-testing-interface"
"github.com/shoenig/test/must"
)
// MustReadFile returns the contents of the specified file or fails the test.
// Multiple arguments are joined with filepath.Join.
func MustReadFile(t testing.T, path ...string) []byte {
contents, err := os.ReadFile(filepath.Join(path...))
must.NoError(t, err)
return contents
}