authgear / authgear/authgear-server

Write tests for token handler

Open
#3,485 1 comment 1 reaction 0 assignees View on GitHub
cooldown/test
Dominant language
Go
Stars
2k
Forks
125
Avg merge
2d 17h
Merged PRs (30d)
32

Description

pkg/lib/oauth/handler/handler_token.go

This file is complicated but we don't have unit tests for it. We need to write some tests so that we can modify the file in future easier.

- [ ] Write unit tests for each grant_type
- [ ] Some grant_type have different cases, such as authorization_code flow could issue different tokens in different cases. Should test all cases.
- [ ] e2e tests are good to have

Contributor guide

Open the contributing guide

Research direction

Start with pkg/lib/oauth/handler/handler_token.go and map each grant_type branch and its cases before designing the unit tests. Done means unit tests cover every grant_type and the different authorization_code outcomes described in the issue; end-to-end tests are optional.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.