Add support for API Tokens for REST API interactions after JWT change - #738
Merged
Conversation
Test Results31 tests 31 ✅ 8s ⏱️ Results for commit e182d5b. ♻️ This comment has been updated with latest results. |
…e to JWT auth Since the move to JWT, the tokens regenerate so you cannot simply nab the cookie content anymore to use via an external application interacting with the REST API. Adding functionality to add an API Token to a user's account to authenticate in place of JWTs.
Tim020
force-pushed
the
jack/api-tokens
branch
from
November 28, 2025 19:46
5c90a8d to
472ba80
Compare
Added database engine disposal to DigiScriptTestCase.tearDown() to ensure proper test isolation. Previously, in-memory SQLite database connections persisted across test methods, causing data leakage that resulted in 2 test failures when tests were run together: - test_create_admin failed due to username conflicts from previous tests - test_api_token_get failed because user already had API token from previous test execution The fix ensures each test method gets a fresh database instance by calling models.db.engine.dispose() in tearDown, forcing the creation of a new engine for the next test. Test results improved from 11 passed/2 failed to 31 passed/0 failed across all test suites. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Tim020
approved these changes
Nov 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the move to JWT, the tokens regenerate so you cannot simply nab the cookie content anymore to use via an external application interacting with the REST API. Adding functionality to add an API Token to a user's account to authenticate in place of JWTs.