Skip to content

IAV-1027/feat(integration): add optional credential expiration date (expiresAt) support

salaheddine zidani a demandé de fusionner feature/IAV-1027 vers develop

Summary

This MR introduces support for an optional expiration date (expiresAt) on credentials created through the integration flow. The field propagates cleanly from the API surface down to the core-n8n-service credential creation call.


Changes

CredentialDTO

  • Added private Date expiresAt field
  • Used to carry the expiration date when calling core-n8n-service

CreateAgentIntegrationRequestDTO

  • Added private Date expiresAt field
  • Passed into CredentialDTO inside createCredentialInN8n()

CreateUserIntegrationRequestDTO

  • Added private Date expiresAt field
  • Forwarded to CreateAgentIntegrationRequestDTO builder in UserIntegrationServiceImpl.createUserIntegration() and createUserIntegrationWithStateToken()

AgentIntegrationServiceImpl

  • createCredentialInN8n(): passes request.getExpiresAt() to CredentialDTO

UserIntegrationServiceImpl

  • createUserIntegration(): includes expiresAt in the CreateAgentIntegrationRequestDTO builder
  • No change needed for createUserIntegrationWithStateToken() as it uses a pre-confirmed OAuth credential (expiry managed by OAuth provider)

Propagation Chain

POST /user-integrations
  └── CreateUserIntegrationRequestDTO.expiresAt
        └── CreateAgentIntegrationRequestDTO.expiresAt
              └── CredentialDTO.expiresAt
                    └── core-n8n-service /credentials

Behavior

  • expiresAt is optional — if null, the credential does not expire (existing behavior preserved)
  • No breaking change to existing API consumers
  • No database schema change required — expiry is managed entirely in core-n8n-service

Testing Checklist

  • Create integration with expiresAt set — verify it is forwarded to core-n8n-service
  • Create integration without expiresAt — verify null is handled gracefully (no NPE)
  • OAuth flow (createUserIntegrationWithStateToken) — verify no regression
  • Replicate integration — verify expiresAt is not required / does not break replication

Related Issues

Closes IAV-1027

Modification effectuée par salaheddine zidani

Rapports de requête de fusion