-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I'm quite sure the solution is good, but there is just one github tes…
…t that doesn't work
- Loading branch information
Showing
84 changed files
with
677 additions
and
286 deletions.
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
37 changes: 37 additions & 0 deletions
37
.../main/java/org/ndx/aadarchi/maven/cdi/faker/properties/FilterMavenPropertiesInValues.java
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.ndx.aadarchi.maven.cdi.faker.properties; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
import org.ndx.aadarchi.cdi.deltaspike.ConfigFilter; | ||
|
||
import jakarta.inject.Inject; | ||
|
||
public class FilterMavenPropertiesInValues implements ConfigFilter { | ||
|
||
@Inject ExposeMavenPropertiesAsConfigProperties configSource; | ||
|
||
@Override | ||
public String filterValue(String key, String value) { | ||
String updatedValue = value; | ||
for(ExposeMavenPropertiesAsConfigProperties.Keys k : ExposeMavenPropertiesAsConfigProperties.Keys.values()) { | ||
String initial = String.format("${%s}", k.getPropertyKey()); | ||
String replaced = k.getComputedValue(); | ||
updatedValue = updatedValue.replace(initial, replaced); | ||
} | ||
return updatedValue; | ||
} | ||
|
||
@Override | ||
public String filterValueForLog(String key, String value) { | ||
String updatedValue = value; | ||
for(ExposeMavenPropertiesAsConfigProperties.Keys k : ExposeMavenPropertiesAsConfigProperties.Keys.values()) { | ||
String initial = String.format("${%s}", k.getPropertyKey()); | ||
String replaced = k.getComputedValue(); | ||
if(k.getPropertyKey().contains("password")) { | ||
replaced = StringUtils.repeat('*', replaced.length()); | ||
} | ||
updatedValue = updatedValue.replace(initial, replaced); | ||
} | ||
return updatedValue; | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.