Skip to content

Commit

Permalink
Mark sensitive config fields Secret in schema (#1014)
Browse files Browse the repository at this point in the history
Fixes #1013

- **Set apiToken, apiKey, userServiceKey and accountId to Secret**
- **Generate schema**
- **build sdks**
  • Loading branch information
guineveresaenger authored Dec 20, 2024
1 parent 9856959 commit 67f68b1
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 21 deletions.
27 changes: 18 additions & 9 deletions provider/cmd/pulumi-resource-cloudflare/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,18 @@
},
"apiKey": {
"type": "string",
"description": "The API key for operations. Alternatively, can be configured using the `CLOUDFLARE_API_KEY` environment variable. API\nkeys are [now considered legacy by\nCloudflare](https://developers.cloudflare.com/fundamentals/api/get-started/keys/#limitations), API tokens should be used\ninstead. Must provide only one of `api_key`, `api_token`, `api_user_service_key`.\n"
"description": "The API key for operations. Alternatively, can be configured using the `CLOUDFLARE_API_KEY` environment variable. API\nkeys are [now considered legacy by\nCloudflare](https://developers.cloudflare.com/fundamentals/api/get-started/keys/#limitations), API tokens should be used\ninstead. Must provide only one of `api_key`, `api_token`, `api_user_service_key`.\n",
"secret": true
},
"apiToken": {
"type": "string",
"description": "The API Token for operations. Alternatively, can be configured using the `CLOUDFLARE_API_TOKEN` environment variable.\nMust provide only one of `api_key`, `api_token`, `api_user_service_key`.\n"
"description": "The API Token for operations. Alternatively, can be configured using the `CLOUDFLARE_API_TOKEN` environment variable.\nMust provide only one of `api_key`, `api_token`, `api_user_service_key`.\n",
"secret": true
},
"apiUserServiceKey": {
"type": "string",
"description": "A special Cloudflare API key good for a restricted set of endpoints. Alternatively, can be configured using the\n`CLOUDFLARE_API_USER_SERVICE_KEY` environment variable. Must provide only one of `api_key`, `api_token`,\n`api_user_service_key`.\n"
"description": "A special Cloudflare API key good for a restricted set of endpoints. Alternatively, can be configured using the\n`CLOUDFLARE_API_USER_SERVICE_KEY` environment variable. Must provide only one of `api_key`, `api_token`,\n`api_user_service_key`.\n",
"secret": true
},
"email": {
"type": "string",
Expand Down Expand Up @@ -14225,15 +14228,18 @@
},
"apiKey": {
"type": "string",
"description": "The API key for operations. Alternatively, can be configured using the `CLOUDFLARE_API_KEY` environment variable. API\nkeys are [now considered legacy by\nCloudflare](https://developers.cloudflare.com/fundamentals/api/get-started/keys/#limitations), API tokens should be used\ninstead. Must provide only one of `api_key`, `api_token`, `api_user_service_key`.\n"
"description": "The API key for operations. Alternatively, can be configured using the `CLOUDFLARE_API_KEY` environment variable. API\nkeys are [now considered legacy by\nCloudflare](https://developers.cloudflare.com/fundamentals/api/get-started/keys/#limitations), API tokens should be used\ninstead. Must provide only one of `api_key`, `api_token`, `api_user_service_key`.\n",
"secret": true
},
"apiToken": {
"type": "string",
"description": "The API Token for operations. Alternatively, can be configured using the `CLOUDFLARE_API_TOKEN` environment variable.\nMust provide only one of `api_key`, `api_token`, `api_user_service_key`.\n"
"description": "The API Token for operations. Alternatively, can be configured using the `CLOUDFLARE_API_TOKEN` environment variable.\nMust provide only one of `api_key`, `api_token`, `api_user_service_key`.\n",
"secret": true
},
"apiUserServiceKey": {
"type": "string",
"description": "A special Cloudflare API key good for a restricted set of endpoints. Alternatively, can be configured using the\n`CLOUDFLARE_API_USER_SERVICE_KEY` environment variable. Must provide only one of `api_key`, `api_token`,\n`api_user_service_key`.\n"
"description": "A special Cloudflare API key good for a restricted set of endpoints. Alternatively, can be configured using the\n`CLOUDFLARE_API_USER_SERVICE_KEY` environment variable. Must provide only one of `api_key`, `api_token`,\n`api_user_service_key`.\n",
"secret": true
},
"email": {
"type": "string",
Expand Down Expand Up @@ -14280,15 +14286,18 @@
},
"apiKey": {
"type": "string",
"description": "The API key for operations. Alternatively, can be configured using the `CLOUDFLARE_API_KEY` environment variable. API\nkeys are [now considered legacy by\nCloudflare](https://developers.cloudflare.com/fundamentals/api/get-started/keys/#limitations), API tokens should be used\ninstead. Must provide only one of `api_key`, `api_token`, `api_user_service_key`.\n"
"description": "The API key for operations. Alternatively, can be configured using the `CLOUDFLARE_API_KEY` environment variable. API\nkeys are [now considered legacy by\nCloudflare](https://developers.cloudflare.com/fundamentals/api/get-started/keys/#limitations), API tokens should be used\ninstead. Must provide only one of `api_key`, `api_token`, `api_user_service_key`.\n",
"secret": true
},
"apiToken": {
"type": "string",
"description": "The API Token for operations. Alternatively, can be configured using the `CLOUDFLARE_API_TOKEN` environment variable.\nMust provide only one of `api_key`, `api_token`, `api_user_service_key`.\n"
"description": "The API Token for operations. Alternatively, can be configured using the `CLOUDFLARE_API_TOKEN` environment variable.\nMust provide only one of `api_key`, `api_token`, `api_user_service_key`.\n",
"secret": true
},
"apiUserServiceKey": {
"type": "string",
"description": "A special Cloudflare API key good for a restricted set of endpoints. Alternatively, can be configured using the\n`CLOUDFLARE_API_USER_SERVICE_KEY` environment variable. Must provide only one of `api_key`, `api_token`,\n`api_user_service_key`.\n"
"description": "A special Cloudflare API key good for a restricted set of endpoints. Alternatively, can be configured using the\n`CLOUDFLARE_API_USER_SERVICE_KEY` environment variable. Must provide only one of `api_key`, `api_token`,\n`api_user_service_key`.\n",
"secret": true
},
"email": {
"type": "string",
Expand Down
12 changes: 12 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ func Provider() info.Provider {
EnvVars: []string{"CLOUDFLARE_API_CLIENT_LOGGING"},
},
},
"api_token": {
Secret: tfbridge.True(),
},
"api_key": {
Secret: tfbridge.True(),
},
"api_user_service_key": {
Secret: tfbridge.True(),
},
"account_id": {
Secret: tfbridge.True(),
},
},

Resources: map[string]*info.Resource{
Expand Down
48 changes: 42 additions & 6 deletions sdk/dotnet/Provider.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions sdk/go/cloudflare/provider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions sdk/java/src/main/java/com/pulumi/cloudflare/Provider.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions sdk/nodejs/provider.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions sdk/python/pulumi_cloudflare/provider.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 67f68b1

Please sign in to comment.