Skip to content

Adds AdminSCIMToken to Manage SCIM Tokens#1310

Merged
skj-skj merged 21 commits intomainfrom
skj/scim-token
Apr 20, 2026
Merged

Adds AdminSCIMToken to Manage SCIM Tokens#1310
skj-skj merged 21 commits intomainfrom
skj/scim-token

Conversation

@skj-skj
Copy link
Copy Markdown
Contributor

@skj-skj skj-skj commented Apr 16, 2026

Description

This PR adds support for site-level SCIM Token via admin_setting_scim_token.go resource. It also includes integration tests, supporting helper functions, and generated mocks for the new resource.

it also does cleanup in admin_setting_scim_integration_test.go related to generating scim token

Testing plan

  1. Adds integration test for Create, List, Read and Delete for Admin SCIM Tokens

External links

JIRA
RFC

Output from tests

ENABLE_TFE=1 envchain scim gotest -v -run "TestAdminSettings_SCIM_(Read|Update|Delete)"
image

ENABLE_TFE=1 envchain scim gotest -v -run "TestAdminSCIMTokens_(Create|List|Read|Delete)"
image

Rollback Plan

we can revert this pr

Changes to Security Controls

NA

@skj-skj skj-skj changed the title adds support for Admin Scim Tokens, adds integration tests, cleanup i… Adds AdminSCIMToken to Manage SCIM Tokens Apr 16, 2026
@datadog-terraform-cloud-hashicorp
Copy link
Copy Markdown

datadog-terraform-cloud-hashicorp bot commented Apr 16, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: fa12b41 | Docs | Was this helpful? Give us feedback!

@skj-skj skj-skj marked this pull request as ready for review April 16, 2026 09:44
@skj-skj skj-skj requested a review from a team as a code owner April 16, 2026 09:44
@skj-skj skj-skj requested a review from Copilot April 16, 2026 09:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new admin SCIM token resource to the Go TFE client, wiring it under the existing admin SCIM settings surface area and providing integration test coverage for the new endpoints.

Changes:

  • Introduces AdminSCIMTokens client (List, Create, CreateWithOptions, ReadByID, Delete) and wires it under client.Admin.Settings.SCIM.Token.
  • Adds integration tests for SCIM token CRUD flows and refactors existing SCIM setting tests to use the new token client.
  • Adds a generic Ptr[T] helper and generated gomock mocks + mock generation script update.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
admin_setting_scim_token.go Implements the admin SCIM token client and types.
admin_setting.go Nests SCIM token management under Admin.Settings.SCIM.Token via SCIMResource.
admin_setting_scim_token_integration_test.go Adds integration tests for create/list/read/delete SCIM tokens.
admin_setting_scim_integration_test.go Removes bespoke token creation helper and uses new SCIM token client.
helper_test.go Adds enableSCIM helper used by SCIM token integration tests.
type_helpers.go Adds generic Ptr[T] helper for pointer options (e.g., *time.Time).
mocks/admin_setting_scim_token_mocks.go Adds generated gomock for the new AdminSCIMTokens interface.
generate_mocks.sh Includes SCIM token mock generation.
CHANGELOG.md Documents the new AdminSCIMToken support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread admin_setting_scim_token.go
Comment thread admin_setting_scim_token_integration_test.go Outdated
Comment thread admin_setting_scim_token_integration_test.go
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds site-level SCIM token management to the Admin Settings area of the go-tfe client, including new client APIs, mocks, and Enterprise integration tests, plus cleanup of prior ad-hoc SCIM token creation in tests.

Changes:

  • Introduces AdminSCIMTokens client with Create, List, ReadByID, and Delete operations.
  • Updates AdminSettings SCIM wiring to expose a Token sub-resource and adds Enterprise integration tests for SCIM tokens.
  • Adds a generic Ptr[T] helper and updates mock generation + changelog.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
