Class PolicyUtils
java.lang.Object
org.elasticsearch.entitlement.runtime.policy.PolicyUtils
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePluginPolicies(Collection<PolicyUtils.PluginData> pluginData, Map<String, String> pluginPolicyPatches, String version) getEntitlementsDescriptions(Policy pluginPolicy) Extract a unique set of entitlements descriptions from the plugin's policy file.static List<Entitlement> mergeEntitlements(Stream<Entitlement> entitlements) mergeScopes(List<Scope> mainScopes, List<Scope> additionalScopes) static PolicyparseEncodedPolicyIfExists(String encodedPolicy, String version, boolean externalPlugin, String layerName, Set<String> moduleNames) static PolicyparsePolicyIfExists(String pluginName, Path pluginRoot, boolean isExternalPlugin)
-
Field Details
-
POLICY_FILE_NAME
- See Also:
-
-
Constructor Details
-
PolicyUtils
public PolicyUtils()
-
-
Method Details
-
createPluginPolicies
public static Map<String,Policy> createPluginPolicies(Collection<PolicyUtils.PluginData> pluginData, Map<String, String> pluginPolicyPatches, String version) throws IOException- Throws:
IOException
-
parseEncodedPolicyIfExists
public static Policy parseEncodedPolicyIfExists(String encodedPolicy, String version, boolean externalPlugin, String layerName, Set<String> moduleNames) - Throws:
PolicyParserException- if the supplied policy is formatted incorrectlyIllegalStateException- for any other error parsing the patch, such as nonexistent module names
-
parsePolicyIfExists
public static Policy parsePolicyIfExists(String pluginName, Path pluginRoot, boolean isExternalPlugin) throws IOException - Throws:
IOException
-
mergeScopes
-
mergeEntitlements
-
getEntitlementsDescriptions
Extract a unique set of entitlements descriptions from the plugin's policy file. Each entitlement is formatted for output to users.
-