-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #974 from pulasthi7/revert-05667f52c06feb4714890d7…
…f8f3fcb52ac92ff79 Revert "Merge branch 'master' into master"
- Loading branch information
Showing
2 changed files
with
32 additions
and
117 deletions.
There are no files selected for viewing
65 changes: 0 additions & 65 deletions
65
modules/distribution/conf/policies/authn_role_and_time_based_policy_template.xml
This file was deleted.
Oops, something went wrong.
84 changes: 32 additions & 52 deletions
84
modules/distribution/conf/policies/authn_role_based_policy_template.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,33 @@ | ||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="authn_role_based_policy_template" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0"> | ||
<Description>This policy template provides ability to authorize users to a given service provider(denoted by 'SP_NAME' in the template) in the authentication flow based on the Roles of the user (denoted by 'ROLE_1' and 'ROLE_2' in the template). Users who have allmentioned roles, be allowed and any others will be denied. | ||
</Description> | ||
<Target> | ||
<AnyOf> | ||
<AllOf> | ||
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> | ||
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">travelocity.com</AttributeValue> | ||
<AttributeDesignator AttributeId="http://wso2.org/identity/sp/sp-name" Category="http://wso2.org/identity/sp" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator> | ||
</Match> | ||
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> | ||
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">authenticate</AttributeValue> | ||
<AttributeDesignator AttributeId="http://wso2.org/identity/identity-action/action-name" Category="http://wso2.org/identity/identity-action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator> | ||
</Match> | ||
</AllOf> | ||
</AnyOf> | ||
</Target> | ||
<Rule Effect="Permit" RuleId="permit_by_role"> | ||
<Condition> | ||
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:or"> | ||
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-is-in"> | ||
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ROLE_1</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"></AttributeDesignator> | ||
</Apply> | ||
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-is-in"> | ||
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ROLE_2</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"></AttributeDesignator> | ||
</Apply> | ||
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="authn_role_based_policy_template" | ||
RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0"> | ||
<Description>This policy template provides ability to authorize users to a given service provider(defined by SP_NAME) in the authentication flow based on the roles of the user (defined by ROLE_1 and ROLE_2). Users who have at least one of the given roles, will be allowed and any others will be denied.</Description> | ||
<Target> | ||
<AnyOf> | ||
<AllOf> | ||
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> | ||
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">SP_NAME</AttributeValue> | ||
<AttributeDesignator AttributeId="http://wso2.org/identity/sp/sp-name" Category="http://wso2.org/identity/sp" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> | ||
</Match> | ||
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> | ||
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">authenticate</AttributeValue> | ||
<AttributeDesignator AttributeId="http://wso2.org/identity/identity-action/action-name" Category="http://wso2.org/identity/identity-action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator> | ||
</Match> | ||
</AllOf> | ||
</AnyOf> | ||
</Target> | ||
<Rule Effect="Permit" RuleId="permit_by_roles"> | ||
<Condition> | ||
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:or"> | ||
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-is-in"> | ||
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ROLE_1</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> | ||
<Rule Effect="Deny" RuleId="deny_others"></Rule> | ||
</Policy> | ||
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-is-in"> | ||
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ROLE_2</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> | ||
</Apply> | ||
</Condition> | ||
</Rule> | ||
<Rule Effect="Deny" RuleId="deny_others"/> | ||
</Policy> |