Class CredentialService

java.lang.Object
ai.nervemind.app.service.CredentialService
All Implemented Interfaces:
ai.nervemind.common.service.CredentialServiceInterface

@Service @Transactional public class CredentialService extends Object implements ai.nervemind.common.service.CredentialServiceInterface
Service for managing credentials with encryption.
  • Constructor Details

    • CredentialService

      public CredentialService(CredentialRepository credentialRepository)
      Creates a new CredentialService.
      Parameters:
      credentialRepository - the repository used to persist credentials
  • Method Details

    • findAll

      public List<ai.nervemind.common.dto.CredentialDTO> findAll()
      Specified by:
      findAll in interface ai.nervemind.common.service.CredentialServiceInterface
    • findById

      public Optional<ai.nervemind.common.dto.CredentialDTO> findById(Long id)
      Specified by:
      findById in interface ai.nervemind.common.service.CredentialServiceInterface
    • findByName

      public Optional<ai.nervemind.common.dto.CredentialDTO> findByName(String name)
      Specified by:
      findByName in interface ai.nervemind.common.service.CredentialServiceInterface
    • findByType

      public List<ai.nervemind.common.dto.CredentialDTO> findByType(ai.nervemind.common.enums.CredentialType type)
      Specified by:
      findByType in interface ai.nervemind.common.service.CredentialServiceInterface
    • create

      public ai.nervemind.common.dto.CredentialDTO create(ai.nervemind.common.dto.CredentialDTO dto, String data)
      Specified by:
      create in interface ai.nervemind.common.service.CredentialServiceInterface
    • update

      public ai.nervemind.common.dto.CredentialDTO update(Long id, ai.nervemind.common.dto.CredentialDTO dto, String data)
      Specified by:
      update in interface ai.nervemind.common.service.CredentialServiceInterface
    • delete

      public void delete(Long id)
      Specified by:
      delete in interface ai.nervemind.common.service.CredentialServiceInterface
    • getDecryptedData

      public String getDecryptedData(Long id)
      Decrypt and retrieve the credential data. Use with caution - only for actual workflow execution.
      Specified by:
      getDecryptedData in interface ai.nervemind.common.service.CredentialServiceInterface
    • testCredential

      public boolean testCredential(Long id)
      Test if a credential is valid. Currently just checks if it can be decrypted.
      Specified by:
      testCredential in interface ai.nervemind.common.service.CredentialServiceInterface