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

Device grant flow (migrate to master) #701

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
ce02ff3
Device grant flow (migrate to master)
BuzzBumbleBee Sep 4, 2022
9976360
Add own flow to the Device Grant
supercairos Sep 7, 2022
ae0144c
Generate Mocks & MemoryStore
supercairos Sep 7, 2022
60e109b
Fix HMACSHA Test
supercairos Sep 7, 2022
7b5a9ba
Fix fosite tests
supercairos Sep 7, 2022
b3e10dd
Merge pull request #3 from BuzzBumbleBee/rcaire/retry-pr
BuzzBumbleBee Sep 7, 2022
e216bb5
Merge remote-tracking branch 'github/master' into feat_dev_grants_2x
supercairos Sep 8, 2022
0ff2699
Fix styling
supercairos Sep 8, 2022
3665fc6
Fix merge errors
supercairos Sep 8, 2022
d710a40
Remove debug logs
supercairos Sep 9, 2022
eefdf61
Fix test following fix merge error
supercairos Sep 9, 2022
57fb5ba
Remove "device_code" auth flow
supercairos Sep 9, 2022
74ef995
Rename to follow Ory's file naming pattern
supercairos Sep 9, 2022
873f022
Add some tests & documentations
supercairos Sep 12, 2022
17b8665
Remove unused files & add some more tests
supercairos Sep 12, 2022
375d89e
Use same method do generate authorization code & device code
supercairos Sep 12, 2022
dbd7860
Fix comment formating
supercairos Sep 12, 2022
8585c75
Add test to device pkce
supercairos Sep 12, 2022
4f7eb2b
rcaire/create-device-code-at-start
supercairos Sep 13, 2022
eea03e0
Split & Move files
supercairos Sep 14, 2022
341d411
fix: edit comments
supercairos Sep 14, 2022
0f0668b
Merge branch 'master' into feat_dev_grants_2x
supercairos Sep 15, 2022
a9aaaba
Merge branch 'feat_dev_grants_2x' into device-code-rework
supercairos Sep 15, 2022
fef42ec
Add missing handler in composer
supercairos Sep 16, 2022
b085d07
Merge branch 'master' into feat_dev_grants_2x
supercairos Sep 29, 2022
3106872
Merge branch 'feat_dev_grants_2x' into device-code-rework
supercairos Sep 29, 2022
9a30db2
Retry CI
supercairos Sep 29, 2022
7bbeb02
Don't use `url.Values.Has()` as it doesn't exist in Golang 1.16...
supercairos Sep 29, 2022
289f9a2
Merge branch 'feat_dev_grants_2x' into device-code-rework
supercairos Sep 29, 2022
142b7ff
Change from Forbiden to BadRequest for authorization_pending to bette…
supercairos Oct 5, 2022
6f66f32
Merge branch 'master' into feat_dev_grants_2x
supercairos Oct 20, 2022
5722afa
Update go/x/text module to 0.4.0
supercairos Oct 20, 2022
a243b93
Merge branch 'master' into feat_dev_grants_2x
supercairos Nov 18, 2022
46cdb1e
Merge branch 'master' into feat_dev_grants_2x
supercairos Dec 12, 2022
3483d6e
Update following merge
supercairos Dec 12, 2022
86c4f95
Initial refactoring following @hackerman recommandations
supercairos Dec 13, 2022
e23a26a
Update following integration test with Hydra
supercairos Dec 14, 2022
a99ed89
Fix build error
supercairos Dec 14, 2022
88abd8d
Fix test
supercairos Dec 14, 2022
1b29706
Merge branch 'master' into feat_dev_grants_2x
supercairos Jan 9, 2023
3313b71
Use HTTP redirect instead of raw http header redirection
supercairos Jan 9, 2023
e99e2bc
Refactor the DeviceResponse struct to only have one definition of it.
supercairos Jan 9, 2023
9279963
Use RandX instead of custom code to generate the Random UserCode
supercairos Jan 9, 2023
e60949d
Remove padding from HMAC generation to avoid confusion in URLs
supercairos Jan 9, 2023
ad37f5d
Use GrantType const string instead of raw string
supercairos Jan 9, 2023
ea146be
Split DeviceAuthorizeHandler and CodeAuthorizeHandler
supercairos Jan 19, 2023
9fcb161
Merge branch 'master' into feat_dev_grants_2x
supercairos Feb 1, 2023
1b306bb
Update Copyright header
supercairos Feb 1, 2023
98709f3
Merge branch 'master' into feat_dev_grants_2x
supercairos Mar 14, 2023
709a443
Merge branch 'master' into feat_dev_grants_2x
supercairos Mar 20, 2023
8a2cf5c
Update fosite refactoring
supercairos Apr 18, 2023
0395b8e
Merge branch 'master' into feat_dev_grants_2x
supercairos Jul 18, 2023
d2316f4
Fix some typo in config storage
supercairos Oct 10, 2023
0e6f5fa
Merge branch 'master' into feat_dev_grants_2x
supercairos Oct 10, 2023
b1fbd36
Merge branch 'master' into feat_dev_grants_2x
supercairos Nov 24, 2023
0847036
As per spec, set polling to 5s (from 10s)
supercairos Nov 27, 2023
5b41e88
Fix typo in comment
supercairos Nov 27, 2023
5f9b0b1
Add tracer as per AuthorizeRequest
supercairos Nov 27, 2023
bc70138
Fix comment in typo
supercairos Nov 27, 2023
c4b608a
use randx runes defined in ory/x
supercairos Nov 29, 2023
6cded09
Remove PKCE
supercairos Nov 30, 2023
7ad3851
Rename DeviceAuthorizeXXX to DeviceUserXXX
supercairos Dec 5, 2023
10419a9
Refactor the way we query the URL Query params
supercairos Dec 5, 2023
5bc8783
Don't send stacktrace when err is AuthorizationPending
supercairos Dec 7, 2023
e8b1654
Add RateLimit to Device Polling endpoint
supercairos Jan 4, 2024
193f7d7
Bump ory/x version to latest
supercairos Jan 4, 2024
eee739a
Merge branch 'master' into feat_dev_grants_2x
supercairos Jan 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tracer as per AuthorizeRequest
  • Loading branch information
supercairos committed Nov 27, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 5f9b0b1d591f92e0fa0303dce5646067f77a170e
11 changes: 10 additions & 1 deletion device_authorize_request_handler.go
Original file line number Diff line number Diff line change
@@ -9,9 +9,18 @@ import (

"github.com/ory/fosite/i18n"
"github.com/ory/x/errorsx"
"github.com/ory/x/otelx"
"go.opentelemetry.io/otel/trace"
)

func (f *Fosite) NewDeviceAuthorizeRequest(ctx context.Context, r *http.Request) (DeviceAuthorizeRequester, error) {
func (f *Fosite) NewDeviceAuthorizeRequest(ctx context.Context, r *http.Request) (_ DeviceAuthorizeRequester, err error) {
ctx, span := trace.SpanFromContext(ctx).TracerProvider().Tracer("github.com/ory/fosite").Start(ctx, "Fosite.NewDeviceAuthorizeRequest")
defer otelx.End(span, &err)

return f.newDeviceAuthorizeRequest(ctx, r)
}

func (f *Fosite) newDeviceAuthorizeRequest(ctx context.Context, r *http.Request) (DeviceAuthorizeRequester, error) {
request := NewDeviceAuthorizeRequest()
request.Lang = i18n.GetLangFromRequest(f.Config.GetMessageCatalog(ctx), r)

Loading