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

Backend [Integration Test] auth.go handlers GetAdminPubkeys, GetIsAdmin, & RefreshToken #1529

Closed
2 tasks
elraphty opened this issue Feb 19, 2024 · 10 comments · Fixed by #1549
Closed
2 tasks
Assignees
Milestone

Comments

@elraphty
Copy link
Contributor

Context

We are trying to increase the test coverage for our Golang backend.

File to to test

handlers/auth.go

Design

Write tests for the auth handlers, the test should:

  • Should test that all admin pubkeys is returned by GetAdminPubkeys handlers.
  • Should test that GetIsAdmin returns a 401 error if the user is not an admin
  • Should test that a 200 status code is returned if the user is an admin.
  • Should test that a user token can be refreshed.

Auth Handlers To Test

GetAdminPubkeys
GetIsAdmin
RefreshToken

Add tests to auth_test.go

Acceptance Criteria

  • I have rebased and tested locally before submitting my PR
  • I can submit a PR within 2 days of taking the bounty

References

Here is an example backend test

@AbdulWahab3181
Copy link
Contributor

@ecurrencyhodler Could you please assign me this task?

@aliraza556
Copy link
Contributor

Hi @ecurrencyhodler
Assign me

@ecurrencyhodler
Copy link
Contributor

Ali this is yours. Let's get a PR in 2 days.

@ecurrencyhodler
Copy link
Contributor

Sorry @aliraza556 let me get this to another hunter. I have another bounty for you.

@AbdulWahab3181
Copy link
Contributor

@ecurrencyhodler I have already written the unit tests for this issue locally. I'm just waiting for you to assign me so that I can create a pull request and share it with you.

@aliraza556
Copy link
Contributor

Hi @AbdulWahab3181,
Please ensure that the next time @ecurrencyhodler assigns you a bounty, you either start working on it promptly or kindly leave the issue available for others to tackle.

@gouravmpk
Copy link
Contributor

@ecurrencyhodler Assign

@ecurrencyhodler
Copy link
Contributor

I'm trying to reserve this for another hunter. I'll check again tomorrow.

@FaisalIqbal211
Copy link
Contributor

@ecurrencyhodler assign me?

@ecurrencyhodler
Copy link
Contributor

@FaisalIqbal211 this is yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
6 participants