Skip to content

Document server token and tokenHeaders settings - #1853

Open
cstamas wants to merge 2 commits into
masterfrom
settings-server-token
Open

cstamas wants to merge 2 commits into
masterfrom
settings-server-token

Conversation

@cstamas

@cstamas cstamas commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Documents the server token and tokenHeaders settings added by apache/maven#14173 (3.10.x) and apache/maven#14179 (4.0.x), settings model 1.4.0.

  • settings.md: new "Server Tokens" section. It covers:
    • the bearer token (Authorization: Bearer <token>);
    • the tokenHeaders list (name and value), for example GitLab Private-Token / Job-Token / Deploy-Token, or Cloudflare Access CF-Access-Client-Id plus CF-Access-Client-Secret;
    • the warnings and errors Maven reports: missing name or value, duplicate header, and header names the HTTP transports reject or drop, such as Host, Proxy-* and Sec-*;
    • that the tokens are sent only to the repository origin, that Wagon ignores them, and why they beat httpHeaders.
  • guide-encryption.md: <token> and token header values can be encrypted like a password.
  • guide-deployment-security-settings.md: link to Server Tokens.
  • guide-http-settings.md: don't put auth tokens in httpHeaders; use token or tokenHeaders.

Notes:

  • The version says Maven 3.10.3, the next release of maven-3.10.x (now at 3.10.3-SNAPSHOT), and 4.0.0. Settings model 1.3.0 already shipped in 3.10.0. Merge this only after [maven-3.10.x] Support token authentication (bearer and custom token headers) for settings servers maven#14173 is merged, and fix the version if it lands in a later release.
  • The single <tokenHeader> of the first version of this PR is gone; it followed the Maven PRs to the <tokenHeaders> list.
  • xsd/settings-1.4.0.xsd is not added here. The new example links to it, and it must be published with the release.

Align the docs with apache/maven#14173: settings model 1.4.0 adds token and
tokenHeader on <server> (Maven 3.10.3 and 4.0.0).
</settings>
```

Since Maven 3.10.3 and 4.0.0, a repository that expects a token, such as a bearer token or a GitLab

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

note: 4.0.0 ONLY if it waits for new resolver, otherwise it will be 4.0.1 or so

Follows apache/maven#14173 and #14179: <token> is a bearer token only,
and any number of other token headers go in
<tokenHeaders><tokenHeader><name/><value/></tokenHeader></tokenHeaders>
(GitLab Private-Token, Cloudflare Access client id and secret, ...).
Token header values can be encrypted like a password, and the documented
errors now include Proxy-* and Sec-* names and duplicate headers.
@cstamas cstamas changed the title Document server token and tokenHeader settings Document server token and tokenHeaders settings Nov 30, 2026
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.

1 participant