Skip to content

feat(jwt-templates): add permission, subject, and jti claim configuratio#242

Merged
shilgapira merged 7 commits intomainfrom
shuni/task-20260211121654
Feb 19, 2026
Merged

feat(jwt-templates): add permission, subject, and jti claim configuratio#242
shilgapira merged 7 commits intomainfrom
shuni/task-20260211121654

Conversation

@aviadl
Copy link
Member

@aviadl aviadl commented Feb 11, 2026

Fixes descope/etc#14107

View workflow run

Perfect! All tasks are completed. Let me create a summary of what was done:

Summary

I've successfully added the three missing JWT template configuration options to the Descope Terraform provider:

Changes Made

  1. New JWT Template Attributes (in internal/models/project/jwttemplates/jwttemplate.go):

    • exclude_permission_claim (Boolean) - Excludes the permissions claim from JWT tokens
    • override_subject_claim (String) - Overrides the standard sub claim with a custom value
    • add_jti_claim (Boolean) - Adds a jti (JWT ID) claim for uniqueness tracking
  2. Updated Model Structure:

    • Added fields to JWTTemplateModel struct
    • Updated Values() method to serialize new fields (using camelCase for API: excludePermissionClaim, overrideSubjectClaim, addJtiClaim)
    • Updated SetValues() method to deserialize new fields from API responses
  3. Documentation:

    • Added descriptive documentation strings in internal/docs/docs.go
    • Regenerated Terraform registry documentation in docs/resources/project.md
  4. Tests:

    • Updated test cases in internal/models/project/jwttemplates/jwttemplates_test.go to include the new attributes
    • All existing tests pass
  5. Verification:

    • Code compiles successfully
    • Unit tests pass
    • Generated documentation includes the new fields

Commit Details

Created commit 8d0cd03 with message:

feat: add JWT template config options for permissions, subject, and JTI claims

The changes are now ready. The GitHub Actions workflow will handle pushing and creating the PR as per your configuration.


Created by Shuni 🐕

…TI claims

Add three new configuration options to JWT templates:
- exclude_permission_claim: Boolean to exclude permissions claim from JWT
- override_subject_claim: String to override the standard sub claim
- add_jti_claim: Boolean to add JTI (JWT ID) claim for uniqueness tracking

These options were missing from the Terraform provider but are available
in the Descope console UI. This change adds support for:
- Excluding the permission claim from JWT tokens
- Overriding the subject claim with a custom value
- Adding a JTI claim to JWT tokens

Updated files:
- JWT template model with new attributes and serialization
- Documentation strings for the new fields
- Test cases to verify the new attributes
- Generated Terraform registry documentation
Copilot AI review requested due to automatic review settings February 11, 2026 12:24
Copy link

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 missing JWT template configuration options to the Terraform provider so users can control permission, subject, and JTI claim behavior.

Changes:

  • Extends JWT template schema/model with exclude_permission_claim, override_subject_claim, and add_jti_claim.
  • Serializes/deserializes the new fields to/from API payloads.
  • Regenerates docs and updates JWT template tests accordingly.

Reviewed changes

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

File Description
internal/models/project/jwttemplates/jwttemplates_test.go Adds assertions/config for the three new JWT template attributes.
internal/models/project/jwttemplates/jwttemplate.go Adds schema + model fields and maps them in Values() / SetValues().
internal/docs/docs.go Adds documentation strings for the new JWT template attributes.
docs/resources/project.md Updates generated registry docs to include the new JWT template fields (but also removes unrelated connector-auth doc details).

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

@descope descope deleted a comment from Copilot AI Feb 11, 2026
@aviadl
Copy link
Member Author

aviadl commented Feb 11, 2026

@shuni please see my comments

@shuni-bot
Copy link

shuni-bot bot commented Feb 11, 2026

🐕 Done! Updated PR: #242

View workflow run

📋 Actions Taken

✅ Fix override_subject_claim to be boolean instead of string
✅ Add conditional serialization for override_subject_claim in Values()
✅ Update tests for boolean override_subject_claim
✅ Regenerate documentation
✅ Reply to PR threads explaining the changes
✅ Run tests and commit changes

aviadl and others added 4 commits February 11, 2026 15:07
Change override_subject_claim from string to boolean in JWT template
configuration based on PR review feedback. This attribute should be a
toggle to enable/disable the override feature, not a string value.

Changes:
- Changed attribute type from stringattr.Default("") to boolattr.Default(false)
- Updated model field type from stringattr.Type to boolattr.Type
- Updated Values() and SetValues() methods to use boolattr functions
- Updated test cases to use boolean value (true instead of "custom-sub")
- Updated documentation strings and generated docs
@aviadl aviadl requested a review from shilgapira February 12, 2026 16:26
@aviadl aviadl enabled auto-merge (squash) February 12, 2026 16:26
@shilgapira shilgapira disabled auto-merge February 19, 2026 13:25
@shilgapira shilgapira merged commit f6b9657 into main Feb 19, 2026
13 checks passed
@shilgapira shilgapira deleted the shuni/task-20260211121654 branch February 19, 2026 13:27
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.

3 participants