type_helpers.go Adds generic Ptr[T] helper for pointer creation.
admin_setting.go Refactors SCIM settings into a grouped SCIMResource and wires in SCIM token client.
admin_setting_scim_token.go Implements the new Admin SCIM token client API and types.
admin_setting_scim_token_integration_test.go Adds integration tests for SCIM token CRUD behaviors.
admin_setting_scim_integration_test.go Replaces custom SCIM token generation with the new client API.
helper_test.go Adds enableSCIM helper for Enterprise integration tests.
generate_mocks.sh Adds mockgen target for the new SCIM token interface.
mocks/admin_setting_scim_token_mocks.go Generated GoMock for AdminSCIMTokens.
CHANGELOG.md Documents the new Admin SCIM token support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread admin_setting_scim_token.go
Comment thread admin_setting_scim_token_integration_test.go Outdated
Comment thread admin_setting_scim_token_integration_test.go
Comment thread admin_setting_scim_token_integration_test.go Outdated
Comment thread admin_setting_scim_integration_test.go
Comment thread admin_setting.go
Comment thread admin_setting_scim_token_integration_test.go
Comment thread admin_setting_scim_token_integration_test.go
Comment thread admin_setting_scim_token.go Outdated
Comment thread admin_setting_scim_token.go Outdated
skj-skj and others added 3 commits April 16, 2026 16:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new site-level Admin SCIM Token client/resource and related integration test coverage, and wires the SCIM token resource under the admin settings SCIM namespace.

Changes:

  • Introduces AdminSCIMTokens resource (List/Create/Read/Delete) and integrates it under client.Admin.Settings.SCIM.Token.
  • Adds integration tests for Admin SCIM token CRUD and refactors existing SCIM settings integration test token creation to use the new API.
  • Adds supporting utilities (generic Ptr helper), mock generation wiring, and a generated mock; updates CHANGELOG.md.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
admin_setting_scim_token.go Adds the new Admin SCIM token client/resource and API types.
admin_setting.go Nests SCIM settings + tokens under a new SCIMResource grouping (Settings.SCIM.Token).
admin_setting_scim_token_integration_test.go Adds integration coverage for Admin SCIM token create/list/read/delete.
admin_setting_scim_integration_test.go Switches SCIM settings tests to create SCIM tokens via the new resource.
helper_test.go Adds a shared enableSCIM helper used by the new integration tests.
type_helpers.go Adds a generic Ptr[T] helper for pointer options.
generate_mocks.sh Registers mockgen invocation for the new SCIM token resource.
mocks/admin_setting_scim_token_mocks.go Adds generated gomock for the new resource (needs regeneration to match interface).
CHANGELOG.md Documents the new enhancement entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mocks/admin_setting_scim_token_mocks.go Outdated
Comment thread admin_setting_scim_token.go Outdated
Comment thread admin_setting_scim_token.go Outdated
Comment thread admin_setting_scim_integration_test.go
skj-skj and others added 2 commits April 16, 2026 17:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Admin Settings sub-resource for managing site-level SCIM tokens in the go-tfe client, along with integration test coverage and supporting test/mocking utilities.

Changes:

  • Introduces AdminSCIMTokens API client (List, Create, CreateWithOptions, Read, Delete) for admin/scim-tokens.
  • Groups SCIM-related admin settings under a new SCIMResource to expose both SCIM settings and SCIM token operations.
  • Adds/updates integration tests and helpers, plus generated mocks and changelog entry.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
admin_setting.go Restructures AdminSettings.SCIM to group SCIM settings + token client under SCIMResource.
admin_setting_scim_token.go Adds the new SCIM token resource client and related types/options.
admin_setting_scim_token_integration_test.go Adds integration tests for SCIM token create/list/read/delete behavior.
admin_setting_scim_integration_test.go Updates SCIM settings integration tests to use the new SCIM token client instead of a bespoke request helper.
helper_test.go Adds enableSCIM helper to consistently enable/disable SCIM for tests.
type_helpers.go Adds a generic Ptr[T] helper for pointer construction in options.
generate_mocks.sh Includes mock generation for the new SCIM token interface.
mocks/admin_setting_scim_token_mocks.go Adds generated GoMock mocks for AdminSCIMTokens.
CHANGELOG.md Documents the new AdminSCIMToken functionality.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread admin_setting_scim_token_integration_test.go
Comment thread admin_setting.go
skj-skj and others added 2 commits April 16, 2026 17:21
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Admin API surface for managing site-level SCIM tokens and wires it into the existing admin settings client, along with integration coverage and supporting helpers/mocks.

