Package org.apache.synapse.mediators.opa
Class OPAClient
java.lang.Object
org.apache.synapse.mediators.opa.OPAClient
This class represents the client used to request and retrieve OPA response for a given policy
from the OPA server
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
BCFKS
- See Also:
-
-
Constructor Details
-
OPAClient
- Throws:
OPASecurityException
-
-
Method Details
-
publish
public String publish(String opaServerUrl, String payload, String credentials) throws OPASecurityException Method to publish the OPA payload to the OPA server- Parameters:
opaServerUrl- The url of the opa serverpayload- The payload of the requestcredentials- Access key of the opa validation request- Returns:
- opa response String
- Throws:
OPASecurityException
-
createHttpClient
public org.apache.http.impl.client.CloseableHttpClient createHttpClient(String url) throws OPASecurityException Return a CloseableHttpClient instance- Parameters:
url- Service endpoint.It can be http/https- Returns:
- CloseableHttpClient
- Throws:
OPASecurityException
-