Skip to content

Conversation

JarrettSpiker
Copy link
Contributor

Description

Feature not yet GA. Will move out of draft when the feature is released.

Adds UserTokensEnabled for Organizations.

This new HCP Terraform setting defaults to true. When disabled by an organization owner, user tokens will no longer be permitted to access the organization's resources through the API.

Testing plan

  1. Validate that the setting can be read from existing orgs
  2. Test creating orgs with the setting enabled/disabled
  3. Test updating an org to enable/disable the setting
  4. Validate that the setting is not included in update request serialization if not specified

External links

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

/usr/local/bin/go test -timeout 3000s -run ^TestOrganizationsUpdate$ github.com/hashicorp/go-tfe

=== RUN   TestOrganizationsUpdate
=== RUN   TestOrganizationsUpdate/with_HCP_Terraform-only_options
--- PASS: TestOrganizationsUpdate/with_HCP_Terraform-only_options (2.83s)
=== RUN   TestOrganizationsUpdate/with_new_AggregatedCommitStatusEnabled_option
--- PASS: TestOrganizationsUpdate/with_new_AggregatedCommitStatusEnabled_option (5.25s)
=== RUN   TestOrganizationsUpdate/with_new_SpeculativePlanManagementEnabled_option
--- PASS: TestOrganizationsUpdate/with_new_SpeculativePlanManagementEnabled_option (3.65s)
=== RUN   TestOrganizationsUpdate/with_new_UserTokensEnabled_option
--- PASS: TestOrganizationsUpdate/with_new_UserTokensEnabled_option (5.66s)
=== RUN   TestOrganizationsUpdate/with_valid_options
--- PASS: TestOrganizationsUpdate/with_valid_options (3.72s)
=== RUN   TestOrganizationsUpdate/with_invalid_name
--- PASS: TestOrganizationsUpdate/with_invalid_name (0.00s)
=== RUN   TestOrganizationsUpdate/with_agent_pool_provided,_but_remote_execution_mode
--- PASS: TestOrganizationsUpdate/with_agent_pool_provided,_but_remote_execution_mode (3.75s)
=== RUN   TestOrganizationsUpdate/when_only_updating_a_subset_of_fields
--- PASS: TestOrganizationsUpdate/when_only_updating_a_subset_of_fields (2.16s)
=== RUN   TestOrganizationsUpdate/with_different_default_execution_modes
--- PASS: TestOrganizationsUpdate/with_different_default_execution_modes (3.93s)
--- PASS: TestOrganizationsUpdate (31.59s)
PASS
ok      github.com/hashicorp/go-tfe
...

Rollback Plan

If we need to revert this change before a go-tfe release, we will.

Changes to Security Controls

no

@JarrettSpiker JarrettSpiker requested a review from a team as a code owner September 23, 2025 21:33
@JarrettSpiker JarrettSpiker marked this pull request as draft September 23, 2025 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant