fix: http_server source auth — correct field names and strategies per Vector docs#79
Merged
TerrifiedBug merged 1 commit intomainfrom Mar 9, 2026
Merged
Conversation
…ustom per Vector docs
Vector's http_server source uses server-mode auth (validate incoming requests) which
differs from client-mode auth used by sinks:
- Field is `username` not `user`
- Strategies are `basic` and `custom` (VRL) — no bearer support
- Auth is optional (omit block for no auth)
Also strip empty nested objects during YAML/TOML generation so omitting auth
doesn't serialize as `auth: {}`.
Contributor
Greptile SummaryThis PR fixes a correctness bug in VectorFlow's
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[http_server source node config] --> B{auth object present?}
B -- "all values null / empty string" --> C["Strip auth key\n(new empty-object stripping logic)"]
B -- "strategy = basic" --> D["Keep auth\nauth.username + auth.password"]
B -- "strategy = custom" --> E["Keep auth\nauth.source VRL expression"]
C --> F[Generate YAML / TOML\nno auth block emitted]
D --> F
E --> F
F --> G[Vector config delivered to agent]
style C fill:#f9f,stroke:#333
style D fill:#9f9,stroke:#333
style E fill:#9f9,stroke:#333
Last reviewed commit: 34b0120 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
http_serversource used the sharedauthBasicBearerSchemawhich definesuser/tokenfields withbasic/bearerstrategies. But Vector'shttp_serversource is server-mode auth (validates incoming requests) and expects different fields:username(notuser)passwordfor basic authsource(VRL expression) for custom authbasicandcustomonly — no bearer supportauthHttpServerSchema()with correct field names and strategiesauth: {}Test plan
auth:block in YAMLauth.usernameandauth.passwordauth.source(VRL expression)