-
Notifications
You must be signed in to change notification settings - Fork 120
Verify jwt locally #80
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
Conversation
Signed-off-by: James Diefenderfer <[email protected]>
@jesca and I discussed the testing for this. A simple test might be:
Do you know how to generate a JWT to do test1 and test2? If not, I can send you a JWT from a throwaway google account for your testing (you don't want to use a real one!). |
@jesca, @jimmydief, @neerajbaid @abhinavasingh16, are you planning to test this? What's the ETA on the test code? |
@shankari just saw this, will talk to my team |
@jimmydief, no worries, not going to pull without seeing testing results anyway :) |
@shankari Cool, thanks. Also, I'd be interested in that throwaway JWT |
@shankari We are having trouble importing the verifyUserToken function for testing since importing it runs the server. Is this a problem that has been addressed in the past? I'm not seeing any existing tests for verifyUserToken, or any other methods in that file actually. |
@shankari I think we just need to generate a JWT to test it -- right now, it looks like you are getting the the ID via a post request to /profile/create. We don't want to generate the JWT this way, I'm assuming. What's a good way to generate a test token id? |
Sorry for the late response - I was on my way back home, and it takes me ~ 2 hours to get back home on the train. @jimmydief, you are right that there are currently no unit tests for the api layer - it was intended to be a really simple shim layer that could be replaced easily if we chose to move to a different webserver. One possible solution might be to refactor the verifyAuth code into something in main ( @jesca, the JWTs are created on the phone. When I originally posted this, I thought that I would just generate a JWT from the phone code using a throwaway account and send it to you. But as I was trying to do that, I realized that the JWT is only valid for ~ 15 minutes, so this wouldn't work. Let me think about the best way to do this... |
So it seems to me that there are actually two things that we need to test:
In fact, if you show up in lab tomorrow, I'll walk you through the steps for #2, and help you connect your phone to your server and finish the integration testing... |
@shankari i'll be there |
Signed-off-by: James Diefenderfer <[email protected]>
20a659b
to
f0da08c
Compare
Resubmitted as 0cd868a and merged. |
No description provided.