Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving recovery code APIs under /identity and using POST #1492

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

lcodes
Copy link
Contributor

@lcodes lcodes commented Jul 10, 2024

Description of Changes

#1372

Added control_routes to identity, based off database's.
Moved the recovery code APIs there.
Switched them to expect POST.

API and ABI breaking changes

Changes both the request method and the router endpoints of the recovery code API.

Expected complexity level and risk

0

Testing

curl -X POST "localhost:3000/identity/[email protected]&identity=1234567890123456789012345678901234567890123456789012345678901234"
curl -X POST "localhost:3000/identity/[email protected]&identity=1234567890123456789012345678901234567890123456789012345678901234&code=1"

Assuming the previous handler code is correct, this validates the routes and request method switches.

axum::Router::new()
.route("/request_recovery_code", post(request_recovery_code::<S>))
.route("/confirm_recovery_code", post(confirm_recovery_code::<S>))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this a separate Router rather than just being part of the existing one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was following the pattern of database's control/worker routes, but yeah merging them has the same effect.

Copy link
Collaborator

@bfops bfops Jul 11, 2024

Choose a reason for hiding this comment

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

Yeah I think this merging makes sense, thank you. I did a bit of investigating and it seems like even in database.rs the distinction isn't important anymore.

@bfops
Copy link
Collaborator

bfops commented Jul 11, 2024

@lcodes It looks like the smoketests are failing, but I don't think it has anything to do with this PR - can you update with latest master and see if that fixes it?

Unfortunately, I don't think there's a way to test this recovery flow locally, so we'll have to merge and test it once deployed that has SendGrid enabled.

@lcodes lcodes force-pushed the jeremie/api-stability/recovery-codes branch from 27434b5 to 6bc2019 Compare July 12, 2024 14:47
@bfops bfops added release-any To be landed in any release window api-break labels Jul 15, 2024
Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me! Let's try to remember to test this once it lands somewhere with SendGrid enabled.

@bfops bfops force-pushed the jeremie/api-stability/recovery-codes branch from b944987 to 906b2ec Compare July 16, 2024 18:14
@lcodes lcodes added this pull request to the merge queue Jul 17, 2024
Merged via the queue into master with commit 3e6f91b Jul 17, 2024
7 checks passed
@lcodes lcodes deleted the jeremie/api-stability/recovery-codes branch July 17, 2024 13:40
@bfops bfops added the api-break A PR that makes an API breaking change label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-break A PR that makes an API breaking change release-any To be landed in any release window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[STABILITY] /database/request_recovery_code and /database/confirm_recovery_code should be POST, not GET.
2 participants