-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[Feature][Config] Support custom config keys for encrypt/decrypt #8739
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
Conversation
|
Please follow the guide to open github action on your fork repository. https://github.com/apache/seatunnel/pull/8739/checks?check_run_id=37293359572 |
94129d4 to
48f123d
Compare
| return ConfigFactory.parseMap(configMap); | ||
| } | ||
|
|
||
| public static List<String> getSensitiveOptions(Config config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use set as return type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll revise it, and do you have any other suggestions or comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall LGTM.
48f123d to
f352f20
Compare
| env { | ||
| parallelism = 1 | ||
| shade.identifier = "base64" | ||
| shade.options = ["username", "password", "f1", "config1.f1", "config2.list"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it better to rename to shade.keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@litiliu I don't think so, shade.options may be clearer in config context, especially with default values.
| : ConfigFactory.empty(), | ||
| SHADE_OPTIONS_OPTION, | ||
| new ArrayList<>())); | ||
| sensitiveOptions.addAll(new ArrayList<>(Arrays.asList(DEFAULT_SENSITIVE_KEYWORDS))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can directly use sensitiveOptions.addAll(Arrays.asList(DEFAULT_SENSITIVE_KEYWORDS));
| if (Arrays.asList(DEFAULT_SENSITIVE_KEYWORDS) | ||
| .contains(key.toLowerCase())) { | ||
| m.put(key, "******"); | ||
| if (sensitiveKeywords.contains(key.toLowerCase())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the toLowerCase needed here? As in the doc, we didn't specify whether we can match with the ignore case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't care keywords case. The old behavior already convert to lowercase https://github.com/apache/seatunnel/pull/8739/files#diff-f4fa1a9b065718cc135d232712063b7b3a9135933396dd2674253da754d95c86L131. So I think we should keep it. cc @remones
f352f20 to
fe8d1e3
Compare
fe8d1e3 to
a30c818
Compare
Hisoka-X
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. cc @hailin0
a30c818 to
ef251fb
Compare
…che#8739) Co-authored-by: wanqifei <[email protected]>
Purpose of this pull request
support custom config keys for encrypt/decrypt
related issue: #8511
Does this PR introduce any user-facing change?
Yes. config encryption/decryption now supports
shade.options, allowing users to add custom parameters that intend to be encrypted/decrypted.How was this patch tested?
Exist tests
Check list
New License Guide
release-note.