Changes:

  • Introduces AdminSCIMTokens client/resource (List, Create, CreateWithOptions, Read, Delete) and groups it under Admin.Settings.SCIM.Tokens.
  • Adds integration tests for SCIM token lifecycle and refactors existing SCIM settings integration test to use the new token API.
  • Adds a generic Ptr helper and updates mock generation to include the new resource.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
type_helpers.go Adds a generic Ptr[T](*T) helper for tests/options.
mocks/admin_setting_scim_token_mocks.go Generated GoMock for AdminSCIMTokens.
helper_test.go Adds enableSCIM helper to set up/tear down SCIM + required SAML pre-reqs in tests.
generate_mocks.sh Includes SCIM token resource in mock generation script.
admin_setting_scim_token_integration_test.go New integration tests for create/list/read/delete of admin SCIM tokens.
admin_setting_scim_token.go Implements the new Admin SCIM token API client and types.
admin_setting_scim_integration_test.go Replaces manual SCIM token generation with the new Tokens.Create API.
admin_setting.go Restructures AdminSettings.SCIM to group settings + tokens under a single resource.
CHANGELOG.md Documents the new Admin SCIM token support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread admin_setting_scim_token.go Outdated
Comment thread admin_setting_scim_token_integration_test.go Outdated
Comment thread admin_setting_scim_token.go
Comment thread admin_setting_scim_token.go Outdated
Comment thread admin_setting_scim_token.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Admin SCIM token client/resource to the tfe package so callers can manage site-level SCIM tokens through the Go client, along with integration tests and supporting helpers/mocks.

Changes:

  • Introduces AdminSCIMTokens (admin_setting_scim_token.go) with List, Create, CreateWithOptions, Read, and Delete.
  • Restructures AdminSettings.SCIM into a grouped SCIMResource that exposes both SCIM settings and SCIM tokens.
  • Adds integration tests + helpers and updates existing SCIM integration tests to use the new token API; adds generated mocks and updates mock generation script.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
admin_setting_scim_token.go New Admin SCIM token resource (CRUD-ish client methods + types).
admin_setting.go Groups SCIM settings + tokens under SCIMResource and wires it into AdminSettings.
admin_setting_scim_token_integration_test.go New integration coverage for create/list/read/delete for Admin SCIM tokens.
helper_test.go Adds enableSCIM helper used by SCIM token integration tests.
admin_setting_scim_integration_test.go Replaces custom SCIM token generation with new scimClient.Tokens.Create.
type_helpers.go Adds generic Ptr[T] helper for pointer options (used by tests).
mocks/admin_setting_scim_token_mocks.go Generated GoMock for the new AdminSCIMTokens interface.
generate_mocks.sh Includes SCIM token mock in mock generation script.
CHANGELOG.md Documents the enhancement (Admin SCIM token support).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread admin_setting_scim_token.go Outdated
Comment thread admin_setting_scim_token.go Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Admin SCIM Tokens resource to the go-tfe admin settings surface so callers can create/list/read/delete site-level SCIM tokens, and updates integration tests/helpers accordingly.

Changes:

  • Introduces AdminSCIMTokens client/resource (admin_setting_scim_token.go) and wires it under client.Admin.Settings.SCIM.Tokens.
  • Adds integration tests for Admin SCIM token Create, List, Read, and Delete.
  • Refactors SCIM integration tests to use the new token API; adds a generic Ptr[T] helper and generated mocks.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
type_helpers.go Adds generic Ptr[T] helper to simplify pointer option construction (used by new tests/options).
admin_setting.go Groups SCIM settings + tokens under SCIMResource (AdminSettings.SCIM now exposes .Tokens).
admin_setting_scim_token.go Implements the Admin SCIM token API client (list/create/read/delete) and types/options.
admin_setting_scim_token_integration_test.go Adds integration coverage for Admin SCIM token lifecycle operations and option behaviors.
admin_setting_scim_integration_test.go Updates SCIM settings integration test to create a SCIM token via the new API (removes raw request helper).
helper_test.go Adds enableSCIM helper to consistently enable/disable SCIM in integration tests.
mocks/admin_setting_scim_token_mocks.go Adds generated GoMock for the new AdminSCIMTokens interface.
generate_mocks.sh Adds mock generation entry for admin_setting_scim_token.go.
CHANGELOG.md Documents the new AdminSCIMToken enhancement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread admin_setting_scim_token.go Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Terraform Enterprise admin client resource for managing site-level SCIM tokens (AdminSCIMTokens), wires it into AdminSettings.SCIM, and adds integration coverage for token CRUD operations.

