XACMLPoliciesApi


Get policy partial details

Get policy partial.

URL

http://apis.wso2.com/api/appm/publisher/v1.1/administration/xacmlpolicies/{policyPartialId}

HTTP Method

GET

Scope

appm:administration

CURL Example

curl -X GET -H "Authorization: Bearer 5e3e12917945881407eaad1868ea4629" "http://localhost:9763/api/appm/publisher/v1.1/administration/xacmlpolicies/40"

Sample Response

{"policyPartial": "<Rule Effect="Permit" RuleId="Rule001"><Condition> <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of"> <Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"/> <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">admin</AttributeValue> <AttributeDesignator AttributeId="http://wso2.org/claims/role" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> </Apply> </Condition> </Rule>","policyPartialName": "ddd","isSharedPartial": true,"policyPartialDesc": null,"policyPartialIc": 2}

Parameters

Type Name Description Schema Default
Path

policyPartialId

required

Policy partial ID

Integer

Header

Accept

optional

Media types acceptable for the response. Default is JSON.

String

JSON

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource.

String

Header

If-Modified-Since

optional

Validator for conditional requests; based on the Last Modified header of the formerly retrieved variant of the resource.

String

Responses

HTTP Code Description Schema

200

OK. Qualifying App is returned.

PolicyPartial

400

Bad Request. Invalid request or validation error.

Error

403

Forbidden. The request must be conditional but no condition has been specified.

Error

404

Not Found. The resource to be updated does not exist.

Error

Update an existing policy partial

Update an existing policy partial

URL

http://apis.wso2.com/api/appm/publisher/v1.1/administration/xacmlpolicies/{policyPartialId}

HTTP Method

PUT

Scope

appm:administration

CURL Example

curl -X PUT -H "Authorization: Bearer 28bc70efa75175336e177d88e148c46d" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 02ec508b-85ef-c4fa-5cb3-e5b4ab440948" -d '{"isSharedPartial":true,"policyPartialDesc":"asdasdasdadsad","policyPartial":"<Rule Effect=\"Permit\" RuleId=\"Rule001\"><Condition>\n <Apply FunctionId=\"urn:oasis:names:tc:xacml:1.0:function:any-of\">\n <Function FunctionId=\"urn:oasis:names:tc:xacml:1.0:function:string-equal\"/>\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">admin</AttributeValue>\n <AttributeDesignator AttributeId=\"http://wso2.org/claims/role\" Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\" MustBePresent=\"true\"/>\n </Apply>\n</Condition>\n</Rule>","policyPartialName":"asdasd","policyPartialId":1}' "http://localhost:9763/api/appm/publisher/v1.1/administration/xacmlpolicies/1"

Sample Request

{"policyPartial": "<Rule Effect="Permit" RuleId="Rule001"><Condition> <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of"> <Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"/> <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">admin</AttributeValue> <AttributeDesignator AttributeId="http://wso2.org/claims/role" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> </Apply> </Condition> </Rule>","policyPartialName": "ddd","isSharedPartial": true,"policyPartialDesc": null}

Sample Response

HTTP/1.1 200 OK

Parameters

Type Name Description Schema Default
Path

policyPartialId

required

Policy partial ID

Integer

Body

body

required

App object that needs to be added.

PolicyPartial (PolicyPartial)

Header

Content-Type

required

Media type of the entity in the body. Default is JSON.

String

JSON

Header

If-Match

optional

Validator for conditional requests; based on the ETag.

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on the Last Modified header.

String

Responses

HTTP Code Description Schema

200

OK.

400

Bad Request. Invalid request or validation error.

Error

403

Forbidden. The request must be conditional but no condition has been specified.

Error

404

Not Found. The resource to be updated does not exist.

Error

412

Precondition Failed. The request has not been performed because one of the preconditions is not met.

Error

Create a new Policy Partial

Create a new Policy Partial.

URL

http://apis.wso2.com/api/appm/publisher/v1.1/administration/xacmlpolicies/

HTTP Method

POST

Scope

appm:administration

CURL Example

curl -X POST -H "Authorization: Bearer 28bc70efa75175336e177d88e148c46d" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 02ec508b-85ef-c4fa-5cb3-e5b4ab440948" -d '{"isSharedPartial":true,"policyPartialDesc":"asdasdasdadsad","policyPartial":"<Rule Effect=\"Permit\" RuleId=\"Rule001\"><Condition>\n <Apply FunctionId=\"urn:oasis:names:tc:xacml:1.0:function:any-of\">\n <Function FunctionId=\"urn:oasis:names:tc:xacml:1.0:function:string-equal\"/>\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">admin</AttributeValue>\n <AttributeDesignator AttributeId=\"http://wso2.org/claims/role\" Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\" MustBePresent=\"true\"/>\n </Apply>\n</Condition>\n</Rule>","policyPartialName":"asdasd","policyPartialId":1}' "http://localhost:9763/api/appm/publisher/v1.1/administration/xacmlpolicies/"

