From: Seth P. <se...@us...> - 2004-03-23 23:49:28
|
Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3936/com/sun/xacml/combine Modified Files: DenyOverridesPolicyAlg.java DenyOverridesRuleAlg.java FirstApplicablePolicyAlg.java FirstApplicableRuleAlg.java OnlyOneApplicablePolicyAlg.java PermitOverridesPolicyAlg.java PermitOverridesRuleAlg.java Log Message: changed to always return the resource-id in Results Index: DenyOverridesPolicyAlg.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/DenyOverridesPolicyAlg.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DenyOverridesPolicyAlg.java 17 Mar 2004 18:03:38 -0000 1.4 --- DenyOverridesPolicyAlg.java 23 Mar 2004 23:38:52 -0000 1.5 *************** *** 127,131 **** if (match.getResult() == MatchResult.INDETERMINATE) ! return new Result(Result.DECISION_DENY); if (match.getResult() == MatchResult.MATCH) { --- 127,132 ---- if (match.getResult() == MatchResult.INDETERMINATE) ! return new Result(Result.DECISION_DENY, ! context.getResourceId().encode()); if (match.getResult() == MatchResult.MATCH) { *************** *** 139,142 **** --- 140,144 ---- (effect == Result.DECISION_INDETERMINATE)) return new Result(Result.DECISION_DENY, + context.getResourceId().encode(), result.getObligations()); *************** *** 151,157 **** // if we got a PERMIT, return it, otherwise it's NOT_APPLICABLE if (atLeastOnePermit) ! return new Result(Result.DECISION_PERMIT, permitObligations); else ! return new Result(Result.DECISION_NOT_APPLICABLE); } --- 153,162 ---- // if we got a PERMIT, return it, otherwise it's NOT_APPLICABLE if (atLeastOnePermit) ! return new Result(Result.DECISION_PERMIT, ! context.getResourceId().encode(), ! permitObligations); else ! return new Result(Result.DECISION_NOT_APPLICABLE, ! context.getResourceId().encode()); } Index: FirstApplicableRuleAlg.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/FirstApplicableRuleAlg.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FirstApplicableRuleAlg.java 17 Mar 2004 18:03:38 -0000 1.3 --- FirstApplicableRuleAlg.java 23 Mar 2004 23:38:55 -0000 1.4 *************** *** 117,121 **** // if we got here, then none of the rules applied ! return new Result(Result.DECISION_NOT_APPLICABLE); } --- 117,122 ---- // if we got here, then none of the rules applied ! return new Result(Result.DECISION_NOT_APPLICABLE, ! context.getResourceId().encode()); } Index: FirstApplicablePolicyAlg.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/FirstApplicablePolicyAlg.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FirstApplicablePolicyAlg.java 17 Mar 2004 18:03:38 -0000 1.3 --- FirstApplicablePolicyAlg.java 23 Mar 2004 23:38:55 -0000 1.4 *************** *** 113,117 **** if (match.getResult() == MatchResult.INDETERMINATE) return new Result(Result.DECISION_INDETERMINATE, ! match.getStatus()); if (match.getResult() == MatchResult.MATCH) { --- 113,118 ---- if (match.getResult() == MatchResult.INDETERMINATE) return new Result(Result.DECISION_INDETERMINATE, ! match.getStatus(), ! context.getResourceId().encode()); if (match.getResult() == MatchResult.MATCH) { *************** *** 129,133 **** // if we got here, then none of the rules applied ! return new Result(Result.DECISION_NOT_APPLICABLE); } --- 130,135 ---- // if we got here, then none of the rules applied ! return new Result(Result.DECISION_NOT_APPLICABLE, ! context.getResourceId().encode()); } Index: OnlyOneApplicablePolicyAlg.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/OnlyOneApplicablePolicyAlg.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OnlyOneApplicablePolicyAlg.java 17 Mar 2004 18:03:38 -0000 1.3 --- OnlyOneApplicablePolicyAlg.java 23 Mar 2004 23:38:55 -0000 1.4 *************** *** 119,123 **** if (result == MatchResult.INDETERMINATE) return new Result(Result.DECISION_INDETERMINATE, ! match.getStatus()); if (result == MatchResult.MATCH) { --- 119,124 ---- if (result == MatchResult.INDETERMINATE) return new Result(Result.DECISION_INDETERMINATE, ! match.getStatus(), ! context.getResourceId().encode()); if (result == MatchResult.MATCH) { *************** *** 128,132 **** String message = "Too many applicable policies"; return new Result(Result.DECISION_INDETERMINATE, ! new Status(code, message)); } --- 129,134 ---- String message = "Too many applicable policies"; return new Result(Result.DECISION_INDETERMINATE, ! new Status(code, message), ! context.getResourceId().encode()); } *************** *** 144,148 **** // if we didn't find a matching policy, then we don't apply ! return new Result(Result.DECISION_NOT_APPLICABLE); } --- 146,151 ---- // if we didn't find a matching policy, then we don't apply ! return new Result(Result.DECISION_NOT_APPLICABLE, ! context.getResourceId().encode()); } Index: PermitOverridesRuleAlg.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/PermitOverridesRuleAlg.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PermitOverridesRuleAlg.java 17 Mar 2004 18:03:38 -0000 1.4 --- PermitOverridesRuleAlg.java 23 Mar 2004 23:38:55 -0000 1.5 *************** *** 160,164 **** // we return DENY if (atLeastOneDeny) ! return new Result(Result.DECISION_DENY); // we didn't find anything that said DENY, but if we had a --- 160,165 ---- // we return DENY if (atLeastOneDeny) ! return new Result(Result.DECISION_DENY, ! context.getResourceId().encode()); // we didn't find anything that said DENY, but if we had a *************** *** 169,173 **** // if we hit this point, then none of the rules actually applied // to us, so we return NOT_APPLICABLE ! return new Result(Result.DECISION_NOT_APPLICABLE); } --- 170,175 ---- // if we hit this point, then none of the rules actually applied // to us, so we return NOT_APPLICABLE ! return new Result(Result.DECISION_NOT_APPLICABLE, ! context.getResourceId().encode()); } Index: DenyOverridesRuleAlg.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/DenyOverridesRuleAlg.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DenyOverridesRuleAlg.java 17 Mar 2004 18:03:38 -0000 1.4 --- DenyOverridesRuleAlg.java 23 Mar 2004 23:38:55 -0000 1.5 *************** *** 160,164 **** // we return PERMIT if (atLeastOnePermit) ! return new Result(Result.DECISION_PERMIT); // we didn't find anything that said PERMIT, but if we had a --- 160,165 ---- // we return PERMIT if (atLeastOnePermit) ! return new Result(Result.DECISION_PERMIT, ! context.getResourceId().encode()); // we didn't find anything that said PERMIT, but if we had a *************** *** 169,173 **** // if we hit this point, then none of the rules actually applied // to us, so we return NOT_APPLICABLE ! return new Result(Result.DECISION_NOT_APPLICABLE); } --- 170,175 ---- // if we hit this point, then none of the rules actually applied // to us, so we return NOT_APPLICABLE ! return new Result(Result.DECISION_NOT_APPLICABLE, ! context.getResourceId().encode()); } Index: PermitOverridesPolicyAlg.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/PermitOverridesPolicyAlg.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PermitOverridesPolicyAlg.java 17 Mar 2004 18:03:38 -0000 1.4 --- PermitOverridesPolicyAlg.java 23 Mar 2004 23:38:55 -0000 1.5 *************** *** 159,171 **** // if we got a DENY, return it if (atLeastOneDeny) ! return new Result(Result.DECISION_DENY, denyObligations); // if we got an INDETERMINATE, return it if (atLeastOneError) return new Result(Result.DECISION_INDETERMINATE, ! firstIndeterminateStatus); // if we got here, then nothing applied to us ! return new Result(Result.DECISION_NOT_APPLICABLE); } --- 159,175 ---- // if we got a DENY, return it if (atLeastOneDeny) ! return new Result(Result.DECISION_DENY, ! context.getResourceId().encode(), ! denyObligations); // if we got an INDETERMINATE, return it if (atLeastOneError) return new Result(Result.DECISION_INDETERMINATE, ! firstIndeterminateStatus, ! context.getResourceId().encode()); // if we got here, then nothing applied to us ! return new Result(Result.DECISION_NOT_APPLICABLE, ! context.getResourceId().encode()); } |