Skip to content

Commit

Permalink
Merge pull request #1972 from samuelbarata/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz authored Oct 14, 2022
2 parents 59cef22 + c750513 commit 3a80ee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func New(version string) func() *schema.Provider {
DefaultFunc: schema.EnvDefaultFunc("CLOUDFLARE_API_KEY", nil),
Description: "The API key for operations. Alternatively, can be configured using the `CLOUDFLARE_API_KEY` environment variable. API keys are [now considered legacy by Cloudflare](https://developers.cloudflare.com/api/keys/#limitations), API tokens should be used instead.",
ExactlyOneOf: []string{"api_key", "api_token", "api_user_service_key"},
ValidateFunc: validation.StringMatch(regexp.MustCompile("[0-9a-f]{37}"), "API key must only contain characters 0-9 and a-f (all lowercased)"),
ValidateFunc: validation.StringMatch(regexp.MustCompile("[0-9a-f]{37}"), "API key must be 37 characters long and only contain characters 0-9 and a-f (all lowercased)"),
},

"api_token": {
Expand All @@ -102,7 +102,7 @@ func New(version string) func() *schema.Provider {
DefaultFunc: schema.EnvDefaultFunc("CLOUDFLARE_API_TOKEN", nil),
Description: "The API Token for operations. Alternatively, can be configured using the `CLOUDFLARE_API_TOKEN` environment variable.",
ExactlyOneOf: []string{"api_key", "api_token", "api_user_service_key"},
ValidateFunc: validation.StringMatch(regexp.MustCompile("[A-Za-z0-9-_]{40}"), "API tokens must only contain characters a-z, A-Z, 0-9, hyphens and underscores"),
ValidateFunc: validation.StringMatch(regexp.MustCompile("[A-Za-z0-9-_]{40}"), "API tokens must be 40 characters long and only contain characters a-z, A-Z, 0-9, hyphens and underscores"),
},

"api_user_service_key": {
Expand Down

0 comments on commit 3a80ee2

Please sign in to comment.