Sample Request

{"policyPartial": "<Rule Effect="Permit" RuleId="Rule001"><Condition> <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of"> <Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"/> <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">admin</AttributeValue> <AttributeDesignator AttributeId="http://wso2.org/claims/role" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> </Apply> </Condition> </Rule>","policyPartialName": "ddd","isSharedPartial": true,"policyPartialDesc": null}

Sample Response

{"policyPartial": "<Rule Effect="Permit" RuleId="Rule001"><Condition> <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of"> <Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"/> <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">admin</AttributeValue> <AttributeDesignator AttributeId="http://wso2.org/claims/role" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> </Apply> </Condition> </Rule>","policyPartialName": "ddd","isSharedPartial": true,"policyPartialDesc": null,"policyPartialIc": 2}

Parameters

Type Name Description Schema Default
Body

body

required

Policy Partial object that needs to be added.

PolicyPartial (PolicyPartial)

Header

Content-Type

required

Media type of the entity in the body. Default is JSON.

String

JSON

Header

If-Modified-Since

optional

Validator for conditional requests; based on the Last Modified header of the formerly retrieved variant of the resource.

String

Responses

HTTP Code Description Schema

201

Created. Successful response with the newly created object as the entity in the body. Location header contains the URL of the newly created entity.

PolicyPartial

400

Bad Request. Invalid request or validation error.

Error

415

Unsupported Media Type. The entity of the request was in an unsupported format.

Error

Validate policy content

Validates the content of the policy.

URL

http://apis.wso2.com/api/appm/publisher/v1.1/administration/xacmlpolicies/validate

HTTP Method

POST

Scope

appm:administration

CURL Example

curl -X POST -H "Authorization: Bearer 04b1607a56c2d51adb35912943335322" -H "Content-Type: application/json" -d '{ "policyPartial": "<Condition>\n <Apply FunctionId=\"urn:oasis:names:tc:xacml:1.0:function:any-of\">\n <Function FunctionId=\"urn:oasis:names:tc:xacml:1.0:function:string-equal\"/>\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">admin</AttributeValue>\n <AttributeDesignator AttributeId=\"http://wso2.org/claims/role\" Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\" MustBePresent=\"true\"/>\n </Apply>\n</Condition>"}' "http://localhost:9763/api/appm/publisher/v1.1/administration/xacmlpolicies/validate"

Sample Request

{"policyPartial": "<Rule Effect="Permit" RuleId="Rule001"><Condition> <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of"> <Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"/> <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">admin</AttributeValue> <AttributeDesignator AttributeId="http://wso2.org/claims/role" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> </Apply> </Condition></Rule>"}

Sample Response

HTTP/1.1 200 OK

Parameters

Type Name Description Schema Default
Body

body

required

Policy Partial object that needs to be added.

PolicyPartial (PolicyPartial)

Header

Content-Type

required

Media type of the entity in the body. Default is JSON.

String

JSON

Header

If-Modified-Since

optional

Validator for conditional requests; based on the Last Modified header of the formerly retrieved variant of the resource.

String

Responses

HTTP Code Description Schema

200

OK.

400

Bad Request. Invalid request or validation error.

Error

415

Unsupported Media Type. The entity of the request was in an unsupported format.

Error

Get all XACML policies

Get a list of XACML policies.

URL

http://apis.wso2.com/api/appm/publisher/v1.1/xacmlpolicies/

HTTP Method

GET

Scope

appm:create

CURL Example

curl -X GET -H "Authorization: Bearer e819870696cc39494d12841b5094a411" "http://localhost:9763/api/appm/publisher/v1.1/xacmlpolicies"

Sample Response

{"policyPartial": "<Rule Effect="Permit" RuleId="Rule001"><Condition> <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of"> <Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"/> <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">admin</AttributeValue> <AttributeDesignator AttributeId="http://wso2.org/claims/role" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> </Apply> </Condition> </Rule>","policyPartialName": policy1,"isSharedPartial": true,"policyPartialDesc": null,,"policyPartialId": 1}

Parameters

Type Name Description Schema Default
Query

limit

optional

Maximum size of resource array to return.

Integer

25

Query

offset

optional

Starting point within the complete list of items qualified.

Integer

0

Header

Accept

optional

Media types acceptable for the response. Default is JSON.

String

JSON

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource.

String

Responses

HTTP Code Description Schema

200

OK. List of XACML policies is returned.

PolicyPartialList

400

Bad Request. Invalid request or validation error.

Error

403

Forbidden. The request must be conditional but no condition has been specified.

Error

404

Not Found. The resource to be updated does not exist.

Error