Skip to content

fix(api): trim token from environment before hashing - #53

Merged
primoco merged 1 commit into
eullm:mainfrom
Gabriele06-local:fix/api-token-env-trim
Oct 11, 2026
Merged

primoco merged 1 commit into
eullm:mainfrom
Gabriele06-local:fix/api-token-env-trim

Conversation

@Gabriele06-local

Copy link
Copy Markdown
Contributor

ApiToken::resolve hashed the raw env value while the request side trims the Bearer token, so a trailing newline (files, shells) made a valid token always 401. Now the env value is trimmed before the length check and hashing, matching request behavior. New unit test proven to fail before. Verified: fmt, clippy lib+bins exit 0, lib 29/29 plus api/agent/providers suites green. Note: cargo clippy --all-targets currently fails on Windows for a pre-existing dead_code in tests/security.rs (unix-gated callers), untouched here; Linux CI unaffected. I have read and agree to the Contributor Licence Agreement in CLA.md.

@primoco
primoco merged commit c23e618 into eullm:main Oct 11, 2026
3 checks passed
@primoco

primoco commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Merged thk's

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