Skip to content

RFC compliant auth header #785

@agmes4

Description

@agmes4

Issue

we currently implement our own way to integrate the auth part into the authentication header by just putting authentication: apikey KEY. This is not compliant to any auth methods.

Solution

we should implement RFC 7617 in order to keep the key value pair but introduce also an identification for the API. Something like Flask HTTP Auth can be used.

def parse_authorization_header(value: str | None) -> str | None:
if not value:
return None
try:
auth_type, api_key = value.split(maxsplit=1)
return api_key if auth_type.lower() == 'apikey' else None
except ValueError:
return None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions