Skip to content

403 Response Handling and Token Refresh on Branch Change#2418

Draft
abstraktor wants to merge 1 commit intofeat/readonly-nodejsfrom
fix/refresh-token-on-403
Draft

403 Response Handling and Token Refresh on Branch Change#2418
abstraktor wants to merge 1 commit intofeat/readonly-nodejsfrom
fix/refresh-token-on-403

Conversation

@abstraktor
Copy link
Collaborator

Issue

"Changing a branch should trigger reloading the token with the new permissions"

When a user switches to a different branch that requires different permissions, the server returns HTTP 403 Forbidden. The original code did not properly handle this scenario, potentially causing:

  • Infinite retry loops
  • Incorrect token handling for 403 responses
  • Missing permission updates on branch changes

Solution

The fix implements proper 403 Forbidden response handling in ModelixAuthClient.kt

Alternatives

This ended up quite complex. We could consider making the auth token updatable and exposing a setter for it in the javascript client. Then we could prevent these 403s at all.

@github-actions
Copy link
Contributor

Test Results

  247 files  ±0    247 suites  ±0   53m 25s ⏱️ -1s
1 427 tests +5  1 416 ✅ +5  11 💤 ±0  0 ❌ ±0 
1 437 runs  +5  1 426 ✅ +5  11 💤 ±0  0 ❌ ±0 

Results for commit 522c7ad. ± Comparison against base commit c257556.

@github-actions
Copy link
Contributor

JVM coverage report

Overall Project 58.87% -0.03%
Files changed 84.36% 🍏

File Coverage
ModelixAuthClient.kt 84.52% -4.9% 🍏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant