github
feat: hooks round 3 - begin adding the Before and After user created hooks (#2028) ## Hooks Round 3 This PR will contain a series of commits preparing for the implementation of before & after user created hooks. It takes the feedback from https://github.com/supabase/auth/pull/2012 into consideration. ### Summary Begin adding the Before and After user created hooks: * update pkg `internal/conf` [d5f5436](https://github.com/supabase/auth/pull/2028/commits/d5f5436ce) * add `BeforeUserCreated` and `AfterUserCreated` to `HookConfiguration` struct * add test cases for `EmailValidationBlockedMX` to restore 100% test coverage * update pkg `internal/hooks/v0hooks` [bd37fe2](https://github.com/supabase/auth/pull/2028/commits/bd37fe23c) * add `BeforeUserCreated` method to `v0hooks.Manager` struct * add `AfterUserCreated` method to `v0hooks.Manager` struct * add tests to reach 100% coverage * add pkg `internal/e2e/e2ehooks` [903e623](https://github.com/supabase/auth/pull/2028/commits/903e623ea) * add `HookCall` to record calls to hooks * add `Hook` struct to hold `[]*HookCall` for a given hook name * add `HookRecorder` to hold one `Hook` object per hook name * add `Instance` struct to hold the `httptest.Server` and `HookRecorder` * add `AfterUserCreated` method to `v0hooks.Manager` struct * add tests to reach 100% coverage in all `internal/e2e` packages * update pkg `internal/hooks/v0hooks` [829aec6](https://github.com/supabase/auth/pull/2028/commits/829aec6bb) * fix struct and json tag to match to match the Metadata type * update pkg `internal/hooks/v0hooks` [ca67be0](https://github.com/supabase/auth/pull/2028/commits/ca67be0db) * remove `BeforeUserCreated` and `AfterUserCreated` methods * add Before & After user created hooks in `InvokeHook` * update pkg `intern... (continued)
319 of 321 new or added lines in 11 files covered. (99.38%)
13 existing lines in 3 files now uncovered.11129 of 15895 relevant lines covered (70.02%)
64.96 hits per line