#523 - Decompose auth middleware responsibilities
@brijesh-amin is already working on this.
Since Jul 17, 2026.
Assessment
This issue has not been assessed yet.
Description
Parent: #523
Objective
Split authentication middleware into focused units to improve maintainability and reduce bootstrap/runtime risk.
In scope
- Separate JWT validation, user lookup/sync, role mapping, and permission resolution into composable functions
- Remove hard process termination from auth initialization path
- Keep existing auth outcomes and role assignment behavior
Acceptance criteria
authmwareorchestration delegates to smaller testable functions/modules- Initialization failures propagate through startup error handling instead of
process.exitin middleware - Existing auth behavior remains compatible for idir/bceid role mapping
- Unit tests added/updated for extracted units
Notes
Prioritize readability and explicit error semantics over broad functional changes.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bcgov/range-api
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·