vector icon indicating copy to clipboard operation
vector copied to clipboard

enhancement(http-sink): Add automatic bearer token acquisition for http-sink

Open KowalczykBartek opened this issue 6 months ago • 1 comments

This PR intend to be a proof-of-concept for https://github.com/vectordotdev/vector/issues/20635. Because I have little knowledge about vector and not much more experience in Rust, I started with minimal working implementation to just verify concept (for example, where code responsible for token acquisition should be placed :)), if shape of this change will be more or less ok, I will take care for test, docs and code quality :)

example configuration I used to test this solution.

sources:
  my_source_id:
    scrape_interval_secs: 1
    type: http_client
    endpoint: http://127.0.0.1:9898/logs

sinks:
  my_sink_id:
    auth:
      strategy: "o_auth2"
      client_id: "some_client_id"
      client_secret: "client_secret"
      token_endpoint: "https://some.url/oauth/token"
    type: http
    encoding:
      codec: raw_message
    inputs:
      - my_source_id
    uri: http://127.0.0.1:9091/output

And, initial question to vector's owners is: does this PR makes sense from your point of view ?

thanks.

KowalczykBartek avatar Aug 05 '24 20:08 KowalczykBartek