Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework auth/api_token parameters #201

Merged
merged 12 commits into from
Aug 26, 2024
Merged

Rework auth/api_token parameters #201

merged 12 commits into from
Aug 26, 2024

Commits on Aug 24, 2024

  1. Configuration menu
    Copy the full SHA
    40e2ebc View commit details
    Browse the repository at this point in the history
  2. Unify __str__ Methods for APIs

    This way, they use the class names and base URLs, instead of being specified
    for each class.
    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    02b847a View commit details
    Browse the repository at this point in the history
  3. Add pytest-asyncio

    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    0c6df8a View commit details
    Browse the repository at this point in the history
  4. Add Failing Test: API_TOKEN is Exposed in GET

    This test verifies that parameter ?key is not used.
    Otherwise, it will occur in error messages, which might lead to an unwanted
    disclosure of the key, e.g., when sharing log messages.
    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    068c432 View commit details
    Browse the repository at this point in the history
  5. Add Custom Auth Implementations

    - Add custom httpx.Auth implementation for Dataverse API Tokens
    - Add custom httpx.Auth implementation for Dataverse Bearer Token
    - Add auth to docs
    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    89149bc View commit details
    Browse the repository at this point in the history
  6. Prefer httpx.Auth Instead of api_token

    It is still possible to use the api_token parameter.
    In this case assume an API token was copied from the
    user profile of a Dataverse instance.
    
    If both are specified, an api_token and an explicit auth method,
    warn the user and use the auth method.
    
    Closes gdcc#192.
    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    d3a1fd9 View commit details
    Browse the repository at this point in the history
  7. Deprecate auth Parameter of Individual Functions

    Instead, if required, use multiple instances of each API implementation.
    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    a49e644 View commit details
    Browse the repository at this point in the history
  8. Fix mypy Issues in api and conf.py

    Also add types-jsonschema as a lint dependency.
    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    31e047b View commit details
    Browse the repository at this point in the history
  9. Add BasicAuth for SwordAPI

    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    c351faa View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5601c4a View commit details
    Browse the repository at this point in the history
  11. Add SWORD tests and make them pass

    The SWORD API returns an empty string for 401 Unauthorized.
    This would cause the usual response handling of extracting the error
    message from the JSON to raise, so we except that in that case.
    
    Resolves review comment on gdcc#201.
    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    c3b7a67 View commit details
    Browse the repository at this point in the history
  12. Pass Correct Parameters to HTTP requests.

    This change was necessary due to rebasing the feature branch onto the json-data fixes in gdcc#203.
    
    Relates to gdcc#201.
    shoeffner committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    6ccc193 View commit details
    Browse the repository at this point in the history