forked from apereo/cas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow java SPIs to load principal name transformers
- Loading branch information
Showing
11 changed files
with
43 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
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 |
---|---|---|
|
@@ -22,8 +22,8 @@ class PrincipalNameTransformerUtilsTests { | |
void verifyBlockingAction() { | ||
val properties = new PrincipalTransformationProperties(); | ||
properties.setBlockingPattern(".+@.+\\.com"); | ||
val t = PrincipalNameTransformerUtils.newPrincipalNameTransformer(properties); | ||
assertThrows(PreventedException.class, () -> t.transform("[email protected]")); | ||
val transformer = PrincipalNameTransformerUtils.newPrincipalNameTransformer(properties); | ||
assertThrows(PreventedException.class, () -> transformer.transform("[email protected]")); | ||
} | ||
|
||
@Test | ||
|
@@ -32,8 +32,8 @@ void verifyAction() throws Throwable { | |
properties.setPrefix("prefix-"); | ||
properties.setSuffix("-suffix"); | ||
properties.setCaseConversion(PrincipalTransformationProperties.CaseConversion.UPPERCASE); | ||
val t = PrincipalNameTransformerUtils.newPrincipalNameTransformer(properties); | ||
val result = t.transform("userid"); | ||
val transformer = PrincipalNameTransformerUtils.newPrincipalNameTransformer(properties); | ||
val result = transformer.transform("userid"); | ||
assertEquals("PREFIX-USERID-SUFFIX", result); | ||
} | ||
|
||
|
@@ -42,8 +42,8 @@ void verifyGroovyAction() { | |
val properties = new PrincipalTransformationProperties(); | ||
properties.getGroovy().setLocation(new ClassPathResource("SomeGroovyScript.groovy")); | ||
properties.setCaseConversion(PrincipalTransformationProperties.CaseConversion.LOWERCASE); | ||
val t = PrincipalNameTransformerUtils.newPrincipalNameTransformer(properties); | ||
assertNotNull(t); | ||
val transformer = PrincipalNameTransformerUtils.newPrincipalNameTransformer(properties); | ||
assertNotNull(transformer); | ||
} | ||
|
||
@Test | ||
|
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