Permalink
Browse files

no real advantage to using URL versus String for message parameters

git-svn-id: file:///Users/willnorris/Projects/svn-import/java-openid/trunk@94 eae3f9c0-6542-46b9-8785-326aab784c2f
  • Loading branch information...
1 parent 265d0ef commit 0bc4634c1ce0cc60b63d878b354b177d49ad5e0a @willnorris committed Nov 12, 2009
Showing with 83 additions and 161 deletions.
  1. +2 −3 src/main/java/edu/internet2/middleware/openid/extensions/ax/FetchRequest.java
  2. +2 −3 src/main/java/edu/internet2/middleware/openid/extensions/ax/FetchResponse.java
  3. +3 −4 src/main/java/edu/internet2/middleware/openid/extensions/ax/impl/FetchRequestImpl.java
  4. +2 −3 src/main/java/edu/internet2/middleware/openid/extensions/ax/impl/FetchRequestMarshaller.java
  5. +2 −8 src/main/java/edu/internet2/middleware/openid/extensions/ax/impl/FetchRequestUnmarshaller.java
  6. +3 −4 src/main/java/edu/internet2/middleware/openid/extensions/ax/impl/FetchResponseImpl.java
  7. +2 −3 src/main/java/edu/internet2/middleware/openid/extensions/ax/impl/FetchResponseMarshaller.java
  8. +1 −7 src/main/java/edu/internet2/middleware/openid/extensions/ax/impl/FetchResponseUnmarshaller.java
  9. +2 −4 ...ain/java/edu/internet2/middleware/openid/extensions/sreg/SimpleRegistrationMessageMarshaller.java
  10. +1 −11 ...n/java/edu/internet2/middleware/openid/extensions/sreg/SimpleRegistrationMessageUnmarshaller.java
  11. +2 −3 src/main/java/edu/internet2/middleware/openid/extensions/sreg/SimpleRegistrationRequest.java
  12. +3 −4 ...main/java/edu/internet2/middleware/openid/extensions/sreg/impl/SimpleRegistrationRequestImpl.java
  13. +2 −4 src/main/java/edu/internet2/middleware/openid/message/AuthenticationRequest.java
  14. +2 −4 src/main/java/edu/internet2/middleware/openid/message/PositiveAssertion.java
  15. +2 −4 src/main/java/edu/internet2/middleware/openid/message/VerifyRequest.java
  16. +3 −3 src/main/java/edu/internet2/middleware/openid/message/impl/AuthenticationRequestImpl.java
  17. +1 −1 src/main/java/edu/internet2/middleware/openid/message/impl/AuthenticationRequestMarshaller.java
  18. +1 −9 src/main/java/edu/internet2/middleware/openid/message/impl/AuthenticationRequestUnmarshaller.java
  19. +3 −5 src/main/java/edu/internet2/middleware/openid/message/impl/PositiveAssertionImpl.java
  20. +1 −1 src/main/java/edu/internet2/middleware/openid/message/impl/PositiveAssertionMarshaller.java
  21. +1 −9 src/main/java/edu/internet2/middleware/openid/message/impl/PositiveAssertionUnmarshaller.java
  22. +3 −6 src/main/java/edu/internet2/middleware/openid/message/impl/VerifyRequestImpl.java
  23. +1 −1 src/main/java/edu/internet2/middleware/openid/message/impl/VerifyRequestMarshaller.java
  24. +1 −9 src/main/java/edu/internet2/middleware/openid/message/impl/VerifyRequestUnmarshaller.java
  25. +5 −6 src/test/java/edu/internet2/middleware/openid/extensions/ax/FetchRequestTest.java
  26. +5 −6 src/test/java/edu/internet2/middleware/openid/extensions/ax/FetchResponseTest.java
  27. +5 −6 src/test/java/edu/internet2/middleware/openid/extensions/sreg/SimpleRegistrationRequestTest.java
  28. +5 −7 src/test/java/edu/internet2/middleware/openid/message/AuthenticationImmediateRequestTest.java
  29. +5 −7 src/test/java/edu/internet2/middleware/openid/message/AuthenticationInteractiveRequestTest.java
  30. +5 −6 src/test/java/edu/internet2/middleware/openid/message/PositiveAssertionTest.java
  31. +5 −7 src/test/java/edu/internet2/middleware/openid/message/VerifyRequestTest.java
  32. +2 −3 src/test/java/edu/internet2/middleware/openid/security/SecurityUtilsTest.java
