[java-opensaml2 COMMIT] in /branches/REL_2: doc/RELEASE-NOTES.txt src/main/java/org/opensaml/saml2/core/impl/AuthzDec...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Jan 15 14:20:17 EST 2016
Author: putmanb
Date: Fri Jan 15 14:20:16 2016
New Revision: 1690
URL: http://svn.shibboleth.net/view/java-opensaml2?rev=1690&view=rev
Log:
JOST-242: Resource required to be non-empty in AuthzDecisionStatement
Modified:
branches/REL_2/doc/RELEASE-NOTES.txt
branches/REL_2/src/main/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementImpl.java
branches/REL_2/src/main/java/org/opensaml/saml2/core/validator/AuthzDecisionStatementSchemaValidator.java
branches/REL_2/src/test/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementTest.java
branches/REL_2/src/test/java/org/opensaml/saml2/core/validator/AuthzDecisionStatementSchemaTest.java
Modified: branches/REL_2/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-opensaml2/branches/REL_2/doc/RELEASE-NOTES.txt?rev=1690&r1=1689&r2=1690&view=diff
==============================================================================
--- branches/REL_2/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_2/doc/RELEASE-NOTES.txt Fri Jan 15 14:20:16 2016
@@ -1,5 +1,6 @@
Changes in Release 2.6.6
=============================================
+[JOST-242] - Resource required to be non-empty in AuthzDecisionStatement
[JOST-243] - Metadata reload errors logged on DEBUG only
[JOST-244] - durations in log messages should be given in ISO format, not milliseconds
[JOST-245] - BaseSAML2MessageDecoder tries to get SAML1 role descriptor
Modified: branches/REL_2/src/main/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementImpl.java
URL: http://svn.shibboleth.net/view/java-opensaml2/branches/REL_2/src/main/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementImpl.java?rev=1690&r1=1689&r2=1690&view=diff
==============================================================================
--- branches/REL_2/src/main/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementImpl.java (original)
+++ branches/REL_2/src/main/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementImpl.java Fri Jan 15 14:20:16 2016
@@ -69,7 +69,7 @@
/** {@inheritDoc} */
public void setResource(String newResourceURI) {
- this.resource = prepareForAssignment(this.resource, newResourceURI);
+ this.resource = prepareForAssignment(this.resource, newResourceURI, false);
}
/** {@inheritDoc} */
Modified: branches/REL_2/src/main/java/org/opensaml/saml2/core/validator/AuthzDecisionStatementSchemaValidator.java
URL: http://svn.shibboleth.net/view/java-opensaml2/branches/REL_2/src/main/java/org/opensaml/saml2/core/validator/AuthzDecisionStatementSchemaValidator.java?rev=1690&r1=1689&r2=1690&view=diff
==============================================================================
--- branches/REL_2/src/main/java/org/opensaml/saml2/core/validator/AuthzDecisionStatementSchemaValidator.java (original)
+++ branches/REL_2/src/main/java/org/opensaml/saml2/core/validator/AuthzDecisionStatementSchemaValidator.java Fri Jan 15 14:20:16 2016
@@ -50,7 +50,7 @@
* @throws ValidationException
*/
protected void validateResource(AuthzDecisionStatement authzDS) throws ValidationException {
- if (DatatypeHelper.isEmpty(authzDS.getResource())) {
+ if (authzDS.getResource() == null) {
throw new ValidationException("Resource required");
}
}
@@ -78,4 +78,4 @@
throw new ValidationException("One or more Actions required");
}
}
-}
+}
Modified: branches/REL_2/src/test/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementTest.java
URL: http://svn.shibboleth.net/view/java-opensaml2/branches/REL_2/src/test/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementTest.java?rev=1690&r1=1689&r2=1690&view=diff
==============================================================================
--- branches/REL_2/src/test/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementTest.java (original)
+++ branches/REL_2/src/test/java/org/opensaml/saml2/core/impl/AuthzDecisionStatementTest.java Fri Jan 15 14:20:16 2016
@@ -116,4 +116,19 @@
assertEquals(expectedChildElementsDOM, authzDecisionStatement);
}
+
+ public void testResource() {
+ AuthzDecisionStatement authzDecisionStatement = (AuthzDecisionStatement) buildXMLObject(AuthzDecisionStatement.DEFAULT_ELEMENT_NAME);
+
+ authzDecisionStatement.setResource("urn:test:foo");
+ assertEquals("urn:test:foo", authzDecisionStatement.getResource());
+
+ authzDecisionStatement.setResource("");
+ assertEquals("", authzDecisionStatement.getResource());
+
+ // 3 spaces
+ authzDecisionStatement.setResource(" ");
+ assertEquals(" ", authzDecisionStatement.getResource());
+ }
+
}
Modified: branches/REL_2/src/test/java/org/opensaml/saml2/core/validator/AuthzDecisionStatementSchemaTest.java
URL: http://svn.shibboleth.net/view/java-opensaml2/branches/REL_2/src/test/java/org/opensaml/saml2/core/validator/AuthzDecisionStatementSchemaTest.java?rev=1690&r1=1689&r2=1690&view=diff
==============================================================================
[... 22 lines stripped ...]
More information about the commits
mailing list