Add support for OAuth login #1719

Merged
ginger merged 50 commits from ginger/oauth into main 2026-06-29 13:53:50 +00:00
Owner

This pull request adds support for authenticating clients using the new OAuth 2.0 login API. It does not add support for authenticating clients with an external identity provider.

Currently working clients:

Fixes !1211.

Pull request checklist:

  • This pull request targets the main branch, and the branch is named something other than
    main.
  • I have written an appropriate pull request title and my description is clear.
  • I understand I am responsible for the contents of this pull request.
  • I have followed the contributing guidelines:
This pull request adds support for authenticating clients using the new OAuth 2.0 login API. It ***does not*** add support for authenticating clients with an external identity provider. Currently working clients: - Element nightly (https://develop.element.io) <!-- Example: This pull request allows us to warp through time and space ten times faster than before by double-inverting the warp drive with hyperheated jump fluid, both making the drive faster and more efficient. This resolves the common issue where we have to wait more than 10 milliseconds to engage, use, and disengage the warp drive when travelling between galaxies. --> Fixes !1211. <!-- Fixes: #... --> <!-- Uncomment the above line(s) if your pull request fixes an issue or closes another pull request by superseding it. Replace `#...` with the issue/pr number, such as `#123`. --> **Pull request checklist:** <!-- You need to complete these before your PR can be considered. If you aren't sure about some, feel free to ask for clarification in #dev:continuwuity.org. --> - [x] This pull request targets the `main` branch, and the branch is named something other than `main`. - [x] I have written an appropriate pull request title and my description is clear. - [x] I understand I am responsible for the contents of this pull request. - I have followed the [contributing guidelines][c1]: - [x] My contribution follows the [code style][c2], if applicable. - [x] I ran [pre-commit checks][c1pc] before opening/drafting this pull request. - [x] I have [tested my contribution][c1t] (or proof-read it for documentation-only changes) myself, if applicable. This includes ensuring code compiles. - [x] My commit messages follow the [commit message format][c1cm] and are descriptive. - [x] I have written a [news fragment][n1] for this PR, if applicable<!--(can be done after hitting open!)-->. <!-- Notes on these requirements: - While not required, we encourage you to sign your commits with GPG or SSH to attest the authenticity of your changes. - While we allow LLM-assisted contributions, we do not appreciate contributions that are low quality, which is typical of machine-generated contributions that have not had a lot of love and care from a human. Please do not open a PR if all you have done is asked ChatGPT to tidy up the codebase with a +-100,000 diff. - In the case of code style violations, reviewers may leave review comments/change requests indicating what the ideal change would look like. For example, a reviewer may suggest you lower a log level, or use `match` instead of `if/else` etc. - In the case of code style violations, pre-commit check failures, minor things like typos/spelling errors, and in some cases commit format violations, reviewers may modify your branch directly, typically by making changes and adding a commit. Particularly in the latter case, a reviewer may rebase your commits to squash "spammy" ones (like "fix", "fix", "actually fix"), and reword commit messages that don't satisfy the format. - Pull requests MUST pass the `Checks` CI workflows to be capable of being merged. This can only be bypassed in exceptional circumstances. If your CI flakes, let us know in matrix:r/dev:continuwuity.org. - Pull requests have to be based on the latest `main` commit before being merged. If the main branch changes while you're making your changes, you should make sure you rebase on main before opening a PR. Your branch will be rebased on main before it is merged if it has fallen behind. - We typically only do fast-forward merges, so your entire commit log will be included. Once in main, it's difficult to get out cleanly, so put on your best dress, smile for the cameras! --> [c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md [c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx [c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks [c1t]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#running-tests-locally [c1cm]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages [n1]: https://towncrier.readthedocs.io/en/stable/tutorial.html#creating-news-fragments
fix: Remove errant whitespace in device details
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 28s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m27s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m22s
Checks / Prek / Check changed files (pull_request) Successful in 29s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m57s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 12m17s
4156d50b80
ginger force-pushed ginger/oauth from 4156d50b80
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 28s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m27s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m22s
Checks / Prek / Check changed files (pull_request) Successful in 29s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m57s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 12m17s
to 5fd3e16605
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 9s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m41s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m19s
Checks / Prek / Check changed files (pull_request) Successful in 8s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m48s
2026-05-03 14:49:39 +00:00
Compare
ginger force-pushed ginger/oauth from 5fd3e16605
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 9s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m41s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m19s
Checks / Prek / Check changed files (pull_request) Successful in 8s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m48s
to a2bfe66e4c
All checks were successful
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 32s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m21s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m29s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m33s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 11m42s
2026-05-05 15:23:00 +00:00
Compare
ginger force-pushed ginger/oauth from a2bfe66e4c
All checks were successful
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 32s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m21s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m29s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m33s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 11m42s
to ad5c0d4b84
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 11s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m19s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m35s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m36s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5m55s
2026-05-06 18:07:48 +00:00
Compare
ginger changed title from WIP: Add support for OAuth login to Add support for OAuth login 2026-05-06 18:08:11 +00:00
fix: Don't let logged-in users access the registration page
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Checks / Prek / Check changed files (pull_request) Successful in 31s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m18s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m37s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m36s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 8m45s
36a49fb500
feat: Implement support for prompt=create in the authorization code flow
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Checks / Prek / Check changed files (pull_request) Successful in 32s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m13s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m32s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m44s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 7m39s
42f0da68c1
fix: Fix registration terms example in config
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 33s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m24s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m31s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m34s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5m41s
b9d636014f
ginger force-pushed ginger/oauth from b9d636014f
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 33s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m24s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m31s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m34s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5m41s
to 49cf772b80
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 33s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m27s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m39s
Checks / Prek / Check changed files (pull_request) Successful in 29s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m21s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5m27s
2026-05-07 14:30:26 +00:00
Compare
@ -303,4 +192,2 @@
}
#[admin_command]
pub(super) async fn issue_password_reset_link(&self, username: String) -> Result {
Owner

RIP?

RIP?
Author
Owner

It wasn't compatible with oauth password resets😔

It wasn't compatible with oauth password resets😔
ginger marked this conversation as resolved
src/web/mod.rs Outdated
@ -67,6 +96,7 @@ impl IntoResponse for WebError {
context: TemplateContext {
// Statically set false to prevent error pages from being indexed.
allow_indexing: false,
csp_nonce: String::new(),
Owner

🤨

🤨
Author
Owner

Nothing in the error template needs a CSP nonce, and we can't access the regular template context inside the IntoResponse impl, so it's fine to just make one up here.

Nothing in the error template needs a CSP nonce, and we can't access the regular template context inside the `IntoResponse` impl, so it's fine to just make one up here.
Owner

Perhaps make it an option then?

Perhaps make it an option then?
Author
Owner

That would require unwrap()ping it in every other template which needs it, because for those templates there should always be a CSP nonce.

That would require `unwrap()`ping it in every other template which needs it, because for those templates there should always be a CSP nonce.
Jade marked this conversation as resolved
@ -0,0 +23,4 @@
<form method="get" action="validate">
<input type="hidden" name="session_id" value="{{ session_id }}">
<input type="hidden" name="client_secret" value="{{ client_secret }}">
<button type="submit">Continue</button>
Owner

Is it still possible to continue the flow if this window gets unloaded / backgrounded? Common issue on mobile where switching from the browser to the email client can kill the page

Is it still possible to continue the flow if this window gets unloaded / backgrounded? Common issue on mobile where switching from the browser to the email client can kill the page
ginger marked this conversation as resolved
@ -0,0 +21,4 @@
<form method="get" action="validate">
<input type="hidden" name="session_id" value="{{ session_id }}">
<input type="hidden" name="client_secret" value="{{ client_secret }}">
<button type="submit">Continue</button>
Owner

Same here

Same here
ginger marked this conversation as resolved
fix: Set default for allow_deactivation
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 30s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m12s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m37s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m27s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
f64c368c16
fix: Minor wording improvements
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Check changed files (pull_request) Successful in 29s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m13s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m22s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m34s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6m29s
770ed4ad3f
feat: Improve registration UI in first-run mode
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Checks / Prek / Check changed files (pull_request) Successful in 34s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m11s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m35s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m42s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5m49s
1928e4d761
ginger force-pushed ginger/oauth from 1928e4d761
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Checks / Prek / Check changed files (pull_request) Successful in 34s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m11s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m35s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m42s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5m49s
to a16840e32b
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 31s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m32s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m23s
Checks / Prek / Check changed files (pull_request) Successful in 30s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m34s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5m33s
2026-05-07 20:52:45 +00:00
Compare
fix: Use svh instead of vh for body min height
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 28s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m18s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m17s
Checks / Prek / Check changed files (pull_request) Successful in 29s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m30s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6m17s
83b753ec7e
ginger force-pushed ginger/oauth from 83b753ec7e
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 28s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m18s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m17s
Checks / Prek / Check changed files (pull_request) Successful in 29s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m30s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6m17s
to 845f8c0484
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 35s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m17s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m38s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m36s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 7m21s
2026-05-08 14:07:25 +00:00
Compare
ginger force-pushed ginger/oauth from 845f8c0484
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 35s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m17s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m38s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m36s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 7m21s
to f5a38dd787
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 35s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m19s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m34s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m34s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6m23s
2026-05-08 18:22:16 +00:00
Compare
ginger force-pushed ginger/oauth from f5a38dd787
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 35s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m19s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m34s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m34s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6m23s
to 0afd791e79
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 35s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m37s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m32s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 7m2s
2026-05-13 15:56:05 +00:00
Compare
chore: My Giant Future
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 35s
Checks / Prek / Check changed files (pull_request) Successful in 30s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m10s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m33s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m39s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m25s
743447765a
Jade force-pushed ginger/oauth from 743447765a
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 35s
Checks / Prek / Check changed files (pull_request) Successful in 30s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m10s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m33s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m39s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m25s
to 57109ff385
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m32s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
Documentation / Build and Deploy Documentation (pull_request) Successful in 2m1s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m4s
2026-05-15 19:36:12 +00:00
Compare
ginger force-pushed ginger/oauth from 57109ff385
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m32s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
Documentation / Build and Deploy Documentation (pull_request) Successful in 2m1s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m4s
to 9776f1f1fc
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Checks / Prek / Check changed files (pull_request) Successful in 32s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m19s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m43s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 21m12s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 32m23s
2026-05-19 18:42:11 +00:00
Compare
ginger force-pushed ginger/oauth from 239455ea49 to 5e20f117d3
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Checks / Prek / Check changed files (pull_request) Successful in 34s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m19s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 21m8s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 32m12s
2026-05-20 15:31:25 +00:00
Compare
ginger force-pushed ginger/oauth from 5e20f117d3
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Checks / Prek / Check changed files (pull_request) Successful in 34s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m19s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 21m8s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 32m12s
to afaa04b941
All checks were successful
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 35s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m32s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
Documentation / Build and Deploy Documentation (pull_request) Successful in 10m47s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 11m34s
2026-05-21 15:37:11 +00:00
Compare
ginger force-pushed ginger/oauth from afaa04b941
All checks were successful
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 35s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m32s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m37s
Documentation / Build and Deploy Documentation (pull_request) Successful in 10m47s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 11m34s
to 3a1c287f17
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 37s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m31s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m35s
Documentation / Build and Deploy Documentation (pull_request) Successful in 10m51s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 32m12s
2026-05-22 13:35:26 +00:00
Compare
ginger force-pushed ginger/oauth from 3a1c287f17
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 37s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m31s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m35s
Documentation / Build and Deploy Documentation (pull_request) Successful in 10m51s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 32m12s
to a316ebe734
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 28s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m28s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m32s
Documentation / Build and Deploy Documentation (pull_request) Successful in 10m44s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m17s
2026-05-26 13:16:04 +00:00
Compare
ginger force-pushed ginger/oauth from a316ebe734
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 28s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m28s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m32s
Documentation / Build and Deploy Documentation (pull_request) Successful in 10m44s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m17s
to 45e14bd1ed
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Has been cancelled
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Check changed files (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
2026-05-26 18:26:21 +00:00
Compare
ginger force-pushed ginger/oauth from a316ebe734
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 28s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m28s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m32s
Documentation / Build and Deploy Documentation (pull_request) Successful in 10m44s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m17s
to 6756bacfc8
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 30s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m37s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m38s
Documentation / Build and Deploy Documentation (pull_request) Successful in 10m40s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m21s
2026-05-26 18:27:18 +00:00
Compare
ginger force-pushed ginger/oauth from 6756bacfc8
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 30s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m37s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m38s
Documentation / Build and Deploy Documentation (pull_request) Successful in 10m40s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m21s
to c663a0903e
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Documentation / Build and Deploy Documentation (pull_request) Failing after 2m18s
Checks / Prek / Check changed files (pull_request) Successful in 28s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m30s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5m26s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 14m2s
2026-05-27 16:35:27 +00:00
Compare
@ -2354,0 +2367,4 @@
/// The language code to provide to clients along with the policy documents.
///
/// default: "en"
pub language: String,
Author
Owner

"default" my ass, this has no such thing

"default" my ass, this has no such thing
ginger marked this conversation as resolved
ginger force-pushed ginger/oauth from 5e23545fb5
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m28s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 2m21s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 7m29s
Documentation / Build and Deploy Documentation (pull_request) Failing after 2m15s
to 476f5249ce
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m3s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m13s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m35s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 7m29s
2026-06-08 14:38:10 +00:00
Compare
ginger force-pushed ginger/oauth from 3ca0b6ba52
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m11s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m56s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 7m39s
to 46e2607aeb
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m9s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Documentation / Build and Deploy Documentation (pull_request) Successful in 2m7s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m24s
2026-06-16 16:51:36 +00:00
Compare
@ -31,3 +31,3 @@
self.write_str(&format!(
"New registration token issued: `{token}`. {}.",
"New registration token issued: `{token}` . {}.",
Owner

unnecessary whitespace?

unnecessary whitespace?
Author
Owner

That's intentional, it allows you to copy the token out of a terminal emulator by double-clicking on it without selecting the period as well.

That's intentional, it allows you to copy the token out of a terminal emulator by double-clicking on it without selecting the period as well.
@ -90,0 +57,4 @@
.await?;
let password = HashedPassword::new(
&password.unwrap_or_else(|| utils::random_string(AUTO_GEN_PASSWORD_LENGTH)),
Owner

Why would we want to auto-generate passwords?

Why would we want to auto-generate passwords?
Author
Owner

That's been the default behavior of this admin command since it was implemented

That's been the default behavior of this admin command since it was implemented
Owner

Also, generally generating a secure password by default is a better idea than leaving a human to come up with it, even if the admin room isn't really encrypted.

Also, generally generating a secure password by default is a better idea than leaving a human to come up with it, even if the admin room isn't really encrypted.
nex marked this conversation as resolved
@ -288,0 +262,4 @@
let sender_user = identity.expect_sender_user()?;
if !services.config.allow_deactivation {
Owner

Why would we ever want to forbid deactivating one's own account?

Why would we ever want to forbid deactivating one's own account?
Author
Owner

I don't recall exactly what I was thinking when I implemented this, but it could be useful in a corporate environment where you don't want your users to click buttons they shouldn't click

I don't recall exactly what I was thinking when I implemented this, but it could be useful in a corporate environment where you don't want your users to click buttons they shouldn't click
nex marked this conversation as resolved
@ -288,0 +263,4 @@
let sender_user = identity.expect_sender_user()?;
if !services.config.allow_deactivation {
return Err!(Request(Unauthorized(
Owner

Should be Forbidden instead of Unauthorized

Should be Forbidden instead of Unauthorized
ginger marked this conversation as resolved
ginger force-pushed ginger/oauth from 46e2607aeb
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m9s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Documentation / Build and Deploy Documentation (pull_request) Successful in 2m7s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m24s
to 3e8ec63e42
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Check changed files (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
2026-06-23 13:56:07 +00:00
Compare
fix: Adjust error code
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m1s
Checks / Prek / Check changed files (pull_request) Successful in 8s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m1s
Update flake hashes / update-flake-hashes (pull_request) Successful in 2m1s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m56s
e1a4dae224
@ -0,0 +145,4 @@
})?;
let client_id = base64::prelude::BASE64_STANDARD
.encode(sha256::hash(serde_json::to_string(metadata).unwrap().as_bytes()));
Owner

not even like a hash? you're just gonna stuff the entire client registration JSON as base64 into the column key? bold

not even like a hash? you're just gonna stuff the entire client registration JSON as base64 into the column key? bold
Owner

Uh looks like a sha256 to me

Uh looks like a sha256 to me
Member

That literally is a sha256 hash, but just encoded in base64, no?

That literally is a sha256 hash, but just encoded in base64, no?
Owner

oh yeah i cant read

oh yeah i cant read
nex marked this conversation as resolved
@ -0,0 +384,4 @@
.await
// This can only panic if the authorizing user suffered a spontaneous existence
// failure during authentication, which should(?) be impossible(?)
.expect("failed to create device");
Owner

What if the rapture happens in the middle of authentication? this probably needs handling /j

What if the rapture happens in the middle of authentication? this probably needs handling /j
ginger marked this conversation as resolved
Jade approved these changes 2026-06-26 18:13:00 +00:00
Jade left a comment

OK I'm not seeing any major issues, this is probably pretty baked now

OK I'm not seeing any major issues, this is probably pretty baked now
Jade force-pushed ginger/oauth from e1a4dae224
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m1s
Checks / Prek / Check changed files (pull_request) Successful in 8s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m1s
Update flake hashes / update-flake-hashes (pull_request) Successful in 2m1s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m56s
to fdc1b75897
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m12s
Documentation / Build and Deploy Documentation (pull_request) Successful in 2m1s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m13s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m33s
2026-06-26 23:15:54 +00:00
Compare
nex approved these changes 2026-06-27 18:40:22 +00:00
nex left a comment

green star for good code

green star for good code
@ -437,0 +588,4 @@
// We already checked that the stage type is one that exists in the flow,
// so we can only get here if we ourselves served a flow with a stage that we
// don't understand.
panic!("tried to check an unsupported stage type: {unknown:?}");
Owner

nit: panic! -> unreachable!

nit: `panic!` -> `unreachable!`
Author
Owner

panic! is appropriate here because this branch can be reached in the event of a logic error. unreachable! is for cases where a branch can categorically never be reached even though rustc isn't smart enough to understand what's going on

`panic!` is appropriate here because this branch _can_ be reached in the event of a logic error. `unreachable!` is for cases where a branch can categorically never be reached even though rustc isn't smart enough to understand what's going on
Owner

I mean that is unreachable_unchecked, unreachable is just panic with a compiler hint.

I mean that is unreachable_unchecked, unreachable is just panic with a compiler hint.
@ -215,0 +412,4 @@
if let Err(e) = user_id.validate_strict() {
// Unless we are in emergency mode, we should follow synapse's behaviour
// on not allowing things like spaces and UTF-8 characters in
// usernames
Owner

We should perform relaxed validation at the very least otherwise people will create dastardly usernames and wonder why their federation is permanently busted later

We should perform relaxed validation at the very least otherwise people *will* create dastardly usernames and wonder why their federation is permanently busted later
Author
Owner

play stupid games win stupid prizes 👍 I'm not super concerned about this given that you can only do it if you turn emergency mode on (and, most likely, checked the source to discover that it's possible in the first place)

play stupid games win stupid prizes 👍 I'm not super concerned about this given that you can only do it if you turn emergency mode on (and, most likely, checked the source to discover that it's possible in the first place)
ginger force-pushed ginger/oauth from fdc1b75897
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m12s
Documentation / Build and Deploy Documentation (pull_request) Successful in 2m1s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m13s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m33s
to 52026bb0f1
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Documentation / Build and Deploy Documentation (pull_request) Successful in 59s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m2s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 10m21s
Checks / Prek / Check changed files (push) Successful in 5s
Checks / Prek / Pre-commit & Formatting (push) Successful in 1m5s
Documentation / Build and Deploy Documentation (push) Successful in 1m10s
Release Docker Image / Build linux-amd64 (release) (push) Failing after 2m53s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 8m29s
Release Docker Image / Build linux-arm64 (release) (push) Successful in 11m17s
Release Docker Image / Create Multi-arch Release Manifest (push) Has been skipped
Release Docker Image / Build linux-amd64 (max-perf) (push) Has been skipped
Release Docker Image / Build linux-arm64 (max-perf) (push) Has been skipped
Release Docker Image / Create Max-Perf Manifest (push) Has been skipped
Release Docker Image / Mirror Images (push) Has been skipped
Release Docker Image / Release Binaries (push) Has been skipped
2026-06-29 13:42:08 +00:00
Compare
ginger merged commit 52026bb0f1 into main 2026-06-29 13:53:50 +00:00
ginger deleted branch ginger/oauth 2026-06-29 13:53:51 +00:00
ginger added this to the 26.6.0 milestone 2026-07-04 15:59:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#1810 WIP: Admin API
continuwuation/continuwuity
Depends on
Reference
continuwuation/continuwuity!1719
No description provided.