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

[feature]: Creating Sample Java Application using JWT Token #2016

Open
1 task done
Swpn0neel opened this issue Jul 1, 2024 · 26 comments · May be fixed by keploy/samples-java#76
Open
1 task done

[feature]: Creating Sample Java Application using JWT Token #2016

Swpn0neel opened this issue Jul 1, 2024 · 26 comments · May be fixed by keploy/samples-java#76
Assignees
Labels
Enhancement New feature or request samples-java

Comments

@Swpn0neel
Copy link

Is there an existing feature request for this?

  • I have searched the existing issues

Summary

  • Create a sample app using Java and JWT token.
  • Use the Keploy to test the app and create at least 3 testcases.
  • Create a Readme containing the method to run the application with Keploy using Docker and Natively
  • Make a PR to keploy/samples-java repository

Why should this be worked on?

No other sample apps using Java and JWT Token

Repository

samples-java

@Swpn0neel Swpn0neel added the Enhancement New feature or request label Jul 1, 2024
@Adity20
Copy link

Adity20 commented Jul 15, 2024

Can I take this up @Swpn0neel ??
I would be happy to collaborate also.

@Swpn0neel
Copy link
Author

Go ahead @Adity20 !!

@amitpanwar789
Copy link

@Adity20 i would like to collaborate with you for this.

@jaiakash
Copy link

Hi @Adity20 @amitpanwar789 i would like to collab on this. I already have a template project in java. If both of you agree, I can create the boilerplate code and we can collab on it? Lmk what you guys suggest.

@Adity20
Copy link

Adity20 commented Jul 19, 2024

Sure go ahead and share the link of your forked repo

@amitpanwar789
Copy link

Hi @Adity20 @amitpanwar789 i would like to collab on this. I already have a template project in java. If both of you agree, I can create the boilerplate code and we can collab on it? Lmk what you guys suggest.

Sure we three can collab

@jaiakash
Copy link

Have sent invite to both of you. Here is the repo https://github.com/jaiakash/samples-java

@amitpanwar789
Copy link

great, how should we divide the work then ? i guess we can like take username and password (maybe or maybe not) from user then generate jwt and then like try to validate jwt and then keploy integration testcase generation ...

@Swpn0neel
Copy link
Author

Chat among yourselves about how you want to divide the tasks

@jaiakash
Copy link

jaiakash commented Jul 20, 2024

great, how should we divide the work then ? i guess we can like take username and password (maybe or maybe not) from user then generate jwt and then like try to validate jwt and then keploy integration testcase generation ...

Thats what I was thinking too, so we can divide the work into

  • Setting Up the Project (1 person )
  • first create user creation with email and password (1 person)
  • jwt authentication (with spring security) and keploy testing (test cases and mock data) (2 person)
  • containerisation and documentation (1 person)

Lmk what you guys have any suggestions, we can discuss and finalise it. For how I have created the repo.

@amitpanwar789
Copy link

@jaiakash do we need to create user and store it in db, i think we can just take email and password store it as map or anything generate token and then on next request validate it

@jaiakash
Copy link

@amitpanwar789 That also works since we are only doing the network testing. So which feature are you taking?

@amitpanwar789
Copy link

@amitpanwar789 That also works since we are only doing the network testing. So which feature are you taking?

Ok I will first work on api to get username and password and generate jwt and validation we both can work on.

@amitpanwar789
Copy link

@jaiakash i have made a pr for restapi have a look

@jaiakash
Copy link

@amitpanwar789 where did you make PR?

@amitpanwar789
Copy link

@jaiakash ohh sorry i directly push to your fork by creating a separate branch

@jaiakash
Copy link

@jaiakash ohh sorry i directly push to your fork by creating a separate branch

You can send PR to my fork.

@jaiakash
Copy link

@amitpanwar789 That branch i have merged to main, now we can start working on next issue. Check this - https://github.com/users/jaiakash/projects/3

@amitpanwar789
Copy link

  • (with spring security)

ok i will add jwt token generation and validation

@jaiakash
Copy link

Hi @amitpanwar789 did you complete the jwt token generation and validation code?

@amitpanwar789
Copy link

Hi @amitpanwar789 did you complete the jwt token generation and validation code?

sorry for being late, i have wrote some code using io.jsonwebtoken, but find some version clashes i guess .

@amitpanwar789
Copy link

i guess there is problem with security configuration , i am not familiar with springboot , can you add the configuration for the endpoints.

@jaiakash
Copy link

Sure, push the commit to your branch. I will commit on your branch itself.

@amitpanwar789
Copy link

@jaiakash have a look to new pr , jwt token generation and validation is working now.

@jaiakash
Copy link

jaiakash commented Jul 24, 2024

Thanks a lot @amitpanwar789. Have completed the code and made the PR with appropriate docs. Do check it out and edit the docs if any changes.

PR keploy/samples-java#75

cc @Swpn0neel

@jaiakash
Copy link

@amitpanwar789 Can you check the docs of the sample I have added? Do add if think anything can be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment