Add authentication support to execute_sparql_query - #1030
Merged
Merged
Conversation
Allow querying a SPARQL endpoint behind authentication: - new `auth` parameter (a (username, password) tuple for HTTP Basic auth or any requests.auth.AuthBase), defaulting to config['SPARQL_AUTH'] so the fast run mode can use it without code changes - new `headers` parameter to send extra HTTP headers (e.g. a Bearer token) wbi_backoff no longer logs the `auth`, `headers` and `login` keyword arguments in clear on retries, and gives up immediately on HTTP 401/403 instead of retrying with the same credentials. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CodeQL flagged `'https://example.org' in caplog.text` as an incomplete URL substring sanitization. Use a non-URL keyword argument instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
LeMyst
added a commit
that referenced
this pull request
Sep 19, 2026
The SPARQL query is sent in the POST body (data=), not as URL parameters, so name the dict accordingly. The functional fix (data= instead of params=, no bogus multipart Content-Type) already landed in master via #1030. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
LeMyst
added a commit
that referenced
this pull request
Sep 19, 2026
The SPARQL query is sent in the POST body (data=), not as URL parameters, so name the dict accordingly. The functional fix (data= instead of params=, no bogus multipart Content-Type) already landed in master via #1030. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
Allow
wbi_helpers.execute_sparql_query()to query a SPARQL endpoint that sits behind authentication.authparameter: a(username, password)tuple for HTTP Basic auth, or anyrequests.auth.AuthBaseinstance.headersparameter: extra HTTP headers merged over the defaults (e.g.{'Authorization': 'Bearer <token>'}).wbi_config['SPARQL_AUTH']key (defaultNone), used whenauthis not passed. The fast run mode picks it up without any change.Related changes in
wbi_backoffauth,headersandloginkwargs are now masked as***.@wbi_backoff()decorated function.Test plan
🤖 Generated with Claude Code