Search in sources :

Example 1 with EntitlementServiceClient

use of org.wso2.identity.integration.common.clients.entitlement.EntitlementServiceClient in project product-is by wso2.

the class EntitlementPIPAttributeCacheTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    scm = new ServerConfigurationManager(isServer);
    entitlementPolicyClient = new EntitlementPolicyServiceClient(backendURL, sessionCookie);
    addPolicy();
    addCustomAttributeFinder();
    // call super init since server restart happens in previous step
    super.init();
    entitlementServiceClient = new EntitlementServiceClient(backendURL, sessionCookie);
}
Also used : EntitlementServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementServiceClient) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) EntitlementPolicyServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with EntitlementServiceClient

use of org.wso2.identity.integration.common.clients.entitlement.EntitlementServiceClient in project carbon-apimgt by wso2.

the class XACMLAuthenticationInterceptor method isUserPermitted.

private boolean isUserPermitted(String userName, String resource, String httpMethod, String[] arr) {
    try {
        String status;
        EntitlementServiceClient client = new EntitlementServiceClient();
        status = client.validateAction(userName, resource, httpMethod, arr);
        // TODO this permit need to be replaced with XACML constant for permitted.
        if (status.equalsIgnoreCase("Permit")) {
            return true;
        }
    } catch (Exception e) {
        logger.error("Error while validating XACML request" + e);
    }
    return false;
}
Also used : EntitlementServiceClient(org.wso2.carbon.apimgt.rest.api.util.utils.EntitlementServiceClient)

Example 3 with EntitlementServiceClient

use of org.wso2.identity.integration.common.clients.entitlement.EntitlementServiceClient in project product-is by wso2.

the class EntitlementServiceTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    entitlementPolicyClient = new EntitlementPolicyServiceClient(backendURL, sessionCookie);
    entitlementServiceClient = new EntitlementServiceClient(backendURL, sessionCookie);
    userProfileMgtClient = new UserProfileMgtServiceClient(backendURL, sessionCookie);
}
Also used : UserProfileMgtServiceClient(org.wso2.identity.integration.common.clients.UserProfileMgtServiceClient) EntitlementServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementServiceClient) EntitlementPolicyServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

BeforeClass (org.testng.annotations.BeforeClass)2 EntitlementPolicyServiceClient (org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient)2 EntitlementServiceClient (org.wso2.identity.integration.common.clients.entitlement.EntitlementServiceClient)2 EntitlementServiceClient (org.wso2.carbon.apimgt.rest.api.util.utils.EntitlementServiceClient)1 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)1 UserProfileMgtServiceClient (org.wso2.identity.integration.common.clients.UserProfileMgtServiceClient)1