Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3936/com/sun/xacml
Modified Files:
PDP.java PolicyReference.java Rule.java
Log Message:
changed to always return the resource-id in Results
Index: Rule.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/Rule.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Rule.java 17 Mar 2004 18:03:37 -0000 1.5
--- Rule.java 23 Mar 2004 23:38:51 -0000 1.6
***************
*** 269,283 ****
// if the target didn't match, then this Rule doesn't apply
if (result == MatchResult.NO_MATCH)
! return new Result(Result.DECISION_NOT_APPLICABLE);
// if the target was indeterminate, we can't go on
if (result == MatchResult.INDETERMINATE)
return new Result(Result.DECISION_INDETERMINATE,
! match.getStatus());
}
// if there's no condition, then we just return the effect...
if (condition == null)
! return new Result(effectAttr);
// ...otherwise we evaluate the condition
--- 269,285 ----
// if the target didn't match, then this Rule doesn't apply
if (result == MatchResult.NO_MATCH)
! return new Result(Result.DECISION_NOT_APPLICABLE,
! context.getResourceId().encode());
// if the target was indeterminate, we can't go on
if (result == MatchResult.INDETERMINATE)
return new Result(Result.DECISION_INDETERMINATE,
! match.getStatus(),
! context.getResourceId().encode());
}
// if there's no condition, then we just return the effect...
if (condition == null)
! return new Result(effectAttr, context.getResourceId().encode());
// ...otherwise we evaluate the condition
***************
*** 287,291 ****
// if it was INDETERMINATE, then that's what we return
return new Result(Result.DECISION_INDETERMINATE,
! result.getStatus());
} else {
// otherwise we return the effect on tue, and NA on false
--- 289,294 ----
// if it was INDETERMINATE, then that's what we return
return new Result(Result.DECISION_INDETERMINATE,
! result.getStatus(),
! context.getResourceId().encode());
} else {
// otherwise we return the effect on tue, and NA on false
***************
*** 294,300 ****
if (bool.getValue())
! return new Result(effectAttr);
else
! return new Result(Result.DECISION_NOT_APPLICABLE);
}
}
--- 297,305 ----
if (bool.getValue())
! return new Result(effectAttr,
! context.getResourceId().encode());
else
! return new Result(Result.DECISION_NOT_APPLICABLE,
! context.getResourceId().encode());
}
}
Index: PDP.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/PDP.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PDP.java 17 Mar 2004 18:03:37 -0000 1.3
--- PDP.java 23 Mar 2004 23:38:51 -0000 1.4
***************
*** 123,127 ****
return new ResponseCtx(new Result(Result.DECISION_INDETERMINATE,
! status));
}
--- 123,129 ----
return new ResponseCtx(new Result(Result.DECISION_INDETERMINATE,
! status,
! context.getResourceId().
! encode()));
}
***************
*** 148,152 ****
return new
ResponseCtx(new Result(Result.DECISION_INDETERMINATE,
! new Status(code, msg)));
}
--- 150,155 ----
return new
ResponseCtx(new Result(Result.DECISION_INDETERMINATE,
! new Status(code, msg),
! context.getResourceId().encode()));
}
***************
*** 204,208 ****
if (finderResult.notApplicable()) {
System.err.println("couldn't find an applicable policy");
! return new Result(Result.DECISION_NOT_APPLICABLE);
}
--- 207,212 ----
if (finderResult.notApplicable()) {
System.err.println("couldn't find an applicable policy");
! return new Result(Result.DECISION_NOT_APPLICABLE,
! context.getResourceId().encode());
}
***************
*** 211,215 ****
System.err.println("error in trying to find top-level policy");
return new Result(Result.DECISION_INDETERMINATE,
! finderResult.getStatus());
}
--- 215,220 ----
System.err.println("error in trying to find top-level policy");
return new Result(Result.DECISION_INDETERMINATE,
! finderResult.getStatus(),
! context.getResourceId().encode());
}
Index: PolicyReference.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/PolicyReference.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PolicyReference.java 17 Mar 2004 18:03:37 -0000 1.5
--- PolicyReference.java 23 Mar 2004 23:38:51 -0000 1.6
***************
*** 301,305 ****
// if there is no finder, then we return NotApplicable
if (finder == null)
! return new Result(Result.DECISION_NOT_APPLICABLE);
PolicyFinderResult pfr = finder.findPolicy(reference, policyType);
--- 301,306 ----
// if there is no finder, then we return NotApplicable
if (finder == null)
! return new Result(Result.DECISION_NOT_APPLICABLE,
! context.getResourceId().encode());
PolicyFinderResult pfr = finder.findPolicy(reference, policyType);
***************
*** 307,315 ****
// if we found nothing, then we return NotApplicable
if (pfr.notApplicable())
! return new Result(Result.DECISION_NOT_APPLICABLE);
// if there was an error, we return that status data
if (pfr.indeterminate())
! return new Result(Result.DECISION_INDETERMINATE, pfr.getStatus());
// we must have found a policy
--- 308,318 ----
// if we found nothing, then we return NotApplicable
if (pfr.notApplicable())
! return new Result(Result.DECISION_NOT_APPLICABLE,
! context.getResourceId().encode());
// if there was an error, we return that status data
if (pfr.indeterminate())
! return new Result(Result.DECISION_INDETERMINATE, pfr.getStatus(),
! context.getResourceId().encode());
// we must have found a policy
|