Repository navigation
feat(http): OAuth2 password grant for sl.http - #193
Merged
Merged
Conversation
sl.oauth2_password(token_url, scope=, client_auth=) posts grant_type=password with the connection's username and password, plus client_id and client_secret when the connection has them. Renewal works like the other OAuth2 kinds: before expiry and once after a 401, using the refresh token the server handed out when there is one, and the password grant again when there isn't or the server refuses it. The password is redacted like the other secrets, and wrong credentials fail with exit 1, not retryable.
…fresh that fails once
…in an echoed password
Deploying sqlload with
|
| Latest commit: |
2718e07
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://da7201c1.sqlload.pages.dev |
| Branch Preview URL: | https://feat-http-password-grant.sqlload.pages.dev |
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.
sl.httpjobs can now use the OAuth2 resource-owner password grant.sl.oauth2_password(token_url, *, scope=None, client_auth="basic")postsgrant_type=passwordwith the connection'susernameandpassword. It sendsclient_idandclient_secrettoo when the connection has them, as basic auth or as form fields, the same as the existing OAuth2 kinds.refresh_token, later renewals use it. When it doesn't, or the server refuses it, the password grant runs again. A transient failure (5xx/429) while refreshing is retried, and the password is not resent; if it persists, the run exits 75.retryable: falsein--json.usernameandpassword.Docs:
sources/python.mdx(auth table and OAuth2 section) andconfiguration.mdx, marked as coming in 0.36.0.Tests: new cases in
packages/sqlload/tests/test_http_jobs.pyagainst a stub token server:--json, with the echoed password redacted.All 65 http job tests pass, and
make checkis clean. Mutation checks: removing the fallback, or the JSON re-serialisation, fails the matching test.