Skip to content

Conversation

cstockton
Copy link
Contributor

@cstockton cstockton commented Apr 1, 2025

These changes refactor hooks out of the api package into internal/hooks/v0hooks. To do this we needed to move errors from internal/api to internal/api/apierrors. This required updating the New*Error functions and updating all existing references to errors in the internal/api package.

@cstockton cstockton marked this pull request as ready for review April 11, 2025 19:45
@cstockton cstockton requested a review from a team as a code owner April 11, 2025 19:45
Copy link
Member

@kangmingtay kangmingtay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might have missed out renaming one of the errors in internal/api/middleware.go line 70, which is causing the tests to fail. Other than that, this change LGTM

@cstockton
Copy link
Contributor Author

I think you might have missed out renaming one of the errors in internal/api/middleware.go line 70, which is causing the tests to fail. Other than that, this change LGTM

Merge conflict, I'll fix.

The existing hooks are now in hooks/v0, using the same tests from
the api package.
@cstockton cstockton force-pushed the cs/hooks-refactor-apierrors branch from b6151d1 to 7cc24cf Compare April 14, 2025 18:03
@coveralls
Copy link

Pull Request Test Coverage Report for Build 14452605043

Details

  • 297 of 702 (42.31%) changed or added relevant lines in 35 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 68.263%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/api.go 5 6 83.33%
internal/api/helpers.go 1 2 50.0%
internal/api/password.go 1 2 50.0%
internal/api/pkce.go 3 4 75.0%
internal/api/web3.go 16 17 94.12%
internal/api/anonymous.go 0 2 0.0%
internal/api/invite.go 0 2 0.0%
internal/api/logout.go 0 2 0.0%
internal/api/recover.go 0 2 0.0%
internal/api/audit.go 0 3 0.0%
Totals Coverage Status
Change from base Build 14443715204: 0.1%
Covered Lines: 10604
Relevant Lines: 15534

💛 - Coveralls

Copy link
Contributor

@hf hf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you edit the title and description to be more specific about the change?

@cstockton cstockton changed the title feat: hooks refactoring feat: refactor hooks out of api package Apr 14, 2025
@cstockton cstockton merged commit c5904c0 into master Apr 14, 2025
6 checks passed
@cstockton cstockton deleted the cs/hooks-refactor-apierrors branch April 14, 2025 18:55
hf pushed a commit that referenced this pull request Apr 15, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.171.0](v2.170.0...v2.171.0)
(2025-04-14)


### Features

* add sign in with solana (EIP-4361) support
([#1918](#1918))
([d121546](d121546))
* allow invalid config directories
([#1969](#1969))
([6b842f6](6b842f6))
* allow limiting lifespan of low-aal sessions
([#1942](#1942))
([d7a9ca6](d7a9ca6))
* Block specific outgoing mail servers
([#1971](#1971))
([091aef9](091aef9))
* refactor hooks out of api package
([#1976](#1976))
([c5904c0](c5904c0))
* separate web3 rate limits from other `/token?grant_type=...`
([#1985](#1985))
([8b23382](8b23382))


### Bug Fixes

* explicit permisions on actions
([#1978](#1978))
([06e9ead](06e9ead))
* propagate error when when confirming phone
([#1939](#1939))
([e882b42](e882b42))
* redirects must not be to ip addresses
([#1984](#1984))
([347e23a](347e23a))
* sanitize redirect URL (remove fragment, query) before pattern matching
([#1974](#1974))
([ccf20d7](ccf20d7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
wdoppenberg pushed a commit to wdoppenberg/supabase-auth that referenced this pull request Jun 5, 2025
These changes refactor hooks out of the api package into
`internal/hooks/v0hooks`. To do this we needed to move errors from
`internal/api` to `internal/api/apierrors`. This required updating the
`New*Error` functions and updating all existing references to errors in
the `internal/api` package.

---------

Co-authored-by: Chris Stockton <[email protected]>
wdoppenberg pushed a commit to wdoppenberg/supabase-auth that referenced this pull request Jun 5, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.171.0](supabase/auth@v2.170.0...v2.171.0)
(2025-04-14)


### Features

* add sign in with solana (EIP-4361) support
([supabase#1918](supabase#1918))
([d121546](supabase@d121546))
* allow invalid config directories
([supabase#1969](supabase#1969))
([6b842f6](supabase@6b842f6))
* allow limiting lifespan of low-aal sessions
([supabase#1942](supabase#1942))
([d7a9ca6](supabase@d7a9ca6))
* Block specific outgoing mail servers
([supabase#1971](supabase#1971))
([091aef9](supabase@091aef9))
* refactor hooks out of api package
([supabase#1976](supabase#1976))
([c5904c0](supabase@c5904c0))
* separate web3 rate limits from other `/token?grant_type=...`
([supabase#1985](supabase#1985))
([8b23382](supabase@8b23382))


### Bug Fixes

* explicit permisions on actions
([supabase#1978](supabase#1978))
([06e9ead](supabase@06e9ead))
* propagate error when when confirming phone
([supabase#1939](supabase#1939))
([e882b42](supabase@e882b42))
* redirects must not be to ip addresses
([supabase#1984](supabase#1984))
([347e23a](supabase@347e23a))
* sanitize redirect URL (remove fragment, query) before pattern matching
([supabase#1974](supabase#1974))
([ccf20d7](supabase@ccf20d7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
cemalkilic pushed a commit that referenced this pull request Aug 7, 2025
These changes refactor hooks out of the api package into
`internal/hooks/v0hooks`. To do this we needed to move errors from
`internal/api` to `internal/api/apierrors`. This required updating the
`New*Error` functions and updating all existing references to errors in
the `internal/api` package.

---------

Co-authored-by: Chris Stockton <[email protected]>
cemalkilic pushed a commit that referenced this pull request Aug 7, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.171.0](v2.170.0...v2.171.0)
(2025-04-14)


### Features

* add sign in with solana (EIP-4361) support
([#1918](#1918))
([d121546](d121546))
* allow invalid config directories
([#1969](#1969))
([6b842f6](6b842f6))
* allow limiting lifespan of low-aal sessions
([#1942](#1942))
([d7a9ca6](d7a9ca6))
* Block specific outgoing mail servers
([#1971](#1971))
([091aef9](091aef9))
* refactor hooks out of api package
([#1976](#1976))
([c5904c0](c5904c0))
* separate web3 rate limits from other `/token?grant_type=...`
([#1985](#1985))
([8b23382](8b23382))


### Bug Fixes

* explicit permisions on actions
([#1978](#1978))
([06e9ead](06e9ead))
* propagate error when when confirming phone
([#1939](#1939))
([e882b42](e882b42))
* redirects must not be to ip addresses
([#1984](#1984))
([347e23a](347e23a))
* sanitize redirect URL (remove fragment, query) before pattern matching
([#1974](#1974))
([ccf20d7](ccf20d7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants