Shared Authorization header parsing library
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- authentication, backend-api-design, testing
Research direction
Start with http/handler_auth/token/request.rs and http/handler_auth/userinfo/request.rs to compare the existing Authorization header parsing, then inspect the libs/ conventions for a shared Rust library. Add unit tests for the listed parsing edge cases and run bnv-manager-v2's OIDC tests. Done means both callers use the library and those OIDC tests pass unchanged.
Written by the indexing model from the issue text.
Description
Follow-up from the review of #92.
bnv-manager-v2 parses the Authorization header twice, with the same steps:
http/handler_auth/token/request.rs(ClientCredentials::from_request/from_basic): HTTP Basic forclient_secret_basichttp/handler_auth/userinfo/request.rs(bearer_token): Bearer for RFC 6750
Both reject a repeated header, split scheme and credentials at the first space and compare the scheme case-insensitively (RFC 7235 §2.1). Other services will likely need the same (Bearer for APIs, Basic for clients).
What to do
- A library in
libs/that parses anAuthorizationheader into its scheme and credentials, with typed helpers for:- Basic, including the RFC 6749 §2.3.1 form decoding of user and password
- Bearer, validating the RFC 6750 §2.1
b64token
- Errors distinguish missing, repeated, other scheme and malformed, so each caller can map them to its own error (
invalid_client,invalid_request, no error code). - bnv-manager-v2 switches both call sites to it.
Acceptance criteria
- One implementation of the header parsing, with unit tests for the edge cases (repeated header, case of the scheme, multiple spaces, padding, invalid base64, non-UTF-8).
- bnv-manager-v2's OIDC tests pass unchanged.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 4h 25m
- Merged PRs (30d)
- 90
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from myOmikron/code
-
wayfinder:task
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
wayfinder:task
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
myOmikron/code#102 · 2 comments ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
ready-for-agent
Difficulty 5/5 Over a week Newbie friendliness 18/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cline/cline#15327 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LogicLabs-OU/OpenArchiver#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bigcapitalhq/bigcapital#1545 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day