IAV-446/Add credential data retrieval, OAuth token refresh, and execution error endpoints
Summary
This MR adds new API endpoints for credential data retrieval, OAuth token refresh functionality, and execution error tracking. It also includes improvements to OAuth credential naming and bug fixes.
New Features
- Credential Instance Info Endpoint (GET /credentials/instance/{uid}) - Retrieve credential details by UID
- Credential Data Endpoint (GET /credentials/data/{uid}) - Internal service-to-service credential data retrieval
- OAuth Token Refresh (POST /oauth/{provider}/refresh) - Refresh expired OAuth access tokens (Twitter, LinkedIn, etc.)
- Latest Execution Error (GET /executions/latest-error/{workflowId}) - Retrieve the most recent workflow execution error
Improvements
- OAuth credential naming now uses @ prefix for social handles (e.g., "Twitter - @username", "TikTok - @displayname")
- Updated CredentialInstanceInfoDTO with credentialName and credentialType fields
- Added n8nCredentialId field to CredentialResponseDTO
- Removed r_member_social scope from LinkedIn OAuth (requires additional LinkedIn product approval)
Bug Fixes
- Fixed null credentials handling in workflow updates by initializing empty credentials map
- Added @JsonInclude(NON_NULL) to NodeDTO to prevent null values in JSON serialization
New Files
- CredentialDataResponseDTO.java
- OrchestrationServiceClient.java
descripption lke this "C:\Users\DELL\Desktop\git_commit_guide.txt"
● Read(~\Desktop\git_commit_guide.txt) ⎿ Read 129 lines
● Got it! Here's the MR description following the template:
Credential Data Retrieval & OAuth Token Refresh Implementation
API Endpoints
- Add credential instance info endpoint (GET /instance/{credentialInstanceUid})
- Add credential data endpoint (GET /data/{credentialInstanceUid})
- Add OAuth token refresh endpoint (POST /{provider}/refresh)
- Add latest execution error endpoint (GET /latest-error/{workflowId})
State Management
- Add OrchestrationServiceClient for service-to-service communication
- Add findByUid and findByCredentialAndInstanceName repository methods
- Implement OAuth token update and persistence logic
Type Definitions
- Create CredentialDataResponseDTO for decrypted credential data response
- Update CredentialInstanceInfoDTO with credentialName and credentialType fields
- Update CredentialResponseDTO with n8nCredentialId field
- Add OAUTH_REFRESH_TOKEN_MISSING and OAUTH_TOKEN_REFRESH_FAILED error codes
Architecture
- Improve OAuth credential naming with @ prefix for social handles (Twitter, TikTok)
- Remove r_member_social scope from LinkedIn OAuth
Bug Fixes
- Fix null credentials handling in workflow updates
- Add @JsonInclude(NON_NULL) to NodeDTO to exclude null values from JSON
CLOSE IAV-446