这是indexloc提供的服务,不要输入任何密码
Skip to content

Remove OIDC enabled property #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion client/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type GitRepository struct {
}

type OIDCTokenConfig struct {
Enabled bool `json:"enabled"`
IssuerMode string `json:"issuerMode,omitempty"`
}

Expand Down
4 changes: 0 additions & 4 deletions docs/data-sources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ Optional:

- `issuer_mode` (String) Configures the URL of the `iss` claim. `team` = `https://oidc.vercel.com/[team_slug]` `global` = `https://oidc.vercel.com`

Read-Only:

- `enabled` (Boolean) When true, Vercel issued OpenID Connect (OIDC) tokens will be available on the compute environments. See https://vercel.com/docs/security/secure-backend-access/oidc for more information.


<a id="nestedatt--options_allowlist"></a>
### Nested Schema for `options_allowlist`
Expand Down
4 changes: 0 additions & 4 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ Read-Only:
<a id="nestedatt--oidc_token_config"></a>
### Nested Schema for `oidc_token_config`

Required:

- `enabled` (Boolean) When true, Vercel issued OpenID Connect (OIDC) tokens will be available on the compute environments. See https://vercel.com/docs/security/secure-backend-access/oidc for more information.

Optional:

- `issuer_mode` (String) Configures the URL of the `iss` claim. `team` = `https://oidc.vercel.com/[team_slug]` `global` = `https://oidc.vercel.com`
Expand Down
4 changes: 0 additions & 4 deletions vercel/data_source_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,6 @@ For more detailed information, please see the [Vercel documentation](https://ver
Description: "Configuration for OpenID Connect (OIDC) tokens.",
Computed: true,
Attributes: map[string]schema.Attribute{
"enabled": schema.BoolAttribute{
Description: "When true, Vercel issued OpenID Connect (OIDC) tokens will be available on the compute environments. See https://vercel.com/docs/security/secure-backend-access/oidc for more information.",
Computed: true,
},
"issuer_mode": schema.StringAttribute{
Description: "Configures the URL of the `iss` claim. `team` = `https://oidc.vercel.com/[team_slug]` `global` = `https://oidc.vercel.com`",
Computed: true,
Expand Down
2 changes: 0 additions & 2 deletions vercel/data_source_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func TestAcc_ProjectDataSource(t *testing.T) {
resource.TestCheckResourceAttr("data.vercel_project.test", "skew_protection", "7 days"),
resource.TestCheckResourceAttr("data.vercel_project.test", "resource_config.function_default_cpu_type", "standard_legacy"),
resource.TestCheckResourceAttr("data.vercel_project.test", "resource_config.function_default_timeout", "30"),
resource.TestCheckResourceAttr("data.vercel_project.test", "oidc_token_config.enabled", "true"),
resource.TestCheckResourceAttr("data.vercel_project.test", "oidc_token_config.issuer_mode", "team"),
resource.TestCheckResourceAttr("data.vercel_project.test", "on_demand_concurrent_builds", "true"),
),
Expand Down Expand Up @@ -137,7 +136,6 @@ resource "vercel_project" "test" {
fluid = false
}
oidc_token_config = {
enabled = true
issuer_mode = "team"
}
on_demand_concurrent_builds = true
Expand Down
14 changes: 1 addition & 13 deletions vercel/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,6 @@ At this time you cannot use a Vercel Project resource with in-line ` + "`environ
Optional: true,
Computed: true,
Attributes: map[string]schema.Attribute{
"enabled": schema.BoolAttribute{
Description: "When true, Vercel issued OpenID Connect (OIDC) tokens will be available on the compute environments. See https://vercel.com/docs/security/secure-backend-access/oidc for more information.",
Required: true,
},
"issuer_mode": schema.StringAttribute{
Optional: true,
Computed: true,
Expand All @@ -373,12 +369,10 @@ At this time you cannot use a Vercel Project resource with in-line ` + "`environ
},
Default: objectdefault.StaticValue(types.ObjectValueMust(
map[string]attr.Type{
"enabled": types.BoolType,
"issuer_mode": types.StringType,
},
map[string]attr.Value{
"enabled": types.BoolValue(false),
"issuer_mode": types.StringValue("global"),
"issuer_mode": types.StringValue("team"),
},
)),
},
Expand Down Expand Up @@ -1032,7 +1026,6 @@ func (t *TrustedIps) toUpdateProjectRequest() *client.TrustedIps {
}

type OIDCTokenConfig struct {
Enabled types.Bool `tfsdk:"enabled"`
IssuerMode types.String `tfsdk:"issuer_mode"`
}

Expand All @@ -1042,21 +1035,18 @@ func (o *OIDCTokenConfig) toCreateProjectRequest() *client.OIDCTokenConfig {
}

return &client.OIDCTokenConfig{
Enabled: o.Enabled.ValueBool(),
IssuerMode: o.IssuerMode.ValueString(),
}
}

func (o *OIDCTokenConfig) toUpdateProjectRequest() *client.OIDCTokenConfig {
if o == nil {
return &client.OIDCTokenConfig{
Enabled: types.BoolValue(false).ValueBool(),
IssuerMode: types.StringValue("global").ValueString(),
}
}

return &client.OIDCTokenConfig{
Enabled: o.Enabled.ValueBool(),
IssuerMode: o.IssuerMode.ValueString(),
}
}
Expand Down Expand Up @@ -1310,11 +1300,9 @@ func convertResponseToProject(ctx context.Context, response client.ProjectRespon
}

var oidcTokenConfig = &OIDCTokenConfig{
Enabled: types.BoolValue(false),
IssuerMode: types.StringValue("global"),
}
if response.OIDCTokenConfig != nil {
oidcTokenConfig.Enabled = types.BoolValue(response.OIDCTokenConfig.Enabled)
oidcTokenConfig.IssuerMode = types.StringValue(response.OIDCTokenConfig.IssuerMode)
}

Expand Down
3 changes: 0 additions & 3 deletions vercel/resource_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func TestAcc_Project(t *testing.T) {
resource.TestCheckResourceAttr("vercel_project.test", "prioritise_production_builds", "true"),
resource.TestCheckResourceAttr("vercel_project.test", "directory_listing", "true"),
resource.TestCheckResourceAttr("vercel_project.test", "skew_protection", "7 days"),
resource.TestCheckResourceAttr("vercel_project.test", "oidc_token_config.enabled", "true"),
resource.TestCheckResourceAttr("vercel_project.test", "oidc_token_config.issuer_mode", "team"),
resource.TestCheckResourceAttr("vercel_project.test", "resource_config.function_default_cpu_type", "standard"),
resource.TestCheckResourceAttr("vercel_project.test", "resource_config.function_default_timeout", "60"),
Expand All @@ -95,7 +94,6 @@ func TestAcc_Project(t *testing.T) {
"key": "bar",
"value": "baz",
}),
resource.TestCheckResourceAttr("vercel_project.test", "oidc_token_config.enabled", "false"),
resource.TestCheckResourceAttr("vercel_project.test", "preview_comments", "false"),
resource.TestCheckResourceAttr("vercel_project.test", "enable_preview_feedback", "false"),
resource.TestCheckResourceAttr("vercel_project.test", "enable_production_feedback", "true"),
Expand Down Expand Up @@ -1020,7 +1018,6 @@ resource "vercel_project" "test" {
directory_listing = true
skew_protection = "7 days"
oidc_token_config = {
enabled = true
issuer_mode = "team"
}
resource_config = {
Expand Down
Loading