Search in sources :

Example 1 with AwsSecretKeySelector

use of io.stackgres.common.crd.storages.AwsSecretKeySelector in project stackgres by ongres.

the class BackupConfigTransformer method getResourceAwsCredentials.

private AwsCredentials getResourceAwsCredentials(io.stackgres.common.crd.storages.AwsCredentials source) {
    if (source == null) {
        return null;
    }
    AwsCredentials transformation = new AwsCredentials();
    if (source.getSecretKeySelectors() != null) {
        final AwsSecretKeySelector secretKeySelectors = source.getSecretKeySelectors();
        transformation.getSecretKeySelectors().setAccessKeyId(secretKeySelectors.getAccessKeyId());
        transformation.getSecretKeySelectors().setSecretAccessKey(secretKeySelectors.getSecretAccessKey());
    }
    return transformation;
}
Also used : AwsSecretKeySelector(io.stackgres.common.crd.storages.AwsSecretKeySelector) AwsCredentials(io.stackgres.apiweb.dto.storages.AwsCredentials)

Example 2 with AwsSecretKeySelector

use of io.stackgres.common.crd.storages.AwsSecretKeySelector in project stackgres by ongres.

the class BackupConfigSourceValidatorTest method setGcsCredentials.

private void setGcsCredentials(final BackupConfigReview review, String serviceAccountJsonKeyName, String serviceAccountJsonKeyKey) {
    BackupStorage storage = review.getRequest().getObject().getSpec().getStorage();
    storage.setType("gcs");
    storage.setGcs(new GoogleCloudStorage());
    storage.getGcs().setCredentials(new GoogleCloudCredentials());
    storage.getGcs().getCredentials().setSecretKeySelectors(new GoogleCloudSecretKeySelector());
    GoogleCloudSecretKeySelector awsSecretKeySelector = storage.getGcs().getCredentials().getSecretKeySelectors();
    awsSecretKeySelector.setServiceAccountJsonKey(new SecretKeySelector(serviceAccountJsonKeyKey, serviceAccountJsonKeyName));
}
Also used : GoogleCloudSecretKeySelector(io.stackgres.common.crd.storages.GoogleCloudSecretKeySelector) GoogleCloudStorage(io.stackgres.common.crd.storages.GoogleCloudStorage) BackupStorage(io.stackgres.common.crd.storages.BackupStorage) GoogleCloudCredentials(io.stackgres.common.crd.storages.GoogleCloudCredentials) SecretKeySelector(io.stackgres.common.crd.SecretKeySelector) AzureBlobSecretKeySelector(io.stackgres.common.crd.storages.AzureBlobSecretKeySelector) AwsSecretKeySelector(io.stackgres.common.crd.storages.AwsSecretKeySelector) GoogleCloudSecretKeySelector(io.stackgres.common.crd.storages.GoogleCloudSecretKeySelector)

Example 3 with AwsSecretKeySelector

use of io.stackgres.common.crd.storages.AwsSecretKeySelector in project stackgres by ongres.

the class BackupConfigSourceValidatorTest method setS3Credentials.

private void setS3Credentials(final BackupConfigReview review, String accessKeyIdName, String accessKeyIdKey, String secretAccessKeyName, String secretAccessKeyKey) {
    BackupStorage storage = review.getRequest().getObject().getSpec().getStorage();
    storage.setType("s3");
    storage.setS3(new AwsS3Storage());
    storage.getS3().setAwsCredentials(new AwsCredentials());
    storage.getS3().getAwsCredentials().setSecretKeySelectors(new AwsSecretKeySelector());
    AwsSecretKeySelector awsSecretKeySelector = storage.getS3().getAwsCredentials().getSecretKeySelectors();
    awsSecretKeySelector.setAccessKeyId(new SecretKeySelector(accessKeyIdKey, accessKeyIdName));
    awsSecretKeySelector.setSecretAccessKey(new SecretKeySelector(secretAccessKeyKey, secretAccessKeyName));
}
Also used : AwsS3Storage(io.stackgres.common.crd.storages.AwsS3Storage) BackupStorage(io.stackgres.common.crd.storages.BackupStorage) AwsSecretKeySelector(io.stackgres.common.crd.storages.AwsSecretKeySelector) AwsCredentials(io.stackgres.common.crd.storages.AwsCredentials) SecretKeySelector(io.stackgres.common.crd.SecretKeySelector) AzureBlobSecretKeySelector(io.stackgres.common.crd.storages.AzureBlobSecretKeySelector) AwsSecretKeySelector(io.stackgres.common.crd.storages.AwsSecretKeySelector) GoogleCloudSecretKeySelector(io.stackgres.common.crd.storages.GoogleCloudSecretKeySelector)

