Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

lyzhang27
Copy link

No description provided.

@lyzhang27 lyzhang27 requested review from manu-sinha and lccodes and removed request for manu-sinha April 11, 2018 00:10
import java.util.HashMap;
import java.util.List;
import java.util.Map;

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

Copy link
Author

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;

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 {
Copy link

@manu-sinha manu-sinha Apr 16, 2018

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.

Copy link
Author

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 "";

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.

Copy link
Author

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

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() {
Copy link

@manu-sinha manu-sinha Apr 16, 2018

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

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;

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

Copy link
Author

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

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;

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;

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

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;

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 {

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;

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 {
Copy link

@manu-sinha manu-sinha Apr 16, 2018

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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add javadoc

Copy link

@manu-sinha manu-sinha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add Javadocs
  2. Update interface and abstract class so that 'to' methods 'throws exeption'
  3. Common enum for Algorithm and DataLocation for you and Justin
  4. Create a util class MessageUtil for the static method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants