Filter build-info and modules properties#716
Conversation
yahavi
left a comment
There was a problem hiding this comment.
Please don't merge this code before my final approval. I want to go through it again.
build-info-extractor/src/main/java/org/jfrog/build/extractor/BuildInfoExtractorUtils.java
Outdated
Show resolved
Hide resolved
build-info-extractor/src/main/java/org/jfrog/build/extractor/BuildInfoExtractorUtils.java
Outdated
Show resolved
Hide resolved
...fo-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/PatternMatcher.java
Outdated
Show resolved
Hide resolved
...fo-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/PatternMatcher.java
Show resolved
Hide resolved
...fo-extractor/src/main/java/org/jfrog/build/extractor/packageManager/PackageManagerUtils.java
Show resolved
Hide resolved
...xtractor/src/test/java/org/jfrog/build/extractor/packageManager/PackageManagerUtilsTest.java
Outdated
Show resolved
Hide resolved
...xtractor/src/test/java/org/jfrog/build/extractor/packageManager/PackageManagerUtilsTest.java
Outdated
Show resolved
Hide resolved
...fo-extractor/src/main/java/org/jfrog/build/extractor/packageManager/PackageManagerUtils.java
Outdated
Show resolved
Hide resolved
| private static final String apiKeySecretPrefix = "AKCp8"; | ||
| private static final int apiKeySecretMinimalLength = 73; | ||
| private static final String referenceTokenSecretPrefix = "cmVmdGtuOjAxOj"; | ||
| private static final int referenceTokenSecretMinimalLength = 64; |
There was a problem hiding this comment.
I almost sure that reference tokens are 64 characters fixed
| } | ||
|
|
||
| public static Properties getEnvProperties(Properties startProps, Log log) { | ||
| IncludeExcludePatterns patterns = new IncludeExcludePatterns( |
There was a problem hiding this comment.
Removing the filtering code from this method sounds very risky to me. Let's do the "get" and the "filter" logic in one place to enforce filtering in all flows.
There was a problem hiding this comment.
I understand the concern, but this is not the place to do filtering. According to the name of this function, it returns all environment variables. By moving the filter logic to a new location, we can filter not only the environment variables, but also modules. Putting the filter logic here would prevent us from filtering things unrelated to environment variables, so we would have to split the logic across the code, and that will cause a mess in the code.
There was a problem hiding this comment.
Due to security risks, we will return the filter logic to here despite the above comment .
Prior to this PR, build-info properties were filtered only for environment variables and system properties.
The PR moves all filter logic into one place and performs exclude/include logic for all properties, including:
buildInfo.envprefix)