Closed Viincenttt closed 3 weeks ago
Allow library consumers to configure a custom implementation to retrieve the API key. This can be usefull in case they are running a multi-tenant setup with multiple API keys.
Usage: When registering dependencies:
builder.Services.AddMollieApi(options => { //options.ApiKey = builder.Configuration["MySecretManagerMollie:ApiKey"]!; options.SetCustomMollieSecretManager<TenantSecretManager>(); options.RetryPolicy = MollieHttpRetryPolicies.TransientHttpErrorRetryPolicy(); });
Custom secret manager for multi-tenant setup:
public class TenantSecretManager : IMollieSecretManager { private readonly ITenantService _tenantService; public string GetBearerToken() => _tenantService.GetCurrentTenant().ApiKey; }
Allow library consumers to configure a custom implementation to retrieve the API key. This can be usefull in case they are running a multi-tenant setup with multiple API keys.
Usage: When registering dependencies:
Custom secret manager for multi-tenant setup: