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

[Feature] Add Support for encrypting config fields #278

Conversation

shashwatsai
Copy link
Contributor

Purpose of this pull request

While writing intermediate config to submit job via seatunnel client, we are required to encrypt certain fields like password, auth, username

By Default no encryption would be done, to enable the encryption provide the following properties

seatunnel-web:
  datasource:
    encryption:
      type: your_encryption
      keys-to-encrypt:
        - password
        - auth

ref: https://seatunnel.apache.org/docs/2.3.9/connector-v2/Config-Encryption-Decryption/

Check list

@shashwatsai shashwatsai force-pushed the feature/intermediate-job-config-encryption branch from a30d3d1 to 1d7c588 Compare February 11, 2025 06:44
@@ -52,7 +52,13 @@ jwt:
secretKey:
algorithm: HS256


seatunnel-web:
Copy link
Collaborator

Choose a reason for hiding this comment

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

In an earlier PR, we placed the Seatunnel-web specific configuration under the spring config section.
You have now put seatunnel-web specific configuration under the seatunnel-web config section.
This seems to be a better approach. Later, we can also move the configurations from the earlier PR under the seatunnel-web config section.

@Autowired private EncryptionConfig encryptionConfig;

public void encryptData(Map<String, String> datasourceConfig) {
for (String key : encryptionConfig.getKeysToEncrypt()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

When encryption type is default it does not do any encoding/decoding. can we simply return from where when encoding is default.

seatunnel-web:
datasource:
encryption:
type: default
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we use none instead of default

@@ -324,6 +331,10 @@ public String generateJobConfig(
if (sinkMap.size() > 0) {
sinks = getConnectorConfig(sinkMap);
}
envConfig =
Copy link
Collaborator

Choose a reason for hiding this comment

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

add this config only when encryption is enabled.

While writing intermediate config to submit job via seatunnel client,
we are required to encrypt certain fields like password, auth, username

By Default no encryption would be done, to enable the encryption
provide the following properties

```
seatunnel-web:
  datasource:
    encryption:
      type: your_encryption
      keys-to-encrypt:
        - password
        - auth
```

ref: https://seatunnel.apache.org/docs/2.3.9/connector-v2/Config-Encryption-Decryption/

Co-authored-by: BilwaST <[email protected]>
Co-authored-by: Shashwat Tiwari <[email protected]>
@shashwatsai shashwatsai force-pushed the feature/intermediate-job-config-encryption branch from 1d7c588 to 4ad6dae Compare February 11, 2025 08:54
@arshadmohammad arshadmohammad merged commit 46c8a84 into apache:main Feb 11, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants