OVH Provider
Overview
The OVH provider integrates with OVH Keys Management Service (OKMS), a secure secret storage solution hosted in OVH's European data centers. It communicates via OVH's REST API using HttpClient -- no SDK dependency required.
Key Benefits:
- GDPR-compliant European data residency
- Secure OAuth-based authentication
- Fully managed encryption
- Integration with OVH's cloud infrastructure
Installation
Terminal
dotnet add package SecretsManager
dotnet add package SecretsManager.OVH
Configuration
Options Reference
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
Endpoint | string | Yes | "" | OVH endpoint region: ovh-eu, ovh-us or ovh-ca |
ApplicationKey | string | Yes | "" | OVH application key |
ApplicationSecret | string | Yes | "" | OVH application secret |
ConsumerKey | string | Yes | "" | OVH consumer key |
OkmsId | string | No | "" | OVH OKMS ID |
OVHOptions.Validate() requires Endpoint, ApplicationKey, ApplicationSecret and ConsumerKey.
Fluent API
Program.cs
var provider = new SecretProviderBuilder()
.WithOVH(options =>
{
options.Endpoint = "ovh-eu";
options.ApplicationKey = "your-application-key";
options.ApplicationSecret = "your-application-secret";
options.ConsumerKey = "your-consumer-key";
options.OkmsId = "your-okms-id";
})
.Build();
Environment Variables
Terminal
export SECRETS_PROVIDER=ovh
export SECRETS_OVH_ENDPOINT=ovh-eu
export SECRETS_OVH_APPLICATIONKEY=your-application-key
export SECRETS_OVH_APPLICATIONSECRET=your-application-secret
export SECRETS_OVH_CONSUMERKEY=your-consumer-key
export SECRETS_OVH_OKMSID=your-okms-id
YAML Configuration
secretstore.yaml
provider:
ovh:
endpoint: ovh-eu
application:
key: your-application-key
application:
secret: your-application-secret
consumer:
key: your-consumer-key
okms:
id: your-okms-id
Dependency Injection (IOptions<T>)
Bind the same settings from appsettings.json through the DI container:
var provider = new SecretProviderBuilder()
.ConfigureOVH(configuration)
.Build();
{
"SecretsManager": {
"OVH": {
"Endpoint": "ovh-eu",
"ApplicationKey": "your-application-key",
"ApplicationSecret": "your-application-secret",
"ConsumerKey": "your-consumer-key"
}
}
}
This reads from the SecretsManager:OVH section and validates all options.
Authentication
OVH uses OAuth-based authentication. You'll need:
- An Application Key (UUID format)
- An Application Secret (UUID format)
- A Consumer Key (UUID format)
- An OKMS ID (UUID format)
Generate these from the OVH Console under Keys Management Service.
tip
Store your OVH credentials in environment variables rather than hardcoding them. Use a different API key per environment for better access control.
Usage
// Standard ISecretProvider operations work identically
var secret = await provider.GetSecretAsync("my-secret");
await provider.PutSecretAsync("new-secret", "secret-value");
var versions = await provider.GetSecretVersionsAsync("my-secret");
await provider.DeleteSecretAsync("old-secret");