• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

oauthlib / oauthlib / 12219896682
94%

Build:
DEFAULT BRANCH: master
Ran 08 Dec 2024 07:29AM UTC
Jobs 1
Files 75
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Dec 2024 07:28AM UTC coverage: 92.957% (-0.3%) from 93.216%
12219896682

push

github

web-flow
Add DeviceCodeGrant type for device code flow(rfc8628) section 3.4 & 3.5  (#889)

* Add device grant specific errors

These are from section 3.5 of the rfc
https://datatracker.ietf.org/doc/html/rfc8628#section-3.5

* Add device code grant handler

In the device flow, the device must poll the token endpoint to check if the user
has submitted the user_code. This commit adds that handler to validate the request
and return the token.

* Allow interval to be controlled by caller

Any caller of DeviceApplicationServer() needs control of the inerval polling time.
This is part of the flow where the device polls the auth server to check in the user
has submitted the user_code

* Use absolute imports

Easier to read, easier to derive where the module lives.

* Add device grant to oauth2 based server

This grant type handler exists in both the openid conenct server and the oauth 2.0 server.
Why? It sets up for a potentitial open id over device flow implementation.

It also alo ensures the access_token and refresh_token still get returned whether openid is enabled or not.
device flow isn't a spec that's part of open id but some IDps like microsoft, auth0, okta implement
an off-spec version.

However, that's not the concern of the pr this commit is apart of but if returning an id_token(openid) is
needed down the line that will have to be a seperate issue rasied.

* Add interval default to align with rfc

* Add device code grant tests

* Add device code grant docs

* Apply ruff format using line-length 99

The 255 is too high, leads to lines that are too long.
I'll get a pr to format the entire repo after this one

* Add device code grant to support grant claiims

* Add pseudocode example of how to implement the device flow

* Update tests/oauth2/rfc8628/grant_types/test_device_code.py

---------

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>

966 of 1073 branches covered (90.03%)

Branch coverage included in aggregate %.

87 of 100 new or added lines in 8 files covered. (87.0%)

3086 of 3286 relevant lines covered (93.91%)

5.61 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
13
74.63
oauthlib/oauth2/rfc8628/grant_types/device_code.py
Jobs
ID Job ID Ran Files Coverage
1 12219896682.1 08 Dec 2024 07:29AM UTC 75
92.96
GitHub Action Run
Source Files on build 12219896682
  • Tree
  • List 75
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 028c563e on github
  • Prev Build on master (#11437696741)
  • Next Build on master (#13006856309)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc