mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
identity: support jwt expiration and rotation (#18262)
Implements expirations and renewals for alternate workload identity tokens.
This commit is contained in:
20
testutil/file.go
Normal file
20
testutil/file.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user