@@ -16,7 +16,6 @@
package edu.internet2.middleware.openid.extensions.ax;
-import java.net.URL;
import java.util.List;
import java.util.Map;
@@ -56,13 +55,13 @@
*
* @return the update URL
*/
- public URL getUpdateURL();
+ public String getUpdateURL();
/**
* Set the update URL.
*
* @param newURL the update URL
*/
- public void setUpdateURL(URL newURL);
+ public void setUpdateURL(String newURL);
}
@@ -16,7 +16,6 @@
package edu.internet2.middleware.openid.extensions.ax;
-import java.net.URL;
import java.util.List;
import java.util.Map;
@@ -42,13 +41,13 @@
*
* @return the update URL
*/
- public URL getUpdateURL();
+ public String getUpdateURL();
/**
* Set update URL.
*
* @param newURL new URL
*/
- public void setUpdateURL(URL newURL);
+ public void setUpdateURL(String newURL);
}
@@ -16,7 +16,6 @@
package edu.internet2.middleware.openid.extensions.ax.impl;
-import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -47,7 +46,7 @@
/**
* Update URL.
*/
- private URL updateURL;
+ private String updateURL;
/**
* Constructor.
@@ -79,12 +78,12 @@ public String getMode() {
}
/** {@inheritDoc} */
- public URL getUpdateURL() {
+ public String getUpdateURL() {
return updateURL;
}
/** {@inheritDoc} */
- public void setUpdateURL(URL newUpdateURL) {
+ public void setUpdateURL(String newUpdateURL) {
updateURL = newUpdateURL;
}
@@ -16,7 +16,6 @@
package edu.internet2.middleware.openid.extensions.ax.impl;
-import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -42,9 +41,9 @@ public void marshall(FetchRequest request, ParameterMap parameters) {
types.setAliasPrefix(AttributeExchange.ALIAS_PREFIX);
// update URL
- URL policyURL = request.getUpdateURL();
+ String policyURL = request.getUpdateURL();
if (policyURL != null) {
- parameters.put(Parameter.update_url.QNAME, policyURL.toString());
+ parameters.put(Parameter.update_url.QNAME, policyURL);
}
// required attributes
@@ -16,9 +16,6 @@
package edu.internet2.middleware.openid.extensions.ax.impl;
-import java.net.MalformedURLException;
-import java.net.URL;
-
import javax.xml.namespace.QName;
import org.slf4j.Logger;
@@ -66,11 +63,8 @@ public void unmarshall(FetchRequest request, ParameterMap parameters) {
String updateURL = parameters.get(Parameter.update_url.QNAME);
if (!DatatypeHelper.isEmpty(updateURL)) {
- try {
- request.setUpdateURL(new URL(updateURL));
- } catch (MalformedURLException e) {
- log.warn("Attribute Exchange update_url malformed: '{}'", updateURL);
- }
+ request.setUpdateURL(updateURL);
+
}
}
@@ -16,7 +16,6 @@
package edu.internet2.middleware.openid.extensions.ax.impl;
-import java.net.URL;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -36,7 +35,7 @@
/**
* Update URL.
*/
- private URL updateURL;
+ private String updateURL;
/**
* Constructor.
@@ -56,12 +55,12 @@ public String getMode() {
}
/** {@inheritDoc} */
- public URL getUpdateURL() {
+ public String getUpdateURL() {
return updateURL;
}
/** {@inheritDoc} */
- public void setUpdateURL(URL newUpdateURL) {
+ public void setUpdateURL(String newUpdateURL) {
updateURL = newUpdateURL;
}
@@ -16,7 +16,6 @@
package edu.internet2.middleware.openid.extensions.ax.impl;
-import java.net.URL;
import java.util.List;
import java.util.Map;
@@ -41,9 +40,9 @@ public void marshall(FetchResponse response, ParameterMap parameters) {
types.setAliasPrefix(AttributeExchange.ALIAS_PREFIX);
// update URL
- URL policyURL = response.getUpdateURL();
+ String policyURL = response.getUpdateURL();
if (policyURL != null) {
- parameters.put(Parameter.update_url.QNAME, policyURL.toString());
+ parameters.put(Parameter.update_url.QNAME, policyURL);
}
// attributes
@@ -16,8 +16,6 @@
package edu.internet2.middleware.openid.extensions.ax.impl;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
@@ -47,11 +45,7 @@ public void unmarshall(FetchResponse response, ParameterMap parameters) {
String updateURL = parameters.get(Parameter.update_url.QNAME);
if (!DatatypeHelper.isEmpty(updateURL)) {
- try {
- response.setUpdateURL(new URL(updateURL));
- } catch (MalformedURLException e) {
- log.warn("Attribute Exchange update_url malformed: '{}'", updateURL);
- }
+ response.setUpdateURL(updateURL);
}
// get all the attribute types
@@ -16,8 +16,6 @@
package edu.internet2.middleware.openid.extensions.sreg;
-import java.net.URL;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -60,9 +58,9 @@ protected void marshall(SimpleRegistrationRequest request, ParameterMap paramete
log.debug("marshalling simple registration request");
// policy URL
- URL policyURL = request.getPolicyURL();
+ String policyURL = request.getPolicyURL();
if (policyURL != null) {
- parameters.put(Parameter.policy_url.QNAME, policyURL.toString());
+ parameters.put(Parameter.policy_url.QNAME, policyURL);
}
// required parameters
@@ -16,9 +16,6 @@
package edu.internet2.middleware.openid.extensions.sreg;
-import java.net.MalformedURLException;
-import java.net.URL;
-
import javax.xml.namespace.QName;
import org.slf4j.Logger;
@@ -61,14 +58,7 @@ public SimpleRegistrationMessage unmarshall(ParameterMap parameters) throws Unma
* @throws UnmarshallingException thrown if an error occurs unmarshalling the message extension from the map
*/
public void unmarshall(SimpleRegistrationRequest request, ParameterMap parameters) throws UnmarshallingException {
- String policyURL = parameters.get(Parameter.policy_url.QNAME);
- if (!DatatypeHelper.isEmpty(policyURL)) {
- try {
- request.setPolicyURL(new URL(policyURL));
- } catch (MalformedURLException e) {
- // TODO
- }
- }
+ request.setPolicyURL(parameters.get(Parameter.policy_url.QNAME));
String optional = parameters.get(Parameter.optional.QNAME);
if (!DatatypeHelper.isEmpty(optional)) {
@@ -16,7 +16,6 @@
package edu.internet2.middleware.openid.extensions.sreg;
-import java.net.URL;
import java.util.EnumSet;
import edu.internet2.middleware.openid.extensions.sreg.SimpleRegistration.Field;
@@ -48,12 +47,12 @@
*
* @return the policy URL
*/
- public URL getPolicyURL();
+ public String getPolicyURL();
/**
* Set the policy URL.
*
* @param policyURL the policy URL
*/
- public void setPolicyURL(URL policyURL);
+ public void setPolicyURL(String policyURL);
}
@@ -16,7 +16,6 @@
package edu.internet2.middleware.openid.extensions.sreg.impl;
-import java.net.URL;
import java.util.EnumSet;
import edu.internet2.middleware.openid.extensions.sreg.SimpleRegistration;
@@ -41,7 +40,7 @@
/**
* Policy URL.
*/
- private URL policyURL;
+ private String policyURL;
/**
* Default constructor.
@@ -68,12 +67,12 @@ public String getNamespace() {
}
/** {@inheritDoc} */
- public URL getPolicyURL() {
+ public String getPolicyURL() {
return policyURL;
}
/** {@inheritDoc} */
- public void setPolicyURL(URL newPolicyURL) {
+ public void setPolicyURL(String newPolicyURL) {
policyURL = newPolicyURL;
}
@@ -16,8 +16,6 @@
package edu.internet2.middleware.openid.message;
-import java.net.URL;
-
/**
* OpenID authentication request.
*/
@@ -82,14 +80,14 @@
*
* @return the return-to URL
*/
- public URL getReturnTo();
+ public String getReturnTo();
/**
* Set the return to URL.
*
* @param newReturnTo the return to URL
*/
- public void setReturnTo(URL newReturnTo);
+ public void setReturnTo(String newReturnTo);
/**
* Get the URL pattern the OpenID Provider should ask the end user to trust.
@@ -16,8 +16,6 @@
package edu.internet2.middleware.openid.message;
-import java.net.URL;
-
/**
* Response to an authentication request indicating that the OpenID Provider was successfully able to authenticate the
* end user.
@@ -76,14 +74,14 @@
*
* @return return-to URL
*/
- public URL getReturnTo();
+ public String getReturnTo();
/**
* Set the return to URL.
*
* @param newReturnTo the return to URL
*/
- public void setReturnTo(URL newReturnTo);
+ public void setReturnTo(String newReturnTo);
/**
* Unique nonce for this response.
@@ -16,8 +16,6 @@
package edu.internet2.middleware.openid.message;
-import java.net.URL;
-
/**
* Request to verify a positive authentication assertion. All of the data from the assertion to be verified is included
* in the verification request.
@@ -76,14 +74,14 @@
*
* @return return-to URL
*/
- public URL getReturnTo();
+ public String getReturnTo();
/**
* Set the return to URL.
*
* @param newReturnTo the return to URL
*/
- public void setReturnTo(URL newReturnTo);
+ public void setReturnTo(String newReturnTo);
/**
* Unique nonce for this response.
Oops, something went wrong.

0 comments on commit 0bc4634

Please sign in to comment.