Skip to content

Fix service-user PAT role restriction - #145

Open
c1-squire-dev[bot] wants to merge 1 commit into
santhosh.kumar/credential-issuancefrom
c1-squire-dev/IGA-3962-role-restriction
Open

Fix service-user PAT role restriction#145
c1-squire-dev[bot] wants to merge 1 commit into
santhosh.kumar/credential-issuancefrom
c1-squire-dev/IGA-3962-role-restriction

Conversation

@c1-squire-dev

@c1-squire-dev c1-squire-dev Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Squire (openai/gpt-5.6-terra): This follows the credential-issuance work with the missing service-user PAT restriction. Snowflake documents that ROLE_RESTRICTION is required by default for SERVICE, SERVICE_AGENT, and LEGACY_SERVICE users; the role must be granted to the user.

This change reads the target user, selects its configured default role, verifies that role is actually granted, and sets ROLE_RESTRICTION on the PAT. It fails before token creation when no suitable role exists. It also adds the CredentialIssuerV2 compile-time assertion and mock-harness coverage for the success and failure paths.

Primary source: Snowflake programmatic access token documentation.

Validation: go build ./...; go test ./pkg/....

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@linear-code

linear-code Bot commented Aug 19, 2026

Copy link
Copy Markdown

IGA-3962

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