Chris Taylor ccmtaylor · he/him
  • Berlin, Germany
  • Joined on 2025年05月14日
ccmtaylor pushed to forgejo at ccmtaylor/forgejo 2025年12月11日 12:04:44 +01:00
ebc36a9ec7 fix(10359): Count releases correctly when using filters (q) (#10387)
505ab87ae0 fix: allow for merge message template with empty message (#9930)
7794da7e81 fix: correct token summary in swagger to specify the used user. (#10367)
0ef51b24ab fix: 'More actions' (⋯) dropdown from moderation reports overview page (#10339)
48c7bda95d fix: rename a file with typo STMP -> SMTP (#10389)
Compare 94 commits »
ccmtaylor pushed to oauth-device-flow at ccmtaylor/forgejo 2025年12月11日 11:30:55 +01:00
cfa7ef632f
advertise device auth support in discovery metadata
00a987bb49
user code verification
5fb2f6ae20
issue device access token
33d44443af
oauth2 device authorization endpoint
Compare 4 commits »
ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月11日 11:21:59 +01:00
WIP: support OAuth2 device authorization for headless clients

will do 👍. I saw the notice about the json file but decided to add the translations to the "old" location because I reuse some of the existing oauth translations in the new templates.

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月11日 10:58:49 +01:00
WIP: support OAuth2 device authorization for headless clients

thanks! I saw require.NoError but missed that it returns a bool allowing to abort the test on error

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月11日 10:57:07 +01:00
WIP: support OAuth2 device authorization for headless clients

ooh, nice! I'll remember that for other projects :)

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月11日 10:44:32 +01:00
WIP: support OAuth2 device authorization for headless clients

thanks, good catch! I misremembered the blog posts around the math/rand/v2 release saying that v2 was ok to use for this. In fact, they just say it's "not catastrophic anymore" 🤦.

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月10日 23:50:38 +01:00
WIP: support OAuth2 device authorization for headless clients

DeviceCode and UserCode are temporary credentials that the device_authorization endpoint issues to the oauth client application. The application then prompts the user to visit the verificatio...

ccmtaylor commented on issue forgejo/forgejo#4830 2025年12月10日 21:16:07 +01:00
feat: OAuth Device Authorization Grant

I also noticed there's a similar PR for gitea here: https://github.com/go-gitea/gitea/pull/35379. Since gitea is MIT licensed, we could also adopt that. Some differences from my approach:

ccmtaylor pushed to oauth-device-flow at ccmtaylor/forgejo 2025年12月10日 13:16:51 +01:00
d0a29a7851
advertise device auth support in discovery metadata
ccmtaylor pushed to oauth-device-flow at ccmtaylor/forgejo 2025年12月09日 18:35:05 +01:00
dbc8b1303b
user code verification
ccmtaylor pushed to oauth-device-flow at ccmtaylor/forgejo 2025年12月09日 17:38:16 +01:00
7d7844e129
user code verification
7a32c62895
issue device access token
532cabf065
oauth2 device authorization endpoint
Compare 3 commits »
ccmtaylor pushed to oauth-device-flow at ccmtaylor/forgejo 2025年12月09日 16:55:43 +01:00
cf2e499560
user code verification
ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月09日 11:21:47 +01:00
WIP: support OAuth2 device authorization for headless clients

if a client requests a device authorization but stops polling for it (i.e. because the user hit ctrl-c), we never clean up expired authorizations. Does Forgejo have some kind of cron/job-scheduling...

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月09日 11:13:47 +01:00
WIP: support OAuth2 device authorization for headless clients

Should DeviceCode and/or UserCode be hashed in the DB?

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月09日 11:06:58 +01:00
WIP: support OAuth2 device authorization for headless clients

I'm a bit shaky on web security: does the authorization flow need some kind of additional CSRF protection?

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月09日 11:06:56 +01:00
WIP: support OAuth2 device authorization for headless clients

maybe only display this if the user arrived here via direct link? I imagine the wording would be something along the lines of "ensure the code {{.UserCode}} matches the one displayed on your...

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月09日 11:06:55 +01:00
WIP: support OAuth2 device authorization for headless clients

nit: type="hidden"

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月09日 11:06:52 +01:00
WIP: support OAuth2 device authorization for headless clients

again, do we need to validate Scope somehow? What are valid scopes?

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月09日 11:06:50 +01:00
WIP: support OAuth2 device authorization for headless clients

the spec recommends ensuring that clients actually respect the authorization.Interval, and reserves an error code for it. Should an a last-seen timestamp and check+update it on every request?

ccmtaylor commented on pull request forgejo/forgejo#10373 2025年12月09日 11:06:49 +01:00
WIP: support OAuth2 device authorization for headless clients

comment can go away: rate limiting is on the token endpoint, not this one. Though maybe rate-limiting this by clientID could make sense? Not sure if there's support in Forgejo 🤔