-
Notifications
You must be signed in to change notification settings - Fork 380
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
[#1190] feat(server-common): Support custom filters #1191
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bc09888
[ISSUE-1190]feat(server-common): Support custom filter
18faf4d
fix
b17e332
Merge remote-tracking branch 'upstream/main' into ISSUE-42
d5272f5
fix
55184a6
[MINOR] fix(docs): Modify the required value for the document
239e55d
fix
9a9c107
Revert "[MINOR] fix(docs): Modify the required value for the document"
831feee
fixed
d72c39d
fix
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,13 @@ public final class JettyServerConfig { | |
.stringConf() | ||
.createWithDefault("JKS"); | ||
|
||
public static final ConfigEntry<Optional<String>> CUSTOM_FILTERS = | ||
new ConfigBuilder("customFilters") | ||
.doc("Comma separated list of filter class names to apply to the APIs") | ||
.version("0.4.0") | ||
.stringConf() | ||
.createWithOptional(); | ||
|
||
private final String host; | ||
|
||
private final int httpPort; | ||
|
@@ -199,7 +206,9 @@ public final class JettyServerConfig { | |
private final Set<String> enableCipherAlgorithms; | ||
private final boolean enableClientAuth; | ||
private final String trustStorePath; | ||
private final String trustStorePasword; | ||
private final String trustStorePassword; | ||
|
||
private final Set<String> customFilters; | ||
private final String trustStoreType; | ||
private final Config internalConfig; | ||
|
||
|
@@ -245,8 +254,13 @@ private JettyServerConfig(Map<String, String> configs) { | |
Sets.newHashSet(internalConfig.get(ENABLE_CIPHER_ALGORITHMS).split(SPLITTER))); | ||
this.enableClientAuth = internalConfig.get(ENABLE_CLIENT_AUTH); | ||
this.trustStorePath = internalConfig.get(SSL_TRUST_STORE_PATH); | ||
this.trustStorePasword = internalConfig.get(SSL_TRUST_STORE_PASSWORD); | ||
this.trustStorePassword = internalConfig.get(SSL_TRUST_STORE_PASSWORD); | ||
this.trustStoreType = internalConfig.get(SSL_TRUST_STORE_TYPE); | ||
this.customFilters = | ||
internalConfig | ||
.get(CUSTOM_FILTERS) | ||
.map(filters -> Collections.unmodifiableSet(Sets.newHashSet(filters.split(SPLITTER)))) | ||
.orElse(Collections.emptySet()); | ||
} | ||
|
||
public static JettyServerConfig fromConfig(Config config, String prefix) { | ||
|
@@ -330,14 +344,18 @@ public String getTrustStorePath() { | |
return trustStorePath; | ||
} | ||
|
||
public String getTrustStorePasword() { | ||
return trustStorePasword; | ||
public String getTrustStorePassword() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An unrelated typo. Just fix by the way. |
||
return trustStorePassword; | ||
} | ||
|
||
public String getTrustStoreType() { | ||
return trustStoreType; | ||
} | ||
|
||
public Map<String, String> getAllWithPrefix(String prefix) { | ||
return internalConfig.getConfigsWithPrefix(prefix); | ||
} | ||
|
||
private SSLContext getDefaultSSLContext() { | ||
try { | ||
return SSLContext.getDefault(); | ||
|
@@ -366,6 +384,10 @@ public Set<String> getSupportedAlgorithms() { | |
return supportedAlgorithms; | ||
} | ||
|
||
public Set<String> getCustomFilters() { | ||
return customFilters; | ||
} | ||
|
||
@VisibleForTesting | ||
Set<String> getSupportedCipherSuites() { | ||
SSLContext context = | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
An unrelated typo. Just fix by the way.