Update primary error functions to take a context, deprecate old functions (#1358)

* add new error funcs which take a ctx and deprecate existing funcs

* use context where available when writing error events

* remove circular internal/errors pkg dep

* suppress some chatty errors using errors.WithoutEvent()

* convert auth oidc funcs to take context where needed to write events

Co-authored-by: Jim <jlambert@hashicorp.com>
This commit is contained in:
s-christoffandJim authored and GitHub committed 2021-07-29 20:52:56 -04:00
1 parent 02ff2db66e
commit 6b78108ecf
227 files changed
+3945 -3736

No files matched your search

@@ -24,11 +24,11 @@ func Test_AuthMethodSubtypes(t *testing.T) {
kmsCache := kms.TestKms(t, conn, rootWrapper)
iamRepo := iam.TestRepo(t, conn, rootWrapper)
org, _ := iam.TestScopes(t, iamRepo)
oidcRepo, err := oidc.NewRepository(rw, rw, kmsCache)
oidcRepo, err := oidc.NewRepository(ctx, rw, rw, kmsCache)
require.NoError(err)
// test oidc subtype insert
oidcAm, err := oidc.NewAuthMethod(org.PublicId, "alice-rp", "fido", oidc.WithName("alice"))
oidcAm, err := oidc.NewAuthMethod(ctx, org.PublicId, "alice-rp", "fido", oidc.WithName("alice"))
require.NoError(err)
oidcAm, err = oidcRepo.CreateAuthMethod(ctx, oidcAm)
require.NoError(err)