-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OICMSG interfaces, abstract class, enums #1
base: master
Are you sure you want to change the base?
Conversation
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add class level javadoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,180 @@ | |||
package com.auth0.msg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to check with Lee what package name we should use.. I don't think we will use com.auth0
* @param urlEncoded the urlEncoded String representation of a message | ||
* @return a map of the key value pairs encoded in the string parameter | ||
*/ | ||
private static Map<String, Object> claimsFromUrlEncoded(String urlEncoded) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a private static method in an abstract class doesn't make sense. No other class will see this method at all. If it is an utility method - create a new class MessageUtil and there you add it as a public static method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
*/ | ||
public String toUrlEncoded() { | ||
// Serialize the content of this instance (the claims map) into an UrlEncoded string | ||
return ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add TODOs - so that we don't we don't miss out anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
|
||
/** | ||
* Logic to extract from the string the values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please update the javadoc to mention json string?
* | ||
* @return a JSON String representation in the form of a hashMap mapping string -> string | ||
*/ | ||
public String toJson() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the 'to' methods toJson, toJwt and toUrlEncoded, show have throws SerializationException
so that caller will know that it can happen and can handle it.
/** | ||
* @param input the jwt String representation of a message | ||
* @param Key that might contain the necessary key | ||
* @return a ResponseMessage representation of the JWT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update ResponseMessage to Message everywhere in this class
@@ -0,0 +1,11 @@ | |||
package com.auth0.msg; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add javadoc. Also Justin and you should share the enum Algorithm enum.
@jdahmubed - please use just one enum for algorithms. At this time, you an Leo have two different copies.
@lccodes FYI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdahmubed if you can import and use my AlgorithmEnum we should just go with that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont agree w including "Enum" in the enum name. mine leaves it out.
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add Javadocs. As we discussed previously - we shoould look at how we will use this enum to capture the type of the claim. I am talking about Claim type that you have mentioned here https://docs.google.com/document/d/1-N0n7UopFaIhzA5X-j1fhBgAR-kImbKoqgSVTUmixEI/edit?ts=5aac5b78#bookmark=id.u4q83iah8gx9
If we need to validate the type, we should have type information in the enum itself.
@@ -0,0 +1,5 @@ | |||
package com.auth0.msg; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add javadoc.
@jdahmubed I think you will be reusing this enum.
package com.auth0.msg; | ||
|
||
public enum DataLocation { | ||
FRAGMENT, QUERYPART |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change QUERYPART to QUERY_STRING (more explicit). Also add one more value FORM_POST
@@ -0,0 +1,11 @@ | |||
package com.auth0.msg; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Javadoc
@@ -0,0 +1,4 @@ | |||
package com.auth0.msg; | |||
|
|||
public class Key { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add class level Javadoc
Aren't you going to extend from auth0 class?
@@ -0,0 +1,4 @@ | |||
package com.auth0.msg; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add class level Javadoc
Aren't you going to extend from auth0 class? If so, please add extends
/** | ||
* This interface all the methods related to message processing. | ||
*/ | ||
public interface Message { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add throws SerializationException
to all the to methods. I have explained the reason in the abstract class.
@@ -0,0 +1,11 @@ | |||
package com.auth0.msg; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add javadoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add Javadocs
- Update interface and abstract class so that 'to' methods 'throws exeption'
- Common enum for Algorithm and DataLocation for you and Justin
- Create a util class MessageUtil for the static method.
No description provided.