Skip to content

Commit cae8197

Browse files
committed
refactor: rename Webflow API token configuration from 'token' to 'apiToken'
1 parent 84deab2 commit cae8197

File tree

19 files changed

+86
-83
lines changed

19 files changed

+86
-83
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ sdk/java/.gradle
1717
sdk/java/build/
1818
sdk/java/build.gradle
1919
sdk/python/venv
20+
21+
# Local development/testing
22+
/dev/

examples/yaml/Pulumi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: webflow-example
22
runtime: yaml
33

44
config:
5-
webflow:token:
6-
secure: your-webflow-api-token-here
5+
webflow:apiToken:
6+
value: your-webflow-api-token-here
77

88
resources:
99
# Example: Configure robots.txt for a site

provider/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
// ErrTokenNotConfigured is returned when no API token is available.
13-
var ErrTokenNotConfigured = fmt.Errorf("Webflow API token not configured. Configure using: pulumi config set webflow:token <token> --secret OR set WEBFLOW_API_TOKEN environment variable")
13+
var ErrTokenNotConfigured = fmt.Errorf("Webflow API token not configured. Configure using: pulumi config set webflow:apiToken <token> --secret OR set WEBFLOW_API_TOKEN environment variable")
1414

1515
// getEnvToken retrieves the Webflow API token from the environment variable.
1616
func getEnvToken() string {

provider/cmd/pulumi-resource-webflow/schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"config": {
2727
"variables": {
28-
"token": {
28+
"apiToken": {
2929
"type": "string",
3030
"description": "Webflow API v2 bearer token for authentication. Can also be set via WEBFLOW_API_TOKEN environment variable.",
3131
"secret": true
@@ -34,14 +34,14 @@
3434
},
3535
"provider": {
3636
"properties": {
37-
"token": {
37+
"apiToken": {
3838
"type": "string",
3939
"description": "Webflow API v2 bearer token for authentication. Can also be set via WEBFLOW_API_TOKEN environment variable.",
4040
"secret": true
4141
}
4242
},
4343
"inputProperties": {
44-
"token": {
44+
"apiToken": {
4545
"type": "string",
4646
"description": "Webflow API v2 bearer token for authentication. Can also be set via WEBFLOW_API_TOKEN environment variable.",
4747
"secret": true

provider/config.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import (
99
)
1010

1111
// Config defines the provider configuration.
12-
// The token field is marked as a secret and will be automatically handled by Pulumi.
12+
// The apiToken field is marked as a secret and will be automatically handled by Pulumi.
1313
type Config struct {
14-
// Token is the Webflow API v2 bearer token for authentication.
15-
// Can be set via `pulumi config set webflow:token <value> --secret` or WEBFLOW_API_TOKEN env var.
16-
Token string `pulumi:"token,optional" provider:"secret"`
14+
// ApiToken is the Webflow API v2 bearer token for authentication.
15+
// Can be set via `pulumi config set webflow:apiToken <value> --secret` or WEBFLOW_API_TOKEN env var.
16+
ApiToken string `pulumi:"apiToken,optional" provider:"secret"`
1717
}
1818

1919
// Annotate adds descriptions to the Config fields for schema generation.
2020
func (c *Config) Annotate(a infer.Annotator) {
21-
a.Describe(&c.Token, "Webflow API v2 bearer token for authentication. "+
21+
a.Describe(&c.ApiToken, "Webflow API v2 bearer token for authentication. "+
2222
"Can also be set via WEBFLOW_API_TOKEN environment variable.")
2323
}
2424

@@ -37,8 +37,8 @@ func GetHTTPClient(ctx context.Context, version string) (*http.Client, error) {
3737

3838
// Try to get token from config, fall back to environment variable
3939
token := ""
40-
if config != nil && config.Token != "" {
41-
token = config.Token
40+
if config != nil && config.ApiToken != "" {
41+
token = config.ApiToken
4242
} else {
4343
// Config not available or token empty, try environment variable
4444
token = getEnvToken()

provider/robotstxt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ func handleWebflowError(statusCode int, body []byte) error {
498498
"Your Webflow API token is invalid or has expired. " +
499499
"To fix this: 1) Verify your token in the Webflow dashboard (Settings > Integrations > API Access), " +
500500
"2) Ensure the token has 'site_config:read' and 'site_config:write' scopes, " +
501-
"3) Update your Pulumi config with: 'pulumi config set webflow:token <your-token> --secret'")
501+
"3) Update your Pulumi config with: 'pulumi config set webflow:apiToken <your-token> --secret'")
502502
case 403:
503503
return fmt.Errorf("forbidden: access denied to this resource. " +
504504
"Your API token does not have permission to access this Webflow site. " +

provider/site.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ func handleSiteError(statusCode int, body []byte) error {
679679
"Your Webflow API token is invalid or has expired. "+
680680
"To fix this: 1) Verify your token in the Webflow dashboard (Settings > Integrations > API Access), "+
681681
"2) Ensure the token has the required scopes for site management, "+
682-
"3) Update your Pulumi config with: 'pulumi config set webflow:token <your-token> --secret'")
682+
"3) Update your Pulumi config with: 'pulumi config set webflow:apiToken <your-token> --secret'")
683683
case 403:
684684
return fmt.Errorf("forbidden: access denied. "+
685685
"Your API token does not have permission to create/manage sites, OR your workspace is not an Enterprise workspace. "+

sdk/dotnet/Config/Config.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ public void Set(T value)
3232

3333
private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("webflow");
3434

35-
private static readonly __Value<string?> _token = new __Value<string?>(() => __config.Get("token"));
35+
private static readonly __Value<string?> _apiToken = new __Value<string?>(() => __config.Get("apiToken"));
3636
/// <summary>
3737
/// Webflow API v2 bearer token for authentication. Can also be set via WEBFLOW_API_TOKEN environment variable.
3838
/// </summary>
39-
public static string? Token
39+
public static string? ApiToken
4040
{
41-
get => _token.Get();
42-
set => _token.Set(value);
41+
get => _apiToken.Get();
42+
set => _apiToken.Set(value);
4343
}
4444

4545
}

sdk/dotnet/Provider.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public partial class Provider : global::Pulumi.ProviderResource
1616
/// <summary>
1717
/// Webflow API v2 bearer token for authentication. Can also be set via WEBFLOW_API_TOKEN environment variable.
1818
/// </summary>
19-
[Output("token")]
20-
public Output<string?> Token { get; private set; } = null!;
19+
[Output("apiToken")]
20+
public Output<string?> ApiToken { get; private set; } = null!;
2121

2222

2323
/// <summary>
@@ -39,7 +39,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
3939
Version = Utilities.Version,
4040
AdditionalSecretOutputs =
4141
{
42-
"token",
42+
"apiToken",
4343
},
4444
};
4545
var merged = CustomResourceOptions.Merge(defaultOptions, options);
@@ -51,19 +51,19 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
5151

5252
public sealed class ProviderArgs : global::Pulumi.ResourceArgs
5353
{
54-
[Input("token")]
55-
private Input<string>? _token;
54+
[Input("apiToken")]
55+
private Input<string>? _apiToken;
5656

5757
/// <summary>
5858
/// Webflow API v2 bearer token for authentication. Can also be set via WEBFLOW_API_TOKEN environment variable.
5959
/// </summary>
60-
public Input<string>? Token
60+
public Input<string>? ApiToken
6161
{
62-
get => _token;
62+
get => _apiToken;
6363
set
6464
{
6565
var emptySecret = Output.CreateSecret(0);
66-
_token = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
66+
_apiToken = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
6767
}
6868
}
6969

sdk/go/webflow/config/config.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)