Skip to content

Conversation

nox-404
Copy link

@nox-404 nox-404 commented May 18, 2025

It is currently only possible to use Authorization: Bearer ${token} form of header authentication mechanism.

This PR allow to set a specific header in aliases such as Key: ${token}

@nox-404 nox-404 marked this pull request as draft May 18, 2025 13:15
@nox-404 nox-404 force-pushed the alias-auth-header branch from 0c25c88 to e379c2d Compare May 18, 2025 13:33
@nox-404 nox-404 marked this pull request as ready for review May 18, 2025 13:42
@nox-404
Copy link
Author

nox-404 commented May 18, 2025

I tested this by applying a git patch directly on my instance of opnsense (OPNsense 25.1.6_4-amd64)
I don't have a freebsd on hand to build this unfortunately

Copy link

@DominicTWHV DominicTWHV left a comment

Choose a reason for hiding this comment

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

Password validation logic looks good, consider adding $username validation as per RFC 7230 to prevent malformed requests (I have not validated the possibility of this, but its a good practice to do it)?

eg: /^[A-Za-z0-9-]+$/

@nox-404 nox-404 force-pushed the alias-auth-header branch 2 times, most recently from 0f984dc to 49000d0 Compare June 12, 2025 06:32
@nox-404
Copy link
Author

nox-404 commented Jun 12, 2025

I added a length and charset limit on the key ($username) too

@nox-404 nox-404 force-pushed the alias-auth-header branch from 49000d0 to 994ba2a Compare June 12, 2025 06:47
@nox-404 nox-404 force-pushed the alias-auth-header branch from 994ba2a to 3bc12ce Compare June 12, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants