@kustodian/plugin-doppler 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/package.json +1 -1
- package/src/executor.ts +11 -1
- package/src/plugin.ts +5 -1
- package/src/resolver.ts +5 -1
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @kustodian/plugin-doppler
|
|
2
|
+
|
|
3
|
+
Doppler secret provider plugin for [Kustodian](https://github.com/lucasilverentand/kustodian). Enables seamless integration with [Doppler](https://www.doppler.com/) for secure secret management in your Kubernetes configurations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add @kustodian/plugin-doppler
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
- [Doppler CLI](https://docs.doppler.com/docs/install-cli) installed and available in your PATH
|
|
14
|
+
- Authentication configured via `doppler login` or `DOPPLER_TOKEN` environment variable
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { create_doppler_plugin } from '@kustodian/plugin-doppler';
|
|
20
|
+
|
|
21
|
+
// Create with default options
|
|
22
|
+
const plugin = create_doppler_plugin();
|
|
23
|
+
|
|
24
|
+
// Or with custom options
|
|
25
|
+
const plugin = create_doppler_plugin({
|
|
26
|
+
token: process.env.DOPPLER_TOKEN, // Optional: override token
|
|
27
|
+
timeout: 30000, // Optional: CLI timeout in ms
|
|
28
|
+
fail_on_missing: true, // Optional: fail if secrets are missing
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### CLI Commands
|
|
33
|
+
|
|
34
|
+
The plugin provides CLI commands for working with Doppler:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Check Doppler CLI availability
|
|
38
|
+
kustodian doppler check
|
|
39
|
+
|
|
40
|
+
# Test reading a secret
|
|
41
|
+
kustodian doppler test <project> <config> <secret>
|
|
42
|
+
|
|
43
|
+
# List available secrets in a config
|
|
44
|
+
kustodian doppler list-secrets <project> <config>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Programmatic API
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import {
|
|
51
|
+
check_doppler_available,
|
|
52
|
+
doppler_secret_get,
|
|
53
|
+
doppler_secrets_download,
|
|
54
|
+
resolve_doppler_substitutions,
|
|
55
|
+
} from '@kustodian/plugin-doppler';
|
|
56
|
+
|
|
57
|
+
// Check if Doppler CLI is available
|
|
58
|
+
const available = await check_doppler_available();
|
|
59
|
+
|
|
60
|
+
// Get a single secret
|
|
61
|
+
const secret = await doppler_secret_get('my-project', 'production', 'API_KEY');
|
|
62
|
+
|
|
63
|
+
// Download all secrets for a project/config
|
|
64
|
+
const secrets = await doppler_secrets_download('my-project', 'production');
|
|
65
|
+
|
|
66
|
+
// Resolve substitutions (batched by project/config for efficiency)
|
|
67
|
+
const resolved = await resolve_doppler_substitutions([
|
|
68
|
+
{ name: 'api_key', project: 'my-project', config: 'production', secret: 'API_KEY' },
|
|
69
|
+
{ name: 'db_url', project: 'my-project', config: 'production', secret: 'DATABASE_URL' },
|
|
70
|
+
]);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
MIT
|
package/package.json
CHANGED
package/src/executor.ts
CHANGED
|
@@ -120,7 +120,17 @@ export async function doppler_secrets_download(
|
|
|
120
120
|
|
|
121
121
|
const result = await exec_command(
|
|
122
122
|
'doppler',
|
|
123
|
-
[
|
|
123
|
+
[
|
|
124
|
+
'secrets',
|
|
125
|
+
'download',
|
|
126
|
+
'--project',
|
|
127
|
+
project,
|
|
128
|
+
'--config',
|
|
129
|
+
config,
|
|
130
|
+
'--format',
|
|
131
|
+
'json',
|
|
132
|
+
'--no-file',
|
|
133
|
+
],
|
|
124
134
|
{
|
|
125
135
|
timeout,
|
|
126
136
|
env,
|
package/src/plugin.ts
CHANGED
|
@@ -9,7 +9,11 @@ import type {
|
|
|
9
9
|
PluginManifestType,
|
|
10
10
|
} from '@kustodian/plugins';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
check_doppler_available,
|
|
14
|
+
doppler_secret_get,
|
|
15
|
+
doppler_secrets_download,
|
|
16
|
+
} from './executor.js';
|
|
13
17
|
import type { DopplerPluginOptionsType } from './types.js';
|
|
14
18
|
|
|
15
19
|
/**
|
package/src/resolver.ts
CHANGED
|
@@ -3,7 +3,11 @@ import type { KustodianErrorType } from '@kustodian/core';
|
|
|
3
3
|
import type { DopplerSubstitutionType } from '@kustodian/schema';
|
|
4
4
|
|
|
5
5
|
import { doppler_secrets_download } from './executor.js';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
type DopplerCacheKeyType,
|
|
8
|
+
type DopplerPluginOptionsType,
|
|
9
|
+
create_cache_key,
|
|
10
|
+
} from './types.js';
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
13
|
* Resolves Doppler substitutions to actual secret values.
|