Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gcs dataplane enhancement #83

Conversation

git-masoud
Copy link
Contributor

What this PR changes/adds

We implemented other approaches for authentication against the gcp api in the core already. Now, in this PR, this feature is being used by the dataplane to enhance the usage of google storage data-plane. Therefore, users can dynamically change their service account key file in run time by adding it into the vault and or adding it into the data address.

Further notes

Another approach for authentication is to create a Service Account key file and use it to retrieve the GoogleCredentials. Similar to Azure storage Data Plane, the key could be uploaded into the vault and be pointed in the keyname in the DataAddress.

Linked Issue(s)

Closes #59

@git-masoud git-masoud requested a review from man8pr December 1, 2023 11:07
@git-masoud git-masoud changed the title feat(dataplane_gcs_enhancement): Enhancing Google Dataplane to allow… feat: gcs dataplane enhancement Dec 1, 2023
@git-masoud git-masoud added the enhancement New feature or request label Dec 1, 2023
Copy link
Contributor

@man8pr man8pr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! Pls check the GcpConfiguration class, this is intended to provide a configuration at connector level that can overridden by the data in the request.

* Default authentication:
* Authenticates against the Google Cloud API using the [Application Default Credentials](https://cloud.google.com/docs/authentication#adc).
* These will automatically be provided if the connector is deployed with the correct service account attached.
* Service Account key file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* These will automatically be provided if the connector is deployed with the correct service account attached.
* Service Account key file
* Authentication using a Service Account key file exported from Google Cloud Platform
* Service Account key file can be stored in a vault or encoded as base64 and provided in the dataAddress.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls check GcpConfiguration.java , as this provide a configuration at connector level where service account is optionally set.

@@ -49,11 +50,12 @@ public String name() {
public void initialize(ServiceExtensionContext context) {

var monitor = context.getMonitor();
var gcpCredential = new GcpCredentials(vault, typeManager, monitor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to have GcpCredentials taking also the GcpConfiguration object injected?
If a service account is provided in the dataAddress, then it overrides the GcpConfiguration.

var tokenKeyName = destination.getKeyName();
var serviceAccountKeyName = destination.getStringProperty(GcsStoreSchema.SERVICE_ACCOUNT_KEY_NAME);
var serviceAccountValue = destination.getStringProperty(GcsStoreSchema.SERVICE_ACCOUNT_KEY_VALUE);
var gcpServiceAccountCredentials = new GcpServiceAccountCredentials(tokenKeyName, serviceAccountKeyName, serviceAccountValue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense pass directly destination.getKeyName() instead of declaring the variable? (same for SourceFactory)

Copy link
Contributor

This pull request is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Dec 12, 2023
Copy link
Contributor

This pull request was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this Dec 20, 2023
@git-masoud git-masoud self-assigned this Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancing GCS provisioner and dataplane
2 participants