Changes:

  • Introduces admin_setting_scim_token.go implementing AdminSCIMTokens (List/Create/CreateWithOptions/Read/Delete).
  • Restructures AdminSettings.SCIM into a grouped SCIMResource that exposes both SCIM settings and SCIM tokens.
  • Adds SCIM token integration tests, updates existing SCIM settings integration test to use the new token API, and updates mocks/helpers/changelog.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
type_helpers.go Adds a generic Ptr[T] helper for pointer creation (used by new SCIM token options/tests).
mocks/admin_setting_scim_token_mocks.go Adds generated GoMock stubs for the new AdminSCIMTokens interface.
helper_test.go Adds enableSCIM helper to toggle SCIM prerequisites in integration tests.
generate_mocks.sh Adds mock generation entry for admin_setting_scim_token.go.
admin_setting_scim_token_integration_test.go New integration tests for Admin SCIM token Create/List/Read/Delete flows.
admin_setting_scim_token.go New admin SCIM token client resource implementation and types.
admin_setting_scim_integration_test.go Updates SCIM settings integration test to create tokens via the new API.
admin_setting.go Introduces SCIMResource and updates AdminSettings.SCIM to expose settings + tokens.
CHANGELOG.md Adds enhancement entry for AdminSCIMToken support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread admin_setting_scim_token.go
Comment thread admin_setting_scim_token_integration_test.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Admin SCIM Tokens resource to the go-tfe admin settings surface so site admins can create/list/read/delete site-level SCIM tokens, and updates integration tests/mocks accordingly.

Changes:

  • Introduces AdminSCIMTokens client/resource (admin_setting_scim_token.go) and exposes it via client.Admin.Settings.SCIM.Tokens.
  • Adds integration coverage for Admin SCIM token Create/List/Read/Delete and refactors SCIM test token generation to use the new client.
  • Adds a generic Ptr[T] helper and generates new GoMock mocks + mockgen script entry.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
type_helpers.go Adds generic Ptr[T any] helper for pointer values (used by SCIM token tests/options).
mocks/admin_setting_scim_token_mocks.go Generated GoMock mocks for the new AdminSCIMTokens interface.
helper_test.go Adds enableSCIM test helper to enable/disable SCIM (and required SAML prerequisites).
generate_mocks.sh Includes mock generation for admin_setting_scim_token.go.
admin_setting_scim_token_integration_test.go Adds integration tests for Admin SCIM Tokens Create/List/Read/Delete.
admin_setting_scim_token.go Implements Admin SCIM Tokens API client/resource.
admin_setting_scim_integration_test.go Refactors SCIM integration test token creation to use scimClient.Tokens.Create.
admin_setting.go Restructures AdminSettings.SCIM to group SCIM settings + tokens under SCIMResource.
CHANGELOG.md Documents the new Admin SCIM token support enhancement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread admin_setting_scim_token.go
Maed223
Maed223 previously approved these changes Apr 16, 2026
Copy link
Copy Markdown
Contributor

@Maed223 Maed223 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, glad we were able to get this in while the SCIMSettings is unreleased to we can have that SCIMResource interface without a breaking change.

Comment thread admin_setting_scim_token.go Outdated
Comment thread admin_setting_scim_token.go Outdated
@skj-skj skj-skj requested review from Maed223 and kkavish April 17, 2026 13:32
Comment thread const.go Outdated
@skj-skj skj-skj requested a review from kkavish April 17, 2026 13:46
Copy link
Copy Markdown

@kkavish kkavish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@skj-skj skj-skj merged commit dcf2c7c into main Apr 20, 2026
26 of 37 checks passed
@skj-skj skj-skj deleted the skj/scim-token branch April 20, 2026 06:37
@github-actions
Copy link
Copy Markdown

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

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.

4 participants