Skip to content

How to set header in OPAL_DATA_CONFIG_SOURCES & opal-server /data/config? #92

Answered by asafc
hongbo-miao asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @hongbo-miao, it’s very simple to pass the secret key (or any other header for that matter) in the configuration.

The shape of DataSourceEntry is the same both for:

  • OPAL_DATA_CONFIG_SOURCES (which dictates the initial data sources that should be fetched when opal-client starts or when the opal-client resumes connection after disconnect)
  • /data/config updates (realtime updates that can be sent whenever something changes).

in any case i will simply re-edit both you examples for simplicity:

Question 1

How can I set that token in this OPAL_DATA_CONFIG_SOURCES?

Answer:

OPAL_DATA_CONFIG_SOURCES='{"config":{"entries":[{"url":"https://example.com/api","config":{"headers":{"secret-key":"MY_SEC…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@hongbo-miao
Comment options

@asafc
Comment options

Answer selected by hongbo-miao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants