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

fix: refactor api_new_meeting_registration. Fixes #7608 #7724

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rpcross
Copy link
Collaborator

@rpcross rpcross commented Jul 21, 2024

  • change to use JSON payload
  • handle multiple records in one request

@rpcross
Copy link
Collaborator Author

rpcross commented Jul 25, 2024

I am working on tests for this. Using a JSON payload means the existing require_api_key decorator won't work. Assuming JSON payload is the way to go, are there other precedents for checking API key? Function can do it's own validation, or can update decorator.

@rpcross rpcross requested a review from rjsparks July 25, 2024 19:00
@jennifer-richards
Copy link
Member

are there other precedents for checking API key?

def requires_api_token(func_or_endpoint: Optional[Union[Callable, str]] = None):
"""Validate API token before executing the wrapped method
Usage:
* Basic: endpoint defaults to the qualified name of the wrapped method. E.g., in ietf.api.views,
@requires_api_token
def my_view(request):
...
will require a token for "ietf.api.views.my_view"
* Custom endpoint: specify the endpoint explicitly
@requires_api_token("ietf.api.views.some_other_thing")
def my_view(request):
...
will require a token for "ietf.api.views.some_other_thing"
"""
is what we've started using for datatracker. This uses the X-Api-Key header to store a shared secret and keeps the auth concerns out of the API itself.

@rjsparks
Copy link
Member

rjsparks commented Sep 4, 2024

@rpcross This may have fallen into the cracks because of 120?

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.

3 participants