Configuration

Configuration component contains the design time semantics and validation feature for handling policies.

The SDK defines Java APIs for each feature that policy plugins must implement. Each API can cover multiple features. The configuration component in metadata is used to declare the implementation classes.

The configuration component of a policy metadata looks like:
   "configuration": {
      "services": [
         {
            "type": "oracle.apiplatform.policies.sdk.validation.PolicyValidator",
            "service": "oracle.apiplatform.policies.custompolicy.CUSTOMPOLICYValidator"
         },
         {
            "type": "oracle.apiplatform.policies.sdk.runtime.PolicyRuntimeFactory",
            "service": "oracle.apiplatform.policies.custompolicy.CUSTOMPOLICYRuntimeFactory"
         }
      ]
   }

The following services are supported:

  • oracle.apiplatform.policies.sdk.validation.PolicyValidator: This service is used to validate the policy configuration that is submitted. It returns error messages if it finds syntax or semantic errors.

  • oracle.apiplatform.policies.sdk.runtime.PolicyRuntimeFactory: This service is used to register a factory class to create policy runtime class. The policy runtime class executes the logic that is defined in the policy configuration.

  • oracle.apiplatform.policies.sdk.references.PolicyReferenceHandler: This service enforces the policies that refer other resources declare those references to the system. This helps us track those references. For example, we can track and avoid deletion of a referenced resource.

  • oracle.apiplatform.policies.sdk.security.PolicySecurityHandler: This service is used to encode or decode the sensitive information in the policy configuration. This ensures that we do not have sensitive information saved in clear text as part of the API.