Skip to content

Conversation

@probberechts
Copy link
Contributor

@probberechts probberechts commented Jan 9, 2026

Kloppy supports fetching data from URLs protected with HTTP Basic Auth. Previously, the documentation stated that this requires setting the following configuration:

from kloppy.config import set_config

set_config(
    'adapters.http.basic_authentication',
    { 'user': 'JohnDoe', 'pass': 'asecretkey' }
)

However, since the configuration variable is unpacked as aiohttp.BasicAuth(*basic_authentication), the correct way to set the configuration variable was to define it as a tuple:

set_config(
    'adapters.http.basic_authentication',
    ('JohnDoe', 'asecretkey',)
)

Moreover, the keys used are incorrect, as aiohttp.BasicAuth uses "login" and "password".

I've updated the code such that 'adapters.http.basic_authentication' now accepts both a dict and a tuple, fixed the documentation, and added tests for retrieving data from URLs protected with HTTP Basic Auth.


  • Support passing basic auth config to aiohttp.BasicAuth using keyword arguments
  • Fix documentation example to use correct auth config keys
  • Raise a clear KloppyError for malformed basic auth configuration
  • Add tests for authenticated, unauthenticated, and invalid auth cases

Fixes #78

- Pass basic auth config to aiohttp.BasicAuth using keyword arguments
- Fix documentation example to use correct auth config keys
- Raise a clear KloppyError for malformed basic auth configuration
- Add tests for authenticated, unauthenticated, and invalid auth cases
@probberechts probberechts added the bug Something isn't working label Jan 9, 2026
@probberechts probberechts changed the title [IO] Fix HTTP basic auth handling [IO] Support dict for HTTP Basic Auth config & fix docs Jan 12, 2026
@probberechts probberechts added documentation Improvements or additions to documentation enhancement New feature or request and removed bug Something isn't working labels Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guidance on API integration

1 participant