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

Function backendForCreds

pkg/blobmanager/s3accesspoint/backend_test.go:273–286  ·  view source on GitHub ↗
(t *testing.T, creds *Credentials)

Source from the content-addressed store, hash-verified

271}
272
273func backendForCreds(t *testing.T, creds *Credentials) *Backend {
274 t.Helper()
275 t.Setenv("AWS_ACCESS_KEY_ID", "test")
276 t.Setenv("AWS_SECRET_ACCESS_KEY", "test")
277 t.Setenv("AWS_REGION", "us-east-1")
278 // EC2_METADATA_SERVICE_ENDPOINT to a bogus host stops the SDK from
279 // trying IMDS during config load when no static creds are picked
280 // up — defensive in case the env-var pickup order changes.
281 t.Setenv("AWS_EC2_METADATA_DISABLED", "true")
282
283 b, err := NewBackend(context.Background(), creds)
284 require.NoError(t, err)
285 return b
286}
287
288// assertFailedClosed checks that an error originated from the
289// missing-context guard, whether returned directly or wrapped by the

Callers 1

newTestBackendFunction · 0.85

Calls 1

NewBackendFunction · 0.70

Tested by

no test coverage detected