input-output-hk / mithril

Stake-based threshold multi-signatures protocol
https://mithril.network
Apache License 2.0
115 stars 36 forks source link

Custom headers in mithril client #1720

Open slowbackspace opened 1 month ago

slowbackspace commented 1 month ago

Hello! We are in the process of integrating the Mithril Aggregator API into the Blockfrost API. We would like our users to be able to use the official mithril-client with custom URL pointing to our proxy for Mithril API. However, to access Blockfrost endpoints, users need to authenticate by sending a header with their API key. For this, we need a way to add a custom header to requests sent by mithril-client. Additionally, this could be also useful to control caching or to set a custom user-agent to make monitoring a little bit easier.

Would it be possible to expose access to the headers sent by mithril-client, perhaps by allowing a headers object to be passed during client initialization? We’ll gladly submit a PR to implement this feature.

Thank you!