Class ScopeTemplateUtil
- java.lang.Object
-
- org.oa4mp.server.loader.oauth2.claims.ScopeTemplateUtil
-
public class ScopeTemplateUtil extends Object
Utilities for working with scopes. These are static since they will be used by QDL functions for instance to make sure there is a single place with ALL the logic and edge cases.Created by Jeff Gaynor
on 1/21/21 at 10:32 AM
-
-
Constructor Summary
Constructors Constructor Description ScopeTemplateUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
compareAsURI(String requestedScope, String computedScope, boolean isQuery)
There is aURI.compareTo(URI)
method that is crap.static Collection<String>
doCompareTemplates(Collection<String> computedScopes, Collection<String> requestedScopes, boolean isQuery)
static List<String>
replaceTemplate(String currentTemplate, Map<String,List<String>> groups, Map claimsNoGroups)
resolve a single template for groups (if any) and other claims.protected static String
simpleReplacement(String currentTemplate, Map claims)
-
-
-
Method Detail
-
doCompareTemplates
public static Collection<String> doCompareTemplates(Collection<String> computedScopes, Collection<String> requestedScopes, boolean isQuery)
-
compareAsURI
public static String compareAsURI(String requestedScope, String computedScope, boolean isQuery)
There is aURI.compareTo(URI)
method that is crap. This does it right.- Parameters:
requestedScope
-computedScope
-isQuery
-- Returns:
-
replaceTemplate
public static List<String> replaceTemplate(String currentTemplate, Map<String,List<String>> groups, Map claimsNoGroups)
resolve a single template for groups (if any) and other claims. Such a template would look like head:/path/${groupName} where the name of the group is there. This returns a list of templates that have been resolved, one per group.- Parameters:
currentTemplate
-groups
-
-
-