Skip to content

Allow API Keys to be passed through the Authorization header#775

Merged
rapidray12 merged 1 commit intodevelopfrom
AL-allow-authorization
Jan 28, 2025
Merged

Allow API Keys to be passed through the Authorization header#775
rapidray12 merged 1 commit intodevelopfrom
AL-allow-authorization

Conversation

@aloftus23
Copy link
Contributor

@aloftus23 aloftus23 commented Jan 28, 2025

🗣 Description

The auth function will now check if the token is an API key using regex. If so, will check the database for the hash.

💭 Motivation and context

Allow API keys to be passed in the same header as the JWT token. Inline with the old typescript backend

🧪 Testing

Passes pre-commits and pytests. Tested in postman as well.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release.

Copy link
Contributor

@DJensen94 DJensen94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@rapidray12 rapidray12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future we need to revise the use of regex

@rapidray12 rapidray12 merged commit 5de44fe into develop Jan 28, 2025
14 of 15 checks passed
@rapidray12 rapidray12 deleted the AL-allow-authorization branch January 28, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants