pulumi-dex 0.7.11__tar.gz
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.
- pulumi_dex-0.7.11/PKG-INFO +523 -0
- pulumi_dex-0.7.11/README.md +503 -0
- pulumi_dex-0.7.11/pulumi_dex/__init__.py +52 -0
- pulumi_dex-0.7.11/pulumi_dex/_utilities.py +331 -0
- pulumi_dex-0.7.11/pulumi_dex/config/__init__.py +9 -0
- pulumi_dex-0.7.11/pulumi_dex/config/__init__.pyi +46 -0
- pulumi_dex-0.7.11/pulumi_dex/config/vars.py +64 -0
- pulumi_dex-0.7.11/pulumi_dex/provider.py +231 -0
- pulumi_dex-0.7.11/pulumi_dex/pulumi-plugin.json +6 -0
- pulumi_dex-0.7.11/pulumi_dex/py.typed +0 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/__init__.py +19 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/_inputs.py +327 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/azure_microsoft_connector.py +307 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/azure_oidc_connector.py +365 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/client.py +314 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/cognito_oidc_connector.py +395 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/connector.py +246 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/git_hub_connector.py +453 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/git_lab_connector.py +364 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/google_connector.py +393 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/local_connector.py +185 -0
- pulumi_dex-0.7.11/pulumi_dex/resources/outputs.py +255 -0
- pulumi_dex-0.7.11/pulumi_dex.egg-info/PKG-INFO +523 -0
- pulumi_dex-0.7.11/pulumi_dex.egg-info/SOURCES.txt +28 -0
- pulumi_dex-0.7.11/pulumi_dex.egg-info/dependency_links.txt +1 -0
- pulumi_dex-0.7.11/pulumi_dex.egg-info/not-zip-safe +1 -0
- pulumi_dex-0.7.11/pulumi_dex.egg-info/requires.txt +6 -0
- pulumi_dex-0.7.11/pulumi_dex.egg-info/top_level.txt +1 -0
- pulumi_dex-0.7.11/setup.cfg +4 -0
- pulumi_dex-0.7.11/setup.py +44 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pulumi_dex
|
|
3
|
+
Version: 0.7.11
|
|
4
|
+
Summary: A Pulumi provider for managing Dex resources via the Dex gRPC Admin API
|
|
5
|
+
Project-URL: Repository, https://github.com/kotaicode/pulumi-dex
|
|
6
|
+
Keywords: category/cloud
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: parver>=0.2.1
|
|
10
|
+
Requires-Dist: pulumi<4.0.0,>=3.165.0
|
|
11
|
+
Requires-Dist: semver>=2.8.1
|
|
12
|
+
Requires-Dist: typing-extensions<5,>=4.11; python_version < "3.11"
|
|
13
|
+
Dynamic: description
|
|
14
|
+
Dynamic: description-content-type
|
|
15
|
+
Dynamic: keywords
|
|
16
|
+
Dynamic: project-url
|
|
17
|
+
Dynamic: requires-dist
|
|
18
|
+
Dynamic: requires-python
|
|
19
|
+
Dynamic: summary
|
|
20
|
+
|
|
21
|
+
# Pulumi Provider for Dex
|
|
22
|
+
|
|
23
|
+
A Pulumi provider for managing Dex (https://dexidp.io/) resources via the Dex gRPC Admin API. This provider allows you to manage Dex OAuth2 clients and connectors (IdPs) as infrastructure-as-code.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **OAuth2 Client Management**: Create, update, and delete Dex OAuth2 clients
|
|
28
|
+
- **Generic Connector Support**: Manage any Dex connector type (OIDC, LDAP, SAML, etc.)
|
|
29
|
+
- **OIDC Connector Support**: First-class support for OIDC connectors with typed configuration
|
|
30
|
+
- **Azure/Entra ID Integration**:
|
|
31
|
+
- `AzureOidcConnector` - Uses generic OIDC connector (type: `oidc`)
|
|
32
|
+
- `AzureMicrosoftConnector` - Uses Dex's Microsoft-specific connector (type: `microsoft`)
|
|
33
|
+
- **AWS Cognito Integration**: `CognitoOidcConnector` for managing Cognito user pools as IdPs
|
|
34
|
+
- **GitLab Integration**: `GitLabConnector` for GitLab.com and self-hosted GitLab instances
|
|
35
|
+
- **GitHub Integration**: `GitHubConnector` for GitHub.com and GitHub Enterprise
|
|
36
|
+
- **Google Integration**: `GoogleConnector` for Google Workspace and Google accounts
|
|
37
|
+
- **Local/Builtin Connector**: `LocalConnector` for local user authentication
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
### Prerequisites
|
|
42
|
+
|
|
43
|
+
- [Pulumi CLI](https://www.pulumi.com/docs/get-started/install/) installed
|
|
44
|
+
- Go 1.24+ (for building the provider)
|
|
45
|
+
- Access to a Dex instance with gRPC API enabled
|
|
46
|
+
|
|
47
|
+
### Building the Provider
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Clone the repository
|
|
51
|
+
git clone https://github.com/kotaicode/pulumi-dex.git
|
|
52
|
+
cd pulumi-dex
|
|
53
|
+
|
|
54
|
+
# Build the provider binary
|
|
55
|
+
go build -o bin/pulumi-resource-dex ./cmd/pulumi-resource-dex
|
|
56
|
+
|
|
57
|
+
# Install the provider locally
|
|
58
|
+
pulumi plugin install resource dex v0.1.0 --file bin/pulumi-resource-dex
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Generating Language SDKs
|
|
62
|
+
|
|
63
|
+
After building the provider, generate SDKs for your preferred language:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Generate TypeScript SDK
|
|
67
|
+
pulumi package gen-sdk bin/pulumi-resource-dex --language typescript --out sdk/typescript
|
|
68
|
+
|
|
69
|
+
# Generate Go SDK
|
|
70
|
+
pulumi package gen-sdk bin/pulumi-resource-dex --language go --out sdk/go
|
|
71
|
+
|
|
72
|
+
# Generate Python SDK (optional)
|
|
73
|
+
pulumi package gen-sdk bin/pulumi-resource-dex --language python --out sdk/python
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
The provider requires configuration to connect to your Dex gRPC API:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import * as dex from "@kotaicode/pulumi-dex";
|
|
82
|
+
|
|
83
|
+
const provider = new dex.Provider("dex", {
|
|
84
|
+
host: "dex.internal:5557", // Dex gRPC host:port
|
|
85
|
+
// Optional: TLS configuration for mTLS
|
|
86
|
+
caCert: fs.readFileSync("certs/ca.crt", "utf-8"),
|
|
87
|
+
clientCert: fs.readFileSync("certs/client.crt", "utf-8"),
|
|
88
|
+
clientKey: fs.readFileSync("certs/client.key", "utf-8"),
|
|
89
|
+
// Or for development:
|
|
90
|
+
// insecureSkipVerify: true,
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Environment Variables
|
|
95
|
+
|
|
96
|
+
You can also configure the provider using environment variables:
|
|
97
|
+
|
|
98
|
+
- `DEX_HOST` - Dex gRPC host:port
|
|
99
|
+
- `DEX_CA_CERT` - PEM-encoded CA certificate
|
|
100
|
+
- `DEX_CLIENT_CERT` - PEM-encoded client certificate
|
|
101
|
+
- `DEX_CLIENT_KEY` - PEM-encoded client private key
|
|
102
|
+
- `DEX_INSECURE_SKIP_VERIFY` - Skip TLS verification (development only)
|
|
103
|
+
- `DEX_TIMEOUT_SECONDS` - Per-RPC timeout in seconds
|
|
104
|
+
|
|
105
|
+
## Usage Examples
|
|
106
|
+
|
|
107
|
+
### Managing an OAuth2 Client
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
import * as dex from "@kotaicode/pulumi-dex";
|
|
111
|
+
|
|
112
|
+
const webClient = new dex.Client("webClient", {
|
|
113
|
+
clientId: "my-web-app",
|
|
114
|
+
name: "My Web App",
|
|
115
|
+
redirectUris: ["https://app.example.com/callback"],
|
|
116
|
+
// secret is optional - will be auto-generated if omitted
|
|
117
|
+
}, { provider });
|
|
118
|
+
|
|
119
|
+
export const clientSecret = webClient.secret; // Pulumi secret
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Azure/Entra ID Connector (Generic OIDC)
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
const azureConnector = new dex.AzureOidcConnector("azure-tenant-a", {
|
|
126
|
+
connectorId: "azure-tenant-a",
|
|
127
|
+
name: "Azure AD (Tenant A)",
|
|
128
|
+
tenantId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
|
|
129
|
+
clientId: "your-azure-app-client-id",
|
|
130
|
+
clientSecret: "your-azure-app-client-secret", // Pulumi secret
|
|
131
|
+
redirectUri: "https://dex.example.com/callback",
|
|
132
|
+
scopes: ["openid", "profile", "email", "offline_access"],
|
|
133
|
+
userNameSource: "preferred_username", // or "upn" or "email"
|
|
134
|
+
}, { provider });
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Azure/Entra ID Connector (Microsoft-Specific)
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
const azureMsConnector = new dex.AzureMicrosoftConnector("azure-ms", {
|
|
141
|
+
connectorId: "azure-ms",
|
|
142
|
+
name: "Azure AD (Microsoft Connector)",
|
|
143
|
+
tenant: "common", // or "organizations" or specific tenant ID
|
|
144
|
+
clientId: "your-azure-app-client-id",
|
|
145
|
+
clientSecret: "your-azure-app-client-secret",
|
|
146
|
+
redirectUri: "https://dex.example.com/callback",
|
|
147
|
+
groups: "groups", // Optional: group claim name
|
|
148
|
+
}, { provider });
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### AWS Cognito Connector
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
const cognitoConnector = new dex.CognitoOidcConnector("cognito-eu", {
|
|
155
|
+
connectorId: "cognito-eu",
|
|
156
|
+
name: "Cognito (EU)",
|
|
157
|
+
region: "eu-central-1",
|
|
158
|
+
userPoolId: "eu-central-1_XXXXXXX",
|
|
159
|
+
clientId: "your-cognito-app-client-id",
|
|
160
|
+
clientSecret: "your-cognito-app-client-secret",
|
|
161
|
+
redirectUri: "https://dex.example.com/callback",
|
|
162
|
+
userNameSource: "email", // or "sub"
|
|
163
|
+
}, { provider });
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### GitLab Connector
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
const gitlabConnector = new dex.GitLabConnector("gitlab", {
|
|
170
|
+
connectorId: "gitlab",
|
|
171
|
+
name: "GitLab",
|
|
172
|
+
clientId: "your-gitlab-client-id",
|
|
173
|
+
clientSecret: "your-gitlab-client-secret",
|
|
174
|
+
redirectUri: "https://dex.example.com/callback",
|
|
175
|
+
baseURL: "https://gitlab.com", // Optional, defaults to https://gitlab.com
|
|
176
|
+
groups: ["my-group"], // Optional: groups whitelist
|
|
177
|
+
useLoginAsID: false, // Optional: use username as ID instead of internal ID
|
|
178
|
+
getGroupsPermission: false, // Optional: include group permissions in groups claim
|
|
179
|
+
}, { provider });
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### GitHub Connector
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
const githubConnector = new dex.GitHubConnector("github", {
|
|
186
|
+
connectorId: "github",
|
|
187
|
+
name: "GitHub",
|
|
188
|
+
clientId: "your-github-client-id",
|
|
189
|
+
clientSecret: "your-github-client-secret",
|
|
190
|
+
redirectUri: "https://dex.example.com/callback",
|
|
191
|
+
orgs: [
|
|
192
|
+
{ name: "my-organization" },
|
|
193
|
+
{
|
|
194
|
+
name: "my-organization-with-teams",
|
|
195
|
+
teams: ["red-team", "blue-team"]
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
teamNameField: "slug", // Optional: "name", "slug", or "both" - default: "slug"
|
|
199
|
+
useLoginAsID: false, // Optional: use username as ID
|
|
200
|
+
// For GitHub Enterprise:
|
|
201
|
+
// hostName: "git.example.com",
|
|
202
|
+
// rootCA: "/etc/dex/ca.crt",
|
|
203
|
+
}, { provider });
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Google Connector
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
const googleConnector = new dex.GoogleConnector("google", {
|
|
210
|
+
connectorId: "google",
|
|
211
|
+
name: "Google",
|
|
212
|
+
clientId: "your-google-client-id",
|
|
213
|
+
clientSecret: "your-google-client-secret",
|
|
214
|
+
redirectUri: "https://dex.example.com/callback",
|
|
215
|
+
promptType: "consent", // Optional: default is "consent"
|
|
216
|
+
hostedDomains: ["example.com"], // Optional: domain whitelist for G Suite
|
|
217
|
+
groups: ["admins@example.com"], // Optional: group whitelist for G Suite
|
|
218
|
+
// For group fetching:
|
|
219
|
+
// serviceAccountFilePath: "/path/to/googleAuth.json",
|
|
220
|
+
// domainToAdminEmail: {
|
|
221
|
+
// "*": "super-user@example.com",
|
|
222
|
+
// "my-domain.com": "super-user@my-domain.com"
|
|
223
|
+
// },
|
|
224
|
+
}, { provider });
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Local/Builtin Connector
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
const localConnector = new dex.LocalConnector("local", {
|
|
231
|
+
connectorId: "local",
|
|
232
|
+
name: "Local",
|
|
233
|
+
enabled: true, // Optional: default is true
|
|
234
|
+
}, { provider });
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Generic Connector (OIDC)
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
const genericOidcConnector = new dex.Connector("github-oidc", {
|
|
241
|
+
connectorId: "github-oidc",
|
|
242
|
+
type: "oidc",
|
|
243
|
+
name: "GitHub OIDC",
|
|
244
|
+
oidcConfig: {
|
|
245
|
+
issuer: "https://token.actions.githubusercontent.com",
|
|
246
|
+
clientId: "your-github-oidc-client-id",
|
|
247
|
+
clientSecret: "your-secret",
|
|
248
|
+
redirectUri: "https://dex.example.com/callback",
|
|
249
|
+
scopes: ["openid", "email", "profile"],
|
|
250
|
+
},
|
|
251
|
+
}, { provider });
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Generic Connector (Raw JSON)
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
const githubConnector = new dex.Connector("github", {
|
|
258
|
+
connectorId: "github",
|
|
259
|
+
type: "github",
|
|
260
|
+
name: "GitHub",
|
|
261
|
+
rawConfig: JSON.stringify({
|
|
262
|
+
clientID: "your-github-client-id",
|
|
263
|
+
clientSecret: "your-github-client-secret",
|
|
264
|
+
redirectURI: "https://dex.example.com/callback",
|
|
265
|
+
orgs: ["kotaicode"],
|
|
266
|
+
}),
|
|
267
|
+
}, { provider });
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Resources
|
|
271
|
+
|
|
272
|
+
### `dex.Client`
|
|
273
|
+
|
|
274
|
+
Manages an OAuth2 client in Dex.
|
|
275
|
+
|
|
276
|
+
**Inputs:**
|
|
277
|
+
- `clientId` (string, required) - Unique identifier for the client
|
|
278
|
+
- `name` (string, required) - Display name
|
|
279
|
+
- `secret` (string, optional, secret) - Client secret (auto-generated if omitted)
|
|
280
|
+
- `redirectUris` (string[], required) - Allowed redirect URIs
|
|
281
|
+
- `trustedPeers` (string[], optional) - Trusted peer client IDs
|
|
282
|
+
- `public` (boolean, optional) - Public (non-confidential) client
|
|
283
|
+
- `logoUrl` (string, optional) - Logo image URL
|
|
284
|
+
|
|
285
|
+
**Outputs:**
|
|
286
|
+
- `id` - Resource ID (same as clientId)
|
|
287
|
+
- `clientId` - The client ID
|
|
288
|
+
- `secret` - The client secret (Pulumi secret)
|
|
289
|
+
- `createdAt` - Creation timestamp
|
|
290
|
+
|
|
291
|
+
### `dex.Connector`
|
|
292
|
+
|
|
293
|
+
Manages a generic connector in Dex.
|
|
294
|
+
|
|
295
|
+
**Inputs:**
|
|
296
|
+
- `connectorId` (string, required) - Unique identifier
|
|
297
|
+
- `type` (string, required) - Connector type (e.g., "oidc", "ldap", "saml", "github")
|
|
298
|
+
- `name` (string, required) - Display name
|
|
299
|
+
- `oidcConfig` (OIDCConfig, optional) - OIDC configuration (use when type="oidc")
|
|
300
|
+
- `rawConfig` (string, optional) - Raw JSON configuration (for non-OIDC connectors)
|
|
301
|
+
|
|
302
|
+
**Note:** Exactly one of `oidcConfig` or `rawConfig` must be provided.
|
|
303
|
+
|
|
304
|
+
### `dex.AzureOidcConnector`
|
|
305
|
+
|
|
306
|
+
Manages an Azure AD/Entra ID connector using generic OIDC.
|
|
307
|
+
|
|
308
|
+
**Inputs:**
|
|
309
|
+
- `connectorId` (string, required)
|
|
310
|
+
- `name` (string, required)
|
|
311
|
+
- `tenantId` (string, required) - Azure tenant ID (UUID)
|
|
312
|
+
- `clientId` (string, required) - Azure app client ID
|
|
313
|
+
- `clientSecret` (string, required, secret) - Azure app client secret
|
|
314
|
+
- `redirectUri` (string, required)
|
|
315
|
+
- `scopes` (string[], optional) - Defaults to `["openid", "profile", "email", "offline_access"]`
|
|
316
|
+
- `userNameSource` (string, optional) - "preferred_username" (default), "upn", or "email"
|
|
317
|
+
- `extraOidc` (map, optional) - Additional OIDC config fields
|
|
318
|
+
|
|
319
|
+
### `dex.AzureMicrosoftConnector`
|
|
320
|
+
|
|
321
|
+
Manages an Azure AD/Entra ID connector using Dex's Microsoft-specific connector.
|
|
322
|
+
|
|
323
|
+
**Inputs:**
|
|
324
|
+
- `connectorId` (string, required)
|
|
325
|
+
- `name` (string, required)
|
|
326
|
+
- `tenant` (string, required) - "common", "organizations", or tenant ID (UUID)
|
|
327
|
+
- `clientId` (string, required)
|
|
328
|
+
- `clientSecret` (string, required, secret)
|
|
329
|
+
- `redirectUri` (string, required)
|
|
330
|
+
- `groups` (string, optional) - Group claim name (requires admin consent)
|
|
331
|
+
|
|
332
|
+
### `dex.CognitoOidcConnector`
|
|
333
|
+
|
|
334
|
+
Manages an AWS Cognito user pool connector.
|
|
335
|
+
|
|
336
|
+
**Inputs:**
|
|
337
|
+
- `connectorId` (string, required)
|
|
338
|
+
- `name` (string, required)
|
|
339
|
+
- `region` (string, required) - AWS region (e.g., "eu-central-1")
|
|
340
|
+
- `userPoolId` (string, required) - Cognito user pool ID
|
|
341
|
+
- `clientId` (string, required) - Cognito app client ID
|
|
342
|
+
- `clientSecret` (string, required, secret) - Cognito app client secret
|
|
343
|
+
- `redirectUri` (string, required)
|
|
344
|
+
- `scopes` (string[], optional) - Defaults to `["openid", "email", "profile"]`
|
|
345
|
+
- `userNameSource` (string, optional) - "email" (default) or "sub"
|
|
346
|
+
- `extraOidc` (map, optional) - Additional OIDC config fields
|
|
347
|
+
|
|
348
|
+
### `dex.GitLabConnector`
|
|
349
|
+
|
|
350
|
+
Manages a GitLab connector in Dex.
|
|
351
|
+
|
|
352
|
+
**Inputs:**
|
|
353
|
+
- `connectorId` (string, required)
|
|
354
|
+
- `name` (string, required)
|
|
355
|
+
- `clientId` (string, required) - GitLab application client ID
|
|
356
|
+
- `clientSecret` (string, required, secret) - GitLab application client secret
|
|
357
|
+
- `redirectUri` (string, required)
|
|
358
|
+
- `baseURL` (string, optional) - GitLab instance URL, defaults to `https://gitlab.com`
|
|
359
|
+
- `groups` (string[], optional) - Groups whitelist
|
|
360
|
+
- `useLoginAsID` (bool, optional) - Use username as ID instead of internal ID, default: `false`
|
|
361
|
+
- `getGroupsPermission` (bool, optional) - Include group permissions in groups claim, default: `false`
|
|
362
|
+
|
|
363
|
+
### `dex.GitHubConnector`
|
|
364
|
+
|
|
365
|
+
Manages a GitHub connector in Dex.
|
|
366
|
+
|
|
367
|
+
**Inputs:**
|
|
368
|
+
- `connectorId` (string, required)
|
|
369
|
+
- `name` (string, required)
|
|
370
|
+
- `clientId` (string, required) - GitHub OAuth app client ID
|
|
371
|
+
- `clientSecret` (string, required, secret) - GitHub OAuth app client secret
|
|
372
|
+
- `redirectUri` (string, required)
|
|
373
|
+
- `orgs` (GitHubOrg[], optional) - List of organizations and teams
|
|
374
|
+
- `name` (string, required) - Organization name
|
|
375
|
+
- `teams` (string[], optional) - Team names within the organization
|
|
376
|
+
- `loadAllGroups` (bool, optional) - Load all user orgs/teams, default: `false`
|
|
377
|
+
- `teamNameField` (string, optional) - "name", "slug", or "both", default: "slug"
|
|
378
|
+
- `useLoginAsID` (bool, optional) - Use username as ID, default: `false`
|
|
379
|
+
- `preferredEmailDomain` (string, optional) - Preferred email domain
|
|
380
|
+
- `hostName` (string, optional) - GitHub Enterprise hostname
|
|
381
|
+
- `rootCA` (string, optional) - Root CA certificate path for GitHub Enterprise
|
|
382
|
+
|
|
383
|
+
### `dex.GoogleConnector`
|
|
384
|
+
|
|
385
|
+
Manages a Google connector in Dex.
|
|
386
|
+
|
|
387
|
+
**Inputs:**
|
|
388
|
+
- `connectorId` (string, required)
|
|
389
|
+
- `name` (string, required)
|
|
390
|
+
- `clientId` (string, required) - Google OAuth client ID
|
|
391
|
+
- `clientSecret` (string, required, secret) - Google OAuth client secret
|
|
392
|
+
- `redirectUri` (string, required)
|
|
393
|
+
- `promptType` (string, optional) - OIDC prompt parameter, default: "consent"
|
|
394
|
+
- `hostedDomains` (string[], optional) - Domain whitelist for G Suite
|
|
395
|
+
- `groups` (string[], optional) - Group whitelist for G Suite
|
|
396
|
+
- `serviceAccountFilePath` (string, optional) - Service account JSON file path for group fetching
|
|
397
|
+
- `domainToAdminEmail` (map[string]string, optional) - Domain to admin email mapping for group fetching
|
|
398
|
+
|
|
399
|
+
### `dex.LocalConnector`
|
|
400
|
+
|
|
401
|
+
Manages a local/builtin connector in Dex.
|
|
402
|
+
|
|
403
|
+
**Inputs:**
|
|
404
|
+
- `connectorId` (string, required)
|
|
405
|
+
- `name` (string, required)
|
|
406
|
+
- `enabled` (bool, optional) - Whether the connector is enabled, default: `true`
|
|
407
|
+
|
|
408
|
+
**Note:** The local connector requires `enablePasswordDB: true` in Dex configuration. User management is handled separately via Dex's static passwords or gRPC API.
|
|
409
|
+
|
|
410
|
+
## Local Development and Testing
|
|
411
|
+
|
|
412
|
+
### Running Dex Locally with Docker Compose
|
|
413
|
+
|
|
414
|
+
See `docker-compose.yml` for a local Dex setup with gRPC API enabled.
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
# Start Dex
|
|
418
|
+
docker-compose up -d
|
|
419
|
+
|
|
420
|
+
# Dex gRPC will be available at localhost:5557
|
|
421
|
+
# Dex web UI will be available at http://localhost:5556
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Example Pulumi Program
|
|
425
|
+
|
|
426
|
+
See the `examples/` directory for complete example programs.
|
|
427
|
+
|
|
428
|
+
## Dex Configuration Requirements
|
|
429
|
+
|
|
430
|
+
Your Dex instance must have the gRPC API enabled. Add this to your Dex configuration:
|
|
431
|
+
|
|
432
|
+
```yaml
|
|
433
|
+
grpc:
|
|
434
|
+
addr: 127.0.0.1:5557
|
|
435
|
+
tlsCert: /etc/dex/grpc.crt
|
|
436
|
+
tlsKey: /etc/dex/grpc.key
|
|
437
|
+
tlsClientCA: /etc/dex/client.crt
|
|
438
|
+
reflection: true
|
|
439
|
+
|
|
440
|
+
# Enable connector CRUD (required for connector management)
|
|
441
|
+
enablePasswordDB: false
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
And set the environment variable:
|
|
445
|
+
```bash
|
|
446
|
+
export DEX_API_CONNECTORS_CRUD=true
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
## Security Considerations
|
|
450
|
+
|
|
451
|
+
- **Secrets**: All secrets (client secrets, TLS keys) are automatically marked as Pulumi secrets and encrypted in state
|
|
452
|
+
- **mTLS**: Strongly recommended for production use. Configure TLS certificates properly
|
|
453
|
+
- **Network**: Ensure Dex gRPC API is only accessible from trusted networks
|
|
454
|
+
|
|
455
|
+
## Contributing
|
|
456
|
+
|
|
457
|
+
Contributions are welcome! Please open an issue or submit a pull request.
|
|
458
|
+
|
|
459
|
+
## Dex Version Compatibility
|
|
460
|
+
|
|
461
|
+
This provider has been tested with:
|
|
462
|
+
- **Dex v2.4.0+** (with `DEX_API_CONNECTORS_CRUD=true`)
|
|
463
|
+
|
|
464
|
+
The provider requires:
|
|
465
|
+
- Dex gRPC API enabled
|
|
466
|
+
- `DEX_API_CONNECTORS_CRUD=true` environment variable set on Dex (required for connector CRUD operations)
|
|
467
|
+
|
|
468
|
+
For older Dex versions, connector management may not be available. Client management should work with any Dex version that exposes the gRPC API.
|
|
469
|
+
|
|
470
|
+
## Development
|
|
471
|
+
|
|
472
|
+
### Prerequisites
|
|
473
|
+
- Go 1.24.1+
|
|
474
|
+
- Pulumi CLI
|
|
475
|
+
- Docker and Docker Compose (for local testing)
|
|
476
|
+
|
|
477
|
+
### Building
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
make build
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
### Running Tests
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
# Unit tests
|
|
487
|
+
make test
|
|
488
|
+
|
|
489
|
+
# Integration tests (requires Dex running)
|
|
490
|
+
make dex-up
|
|
491
|
+
make test # Run tests with integration tag
|
|
492
|
+
make dex-down
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### Code Quality
|
|
496
|
+
|
|
497
|
+
```bash
|
|
498
|
+
# Run linter
|
|
499
|
+
golangci-lint run
|
|
500
|
+
|
|
501
|
+
# Format code
|
|
502
|
+
go fmt ./...
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
## Contributing
|
|
506
|
+
|
|
507
|
+
Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
508
|
+
|
|
509
|
+
1. Fork the repository
|
|
510
|
+
2. Create a feature branch
|
|
511
|
+
3. Make your changes
|
|
512
|
+
4. Add tests
|
|
513
|
+
5. Submit a pull request
|
|
514
|
+
|
|
515
|
+
## License
|
|
516
|
+
|
|
517
|
+
[License TBD - Add MIT or Apache 2.0]
|
|
518
|
+
|
|
519
|
+
## Support
|
|
520
|
+
|
|
521
|
+
- **GitHub Issues**: https://github.com/kotaicode/pulumi-dex/issues
|
|
522
|
+
- **Documentation**: https://github.com/kotaicode/pulumi-dex#readme
|
|
523
|
+
|