-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jans-auth-server): client secret printed on logs (#7608)
#4323 Signed-off-by: YuriyZ <[email protected]>
- Loading branch information
Showing
4 changed files
with
55 additions
and
21 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
24 changes: 24 additions & 0 deletions
24
jans-auth-server/server/src/test/java/io/jans/as/server/util/ServerUtilTest.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,24 @@ | ||
package io.jans.as.server.util; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
/** | ||
* @author Yuriy Z | ||
*/ | ||
public class ServerUtilTest { | ||
|
||
@Test | ||
public void prepareForLogs_whenCalled_shouldNotHaveClearTextClientPassword() { | ||
Map<String, String[]> parameters = new HashMap<>(); | ||
parameters.put("client_secret", new String[] {"124"}); | ||
|
||
final Map<String, String[]> result = ServerUtil.prepareForLogs(parameters); | ||
|
||
assertEquals("*****", result.get("client_secret")[0]); | ||
} | ||
} |
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