refactor(server): split the device flow into focused per-flow files#4892
Merged
Conversation
deviceflowhandlers.go mixed the device-authorization page/request, the browser callback, and the device_code grant in one file — outside the grant_*.go family and without the per-flow header comments the rest of the package now has. Split it into device_authorize.go (the /device page, /device/code request, and user-code verification, which share the device template), device_callback.go (the /device/callback token-minting callback), and grant_devicecode.go (the device_code grant, a token.go dispatch target alongside the other grants). Tests are split to match. Pure code movement; the same 176 tests pass. Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
1382026 to
17f28c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Bring the device flow into the same per-flow file layout as the rest of the package (follow-up to #4891).
What this PR does / why we need it
deviceflowhandlers.gomixed the device-authorization page/request, the browser callback, and the device_code grant in one file — outside thegrant_*.gofamily and without the per-flow header comments the rest of the package now has. It is split intodevice_authorize.go(the/devicepage,/device/coderequest, and user-code verification, which share the device template),device_callback.go(the/device/callbacktoken-minting callback), andgrant_devicecode.go(the device_code grant, atoken.godispatch target alongside the other grants). Tests are split to match.Special notes for your reviewer
Pure code movement, no behaviour change: every declaration is byte-identical to the old file (only header comments were added) and the same 176 tests pass.