Add support for Roles resource type #49
Draft
RovinKYK wants to merge 19 commits intowso2-extensions:masterfrom
Draft
Add support for Roles resource type #49RovinKYK wants to merge 19 commits intowso2-extensions:masterfrom
RovinKYK wants to merge 19 commits intowso2-extensions:masterfrom
Conversation
…existing resource management APIs
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive support for two new resource types: OIDC Scopes and Roles to the IAM-CTL tool. The PR refactors the resource handling architecture to use strongly-typed ResourceType constants and introduces new serialization utilities to support multiple file formats (YAML, JSON, XML). Additionally, it establishes infrastructure for future resource reference handling and dependency management.
Changes:
- Added OIDC Scopes and Roles as new manageable resource types with full CRUD operations
- Introduced serialization/deserialization utilities supporting YAML, JSON, and XML formats
- Refactored resource type handling from strings to strongly-typed constants
- Added infrastructure for resource reference tracking and resolution (currently unused)
Reviewed changes
Copilot reviewed 37 out of 38 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| iamctl/pkg/roles/export.go | Implements export functionality for roles using GET requests and SCIM2 API |
| iamctl/pkg/roles/import.go | Implements import/update functionality for roles using POST/PATCH requests |
| iamctl/pkg/roles/rolesUtils.go | Utility functions for role operations including name escaping and permission patch handling |
| iamctl/pkg/oidcScopes/export.go | Implements export functionality for OIDC scopes |
| iamctl/pkg/oidcScopes/import.go | Implements import/update functionality for OIDC scopes using POST/PUT requests |
| iamctl/pkg/oidcScopes/oidcScopeUtils.go | Utility functions for OIDC scope operations |
| iamctl/pkg/utils/serializationUtils.go | New file providing format-agnostic serialization/deserialization with XML support |
| iamctl/pkg/utils/resourceReferenceUtils.go | New file providing infrastructure for resource reference tracking (currently unused) |
| iamctl/pkg/utils/resourceOrder.go | Defines processing order for resources based on dependencies |
| iamctl/pkg/utils/constants.go | Adds ResourceType as strongly-typed constant, Format types, and metadata structures |
| iamctl/pkg/utils/apiUtils.go | Adds GET, POST, PUT, PATCH HTTP methods and updates URL building for SCIM2 |
| iamctl/pkg/utils/keywordUtils.go | Refactors to use Format types and adds getRawValue/ReplaceRawValue functions |
| iamctl/pkg/utils/summaryUtils.go | Updates to use ResourceType instead of string |
| iamctl/pkg/utils/resourceProperties.go | Adds String() method for ResourceType conversion |
| iamctl/pkg/utils/setup.go | Adds config structures for OIDC scopes and roles |
| iamctl/pkg/utils/init.go | Adds required OAuth scopes for OIDC scope and role management APIs |
| iamctl/tests/*.go | Comprehensive unit tests for serialization and resource reference utilities |
| iamctl/cmd/cli/exportAll.go | Refactored to use resource order with new resource types |
| iamctl/cmd/cli/importAll.go | Refactored to use resource order with new resource types |
| iamctl/go.mod | Adds mxj/v2 for XML handling, upgrades yaml.v2 to yaml.v3 |
| iamctl/go.sum | Updates dependencies |
| README.md | Documents OIDC Scopes in supported resource types list |
| docs/cli-mode.md | Documents OIDC Scopes and updates configuration examples |
| Various import/export files | Updates yaml imports from v2 to v3, fixes "retrieved" typo, uses ResourceType.String() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Add support for Role management in the IAM-CTL tool to enable export and import of system and application roles between Identity Server environments.
Related to https://github.com/wso2-enterprise/iam-product-management/issues/662
Goals
Enable users to:
Approach
pkg/rolespackage following existing resource type patternsexportAllandimportAllCLI commandsUser Stories
As a system administrator, I want to export and import system and application roles across environments to enable version control and maintain consistent IAM configurations.
Release Note
Added Role management support to IAM-CTL tool.
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning