Skip to content

e2e: Add OAuth2 device-flow tests - #247

Open
mike-scott wants to merge 1 commit into
mainfrom
oauth2-flow-e2e-testing
Open

e2e: Add OAuth2 device-flow tests#247
mike-scott wants to merge 1 commit into
mainfrom
oauth2-flow-e2e-testing

Conversation

@mike-scott

Copy link
Copy Markdown
Contributor

The shared fixtures run the server in noauth mode, which fabricates a full-scope session on every request and cannot exercise the login redirect, a real user confirming the code, or scope intersection.

Stand up a dedicated fioserver with auth-init --local on test ports and drive the flow with Playwright: fiocli login through the authorize, deny, and scope-mismatch paths, plus a fio-device-register mimic that requests the fio-dr 3-part scope format, types the code into the bare verification page, and registers a device by POSTing a CSR with the minted token base64-encoded.

The tests run against the server's default per-IP rate limits; so rate-limited steps are paced to human speed.

Comment thread contrib/e2e/test_oauth2_login.py Outdated
There is no existing test run for oauth2 and the following use-cases:
- A device registering
- A fiocli user logging in

The shared fixtures run the server in noauth mode, which fabricates a
full-scope session on every request and cannot exercise the login
redirect, a real user confirming the code, or scope intersection.

Instead, stand up a dedicated fioserver with auth-init --local on
test ports and drive the flow with Playwright: `fiocli login` through
the authorize, deny, and scope-mismatch paths, plus a
fio-device-register mimic which registers a device by POSTing a CSR
with the minted token base64-encoded.

NOTE: The tests run against the server's default per-IP rate limits,
so the steps are paced to human speed.

Signed-off-by: Michael Scott <mike@foundries.io>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mike-scott
mike-scott force-pushed the oauth2-flow-e2e-testing branch from a0e486c to d20355b Compare August 29, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants