Conversation
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
| @@ -0,0 +1,180 @@ | |||
| package com.auth0.msg; | |||
There was a problem hiding this comment.
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.
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.
| */ | ||
| public String toUrlEncoded() { | ||
| // Serialize the content of this instance (the claims map) into an UrlEncoded string | ||
| return ""; |
There was a problem hiding this comment.
Please add TODOs - so that we don't we don't miss out anything.
| } | ||
|
|
||
| /** | ||
| * Logic to extract from the string the values |
There was a problem hiding this comment.
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.
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.
please update ResponseMessage to Message everywhere in this class
| @@ -0,0 +1,11 @@ | |||
| package com.auth0.msg; | |||
|
|
|||
There was a problem hiding this comment.
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.
@jdahmubed if you can import and use my AlgorithmEnum we should just go with that
There was a problem hiding this comment.
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.
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.
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.
please change QUERYPART to QUERY_STRING (more explicit). Also add one more value FORM_POST
| @@ -0,0 +1,11 @@ | |||
| package com.auth0.msg; | |||
|
|
|||
| @@ -0,0 +1,4 @@ | |||
| package com.auth0.msg; | |||
|
|
|||
| public class Key { | |||
There was a problem hiding this comment.
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.
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.
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; | |||
|
|
|||
manu-sinha
left a comment
There was a problem hiding this comment.
- 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.