-
Notifications
You must be signed in to change notification settings - Fork 937
chore: implement device auth flow for fake idp #11707
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b72cea9
to
da21464
Compare
coderd/coderdtest/oidctest/idp.go
Outdated
_, _ = fmt.Fprint(rw, url.Values{ | ||
"device_code": {deviceCode}, | ||
"user_code": {flow.userInput}, | ||
"verification_uri": {verifyURL}, | ||
"expires_in": {strconv.Itoa(int(lifetime.Seconds()))}, | ||
"interval": {"3"}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this use .Encode()
? Otherwise it could be printed as map[device_code:[] ...]
or whatever the string representation of url.Values
is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, good catch
This reverts commit f3ac7d0.
* implement test using fake idp device flow * improve error handling around device code failure
f88117e
to
9bc29db
Compare
Device Flow faking
Device flow: https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps
The fake IDP has been used to test all our oauth flows. I introduced a regression (fixed here #11706) because we were not checking the
Accept
header for the proper mime type. I could have just implemented that check, but I want to implement this for future testing.Will also implement better error handling to return a better error if this happens again.
Kooha-2024-01-19-11-33-33.mp4