Skip to content

branch-4.1: [improvement](fe) add fe_meta_auth_token for FE meta-service internal HTTP auth - #66090

Open
CalvinKirs wants to merge 1 commit into
apache:branch-4.1from
CalvinKirs:branch-4.1-pick-65551
Open

branch-4.1: [improvement](fe) add fe_meta_auth_token for FE meta-service internal HTTP auth#66090
CalvinKirs wants to merge 1 commit into
apache:branch-4.1from
CalvinKirs:branch-4.1-pick-65551

Conversation

@CalvinKirs

@CalvinKirs CalvinKirs commented Jul 27, 2026

Copy link
Copy Markdown
Member

… HTTP auth (apache#65551)

The FE meta-service endpoints
(`image`/`role`/`check`/`put`/`journal_id`, etc.) authenticate callers
only by the `CLIENT_NODE_HOST`/`CLIENT_NODE_PORT` headers — i.e. whether
the claimed host:port is a registered FE. That is a plaintext claim with
no secret, so any host that knows a valid FE address can impersonate it.

Add an optional cluster token `fe_meta_auth_token`:

- **Empty (default)** — behavior is unchanged: node-host check only.
Existing clusters and rolling upgrades are unaffected.
- **Set** — `checkFromValidFe` additionally requires the request to
carry a matching token header, **on top of** the existing node-host
check (additive, does not replace the host check).

The token is a static `fe.conf` item, so a scaling-out FE already holds
it before the bootstrap handshake — no chicken-and-egg with the token
that `/check` itself hands out. It must be identical on all FEs.

Additional hardening of the meta-service:
- `/put` rejects a port other than the FE HTTP port.
- `/dump` always checks the admin password.
- meta-helper logs header **names** only, never the token value.

- `MetaServiceTest`: matching / missing / wrong token,
no-token-when-unconfigured, unknown-host-rejected-even-with-token,
`/put` port check, `/dump` auth.
- `HttpURLUtilTest`: token header emission (present/absent) and internal
URL building.

This supersedes apache#63782 (rebased onto latest master with a cleaner,
switch-free design).

(cherry picked from commit 163a10a)
@CalvinKirs
CalvinKirs requested a review from yiguolei as a code owner July 27, 2026 07:45
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@CalvinKirs CalvinKirs changed the title [improvement](fe) add fe_meta_auth_token for FE meta-service internal HTTP auth branch-4.1: [improvement](fe) add fe_meta_auth_token for FE meta-service internal HTTP auth Jul 27, 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.

2 participants