Skip to content

auth: pass AuthRequest to Authenticator::check_request and channel-binding newtype - #87

Open
mvo5 wants to merge 2 commits into
systemd:mainfrom
mvo5:auth-request
Open

auth: pass AuthRequest to Authenticator::check_request and channel-binding newtype#87
mvo5 wants to merge 2 commits into
systemd:mainfrom
mvo5:auth-request

Conversation

@mvo5

@mvo5 mvo5 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

auth: pass AuthRequest to Authenticator::check_request

This commit replaces positional check_request() parameters with a
single struct carrying the raw headers. Auth methods now extract what
they need themselves so adding a new auth method no longer changes the
trait for the existing ones.

This will be useful for jwt-auth and api-keys-auth.


The RFC 9266 channel binding so far was just a string. This is not ideal as its not self-documenting and also not type safe (it should be impossible to pass it into the wrong place, this is not python afterall).

So this commit uses the newtype pattern to simply make it a proper type to ensure the issues above are fixed.

mvo5 added 2 commits July 31, 2026 21:01
The RFC 9266 channel binding so far was just a string. This is
not ideal as its not self-documenting and also not type safe
(it should be impossible to pass it into the wrong place, this
is not python afterall).

So this commit uses the newtype pattern to simply make it a
proper type to ensure the issues above are fixed.
This commit replaces positional check_request() parameters with a
single struct carrying the raw headers. Auth methods now extract what
they need themselves so adding a new auth method no longer changes the
trait for the existing ones.

This will be useful for jwt-auth and api-keys-auth.
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.

2 participants