-
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.
- Loading branch information
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/ShibbolethUiApplication.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
15 changes: 15 additions & 0 deletions
15
...t2/tier/shibboleth/admin/ui/configuration/PlaceholderResolverComponentsConfiguration.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,15 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.configuration; | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.service.TokenPlaceholderValueResolvingService; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.core.env.PropertyResolver; | ||
|
||
@Configuration | ||
public class PlaceholderResolverComponentsConfiguration { | ||
|
||
@Bean | ||
public TokenPlaceholderValueResolvingService tokenPlaceholderValueResolvingService(PropertyResolver propertyResolver) { | ||
return TokenPlaceholderValueResolvingService.shibbolethPlaceholderAware(propertyResolver); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ier/shibboleth/admin/ui/service/ShibbolethPlaceholderTokenAwareValueResolvingService.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
7 changes: 7 additions & 0 deletions
7
...edu/internet2/tier/shibboleth/admin/ui/service/TokenPlaceholderValueResolvingService.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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.service; | ||
|
||
import org.springframework.core.env.PropertyResolver; | ||
|
||
/** | ||
* Generic API to resolve values from arbitrary tokenized placeholders such as '%{token.placeholder}' etc. | ||
* | ||
* @author Dmitriy Kopylenko | ||
*/ | ||
@FunctionalInterface | ||
public interface TokenPlaceholderValueResolvingService { | ||
|
||
String resolveValueFromTokenPlaceholder(String tokenPlaceholder); | ||
|
||
static TokenPlaceholderValueResolvingService shibbolethPlaceholderAware(PropertyResolver propertyResolver) { | ||
return new ShibbolethPlaceholderTokenAwareValueResolvingService(propertyResolver); | ||
} | ||
} |