MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / newTestBackend

Function newTestBackend

pkg/blobmanager/s3accesspoint/backend_test.go:264–271  ·  view source on GitHub ↗

--- helpers ----------------------------------------------------------- newTestBackend constructs a fully wired *Backend that uses static dummy AWS credentials so LoadDefaultConfig doesn't reach out to IMDS/SSO. The resulting STS client would only be invoked if a test path slipped past the fail-clos

(t *testing.T)

Source from the content-addressed store, hash-verified

262// the fail-closed guard — in which case the dummy creds would still
263// trigger a fast, deterministic failure rather than a real AWS call.
264func newTestBackend(t *testing.T) *Backend {
265 t.Helper()
266 return backendForCreds(t, &Credentials{
267 AccessPointARN: "arn:aws:s3:us-east-1:123456789012:accesspoint/chainloop-org-abc",
268 Region: "us-east-1",
269 BaseRoleARN: "arn:aws:iam::123456789012:role/chainloop-cas-tenant",
270 })
271}
272
273func backendForCreds(t *testing.T, creds *Credentials) *Backend {
274 t.Helper()

Calls 1

backendForCredsFunction · 0.85

Tested by

no test coverage detected