Example 4 with AwsSecretKeySelector

use of io.stackgres.common.crd.storages.AwsSecretKeySelector in project stackgres by ongres.

the class BackupConfigSourceValidatorTest method setS3CompatibleCredentials.

private void setS3CompatibleCredentials(final BackupConfigReview review, String accessKeyIdName, String accessKeyIdKey, String secretAccessKeyName, String secretAccessKeyKey) {
    BackupStorage storage = review.getRequest().getObject().getSpec().getStorage();
    storage.setType("s3compatible");
    storage.setS3Compatible(new AwsS3CompatibleStorage());
    storage.getS3Compatible().setAwsCredentials(new AwsCredentials());
    storage.getS3Compatible().getAwsCredentials().setSecretKeySelectors(new AwsSecretKeySelector());
    AwsSecretKeySelector awsSecretKeySelector = storage.getS3Compatible().getAwsCredentials().getSecretKeySelectors();
    awsSecretKeySelector.setAccessKeyId(new SecretKeySelector(accessKeyIdKey, accessKeyIdName));
    awsSecretKeySelector.setSecretAccessKey(new SecretKeySelector(secretAccessKeyKey, secretAccessKeyName));
}
Also used : BackupStorage(io.stackgres.common.crd.storages.BackupStorage) AwsSecretKeySelector(io.stackgres.common.crd.storages.AwsSecretKeySelector) AwsCredentials(io.stackgres.common.crd.storages.AwsCredentials) SecretKeySelector(io.stackgres.common.crd.SecretKeySelector) AzureBlobSecretKeySelector(io.stackgres.common.crd.storages.AzureBlobSecretKeySelector) AwsSecretKeySelector(io.stackgres.common.crd.storages.AwsSecretKeySelector) GoogleCloudSecretKeySelector(io.stackgres.common.crd.storages.GoogleCloudSecretKeySelector) AwsS3CompatibleStorage(io.stackgres.common.crd.storages.AwsS3CompatibleStorage)

Example 5 with AwsSecretKeySelector

use of io.stackgres.common.crd.storages.AwsSecretKeySelector in project stackgres by ongres.

the class BackupConfigTransformer method getCustomResourceAwsCredentials.

private io.stackgres.common.crd.storages.AwsCredentials getCustomResourceAwsCredentials(AwsCredentials source) {
    if (source == null) {
        return null;
    }
    io.stackgres.common.crd.storages.AwsCredentials transformation = new io.stackgres.common.crd.storages.AwsCredentials();
    final AwsSecretKeySelector secretKeySelectors = new AwsSecretKeySelector();
    transformation.setSecretKeySelectors(secretKeySelectors);
    secretKeySelectors.setAccessKeyId(source.getSecretKeySelectors().getAccessKeyId());
    secretKeySelectors.setSecretAccessKey(source.getSecretKeySelectors().getSecretAccessKey());
    return transformation;
}
Also used : AwsSecretKeySelector(io.stackgres.common.crd.storages.AwsSecretKeySelector) AwsCredentials(io.stackgres.apiweb.dto.storages.AwsCredentials)

Aggregations

AwsSecretKeySelector (io.stackgres.common.crd.storages.AwsSecretKeySelector)5 SecretKeySelector (io.stackgres.common.crd.SecretKeySelector)3 AzureBlobSecretKeySelector (io.stackgres.common.crd.storages.AzureBlobSecretKeySelector)3 BackupStorage (io.stackgres.common.crd.storages.BackupStorage)3 GoogleCloudSecretKeySelector (io.stackgres.common.crd.storages.GoogleCloudSecretKeySelector)3 AwsCredentials (io.stackgres.apiweb.dto.storages.AwsCredentials)2 AwsCredentials (io.stackgres.common.crd.storages.AwsCredentials)2 AwsS3CompatibleStorage (io.stackgres.common.crd.storages.AwsS3CompatibleStorage)1 AwsS3Storage (io.stackgres.common.crd.storages.AwsS3Storage)1 GoogleCloudCredentials (io.stackgres.common.crd.storages.GoogleCloudCredentials)1 GoogleCloudStorage (io.stackgres.common.crd.storages.GoogleCloudStorage)1