canonical / canonical/testflinger

database.delete_refresh_token is not used

Open
#979 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
26
Forks
49
Avg merge
4d 8h
Merged PRs (30d)
16

Description

We should identify where in the code we ought to be deleting refresh tokens as the currently the `delete_refresh_token` function from `database` as it is not used.

Presently we are simply relying on the TTL to expire:
```
# Remove refresh tokens that haven't been accessed over 90 days
mongo.db.refresh_tokens.create_index(
"last_accessed", expireAfterSeconds=REFRESH_TOKEN_IDEL_EXPIRATION
)
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing uses of database.delete_refresh_token and the refresh-token lifecycle around the database TTL index shown in the issue. Identify the relevant deletion paths and verify that explicit cleanup occurs where appropriate while the 90-day TTL remains effective.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.