Skip to content

Add support for duplicating APIs, Roles, and Keys#435

Merged
thekevinm merged 8 commits intodevelopfrom
claude-duplicate-task-feature
Aug 8, 2025
Merged

Add support for duplicating APIs, Roles, and Keys#435
thekevinm merged 8 commits intodevelopfrom
claude-duplicate-task-feature

Conversation

@thekevinm
Copy link
Copy Markdown
Contributor

In an effort to streamline creation of APIs, Roles, and Keys, we've added the ability to duplicate already configured services to remove the mundane tasks of reconfiguring them.

There is now an ellipses on the far right that gives the user the option to duplicate the API, Role, or Key and are prompted to provide a new name for it to avoid conflicts.

When duplicated they are inactive by default and the duplicated database APIs will not have the password because it's encrypted for security.

thekevinm and others added 8 commits July 31, 2025 07:00
…copy all configurations

- Fixed API request format by wrapping payloads in { resource: [data] } as expected by backend
- Updated role duplication to copy all permissions (role_service_access_by_role_id) and lookup keys (lookup_by_role_id)
- Updated service duplication to copy entire config object with all service-specific settings
- Updated app duplication to copy all app configurations including type, url, storage settings, etc.
- Added proper error handling with catchError and throwError for all API calls
- Use snake_case for API fields (is_active, role_id, api_key, etc.)
- Apps generate new API keys when duplicated
- All duplicate operations show appropriate success messages

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed role duplication not copying permissions:
  - Changed from snake_case to camelCase field names (roleServiceAccessByRoleId, lookupByRoleId, isActive)
  - Fixed permission field mapping to use camelCase (serviceId, verbMask, requestorMask)
  - Fixed filters structure to match API format with name/operator/value
  - Added fields and related parameters to the create request

- Fixed app duplication not working:
  - Removed api_key from payload (API keys are generated server-side)
  - Removed unnecessary async/await for API key generation
  - Fixed refresh API key action to use snake_case api_key

Both issues were caused by API field naming convention mismatches. The DreamFactory API expects camelCase for roles and snake_case for apps.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@thekevinm thekevinm requested a review from VladyslavTy August 5, 2025 22:20
@thekevinm thekevinm merged commit 91e4ae4 into develop Aug 8, 2025
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.

2 participants