Search in sources :

Example 16 with Secret

use of io.hops.hopsworks.persistence.entity.user.security.secrets.Secret in project hopsworks by logicalclocks.

the class FeaturestoreSnowflakeConnectorController method createConnector.

public FeaturestoreSnowflakeConnector createConnector(Users user, Featurestore featurestore, FeaturestoreSnowflakeConnectorDTO featurestoreSnowflakeConnectorDTO) throws FeaturestoreException, UserException, ProjectException {
    verifyConnectorDTO(featurestoreSnowflakeConnectorDTO);
    Secret secret = createSecret(user, featurestore, featurestoreSnowflakeConnectorDTO);
    FeaturestoreSnowflakeConnector snowflakeConnector = new FeaturestoreSnowflakeConnector();
    setConnector(snowflakeConnector, secret, featurestoreSnowflakeConnectorDTO);
    return snowflakeConnector;
}
Also used : Secret(io.hops.hopsworks.persistence.entity.user.security.secrets.Secret) FeaturestoreSnowflakeConnector(io.hops.hopsworks.persistence.entity.featurestore.storageconnector.snowflake.FeaturestoreSnowflakeConnector)

Example 17 with Secret

use of io.hops.hopsworks.persistence.entity.user.security.secrets.Secret in project hopsworks by logicalclocks.

the class FeaturestoreADLSConnectorController method createADLConnector.

public FeaturestoreADLSConnector createADLConnector(Users user, Project project, Featurestore featurestore, FeaturestoreADLSConnectorDTO adlConnectorDTO) throws FeaturestoreException, ProjectException, UserException {
    verifyConnectorDTO(adlConnectorDTO);
    String secretName = storageConnectorUtil.createSecretName(featurestore.getId(), adlConnectorDTO.getName(), adlConnectorDTO.getStorageConnectorType());
    Secret secret = storageConnectorUtil.createProjectSecret(user, secretName, featurestore, adlConnectorDTO.getServiceCredential());
    FeaturestoreADLSConnector adlConnector = new FeaturestoreADLSConnector();
    adlConnector.setGeneration(adlConnectorDTO.getGeneration());
    adlConnector.setDirectoryId(adlConnectorDTO.getDirectoryId());
    adlConnector.setApplicationId(adlConnectorDTO.getApplicationId());
    adlConnector.setServiceCredentialSecret(secret);
    adlConnector.setAccountName(adlConnectorDTO.getAccountName());
    adlConnector.setContainerName(adlConnectorDTO.getContainerName());
    return adlConnector;
}
Also used : Secret(io.hops.hopsworks.persistence.entity.user.security.secrets.Secret) FeaturestoreADLSConnector(io.hops.hopsworks.persistence.entity.featurestore.storageconnector.adls.FeaturestoreADLSConnector)

Aggregations

Secret (io.hops.hopsworks.persistence.entity.user.security.secrets.Secret)17 UserException (io.hops.hopsworks.exceptions.UserException)6 SecretId (io.hops.hopsworks.persistence.entity.user.security.secrets.SecretId)6 IOException (java.io.IOException)4 GeneralSecurityException (java.security.GeneralSecurityException)4 TransactionAttribute (javax.ejb.TransactionAttribute)4 Transactional (javax.transaction.Transactional)3 HashMap (java.util.HashMap)2 MasterPasswordChangeResult (io.hops.hopsworks.common.security.MasterPasswordChangeResult)1 SymmetricEncryptionDescriptor (io.hops.hopsworks.common.security.SymmetricEncryptionDescriptor)1 EncryptionMasterPasswordException (io.hops.hopsworks.exceptions.EncryptionMasterPasswordException)1 FeaturestoreException (io.hops.hopsworks.exceptions.FeaturestoreException)1 ProjectException (io.hops.hopsworks.exceptions.ProjectException)1 ServiceException (io.hops.hopsworks.exceptions.ServiceException)1 FeaturestoreADLSConnector (io.hops.hopsworks.persistence.entity.featurestore.storageconnector.adls.FeaturestoreADLSConnector)1 FeaturestoreS3ConnectorAccessAndSecretKey (io.hops.hopsworks.persistence.entity.featurestore.storageconnector.s3.FeaturestoreS3ConnectorAccessAndSecretKey)1 FeaturestoreS3ConnectorEncryptionAlgorithm (io.hops.hopsworks.persistence.entity.featurestore.storageconnector.s3.FeaturestoreS3ConnectorEncryptionAlgorithm)1 FeaturestoreSnowflakeConnector (io.hops.hopsworks.persistence.entity.featurestore.storageconnector.snowflake.FeaturestoreSnowflakeConnector)1 Project (io.hops.hopsworks.persistence.entity.project.Project)1 ProjectTeam (io.hops.hopsworks.persistence.entity.project.team.ProjectTeam)1