Skip to content

fix: low-privilege user token creation - #11492

Merged
SchrodingersGat merged 10 commits into
inventree:masterfrom
matmair:matmair/issue11486
Mar 14, 2026
Merged

SchrodingersGat merged 10 commits into
inventree:masterfrom
matmair:matmair/issue11486

Conversation

@matmair

@matmair matmair commented Mar 11, 2026

Copy link
Copy Markdown
Member

Switches frontend user token generation to the intended user-specific endpoint and fixes metadata permission discovery for IsAuthenticated permissioned endpoints

fixes #11486

@matmair matmair self-assigned this Mar 11, 2026
@netlify

netlify Bot commented Mar 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit ea9b207
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/69b48bc6e119000008bdadd7
😎 Deploy Preview https://deploy-preview-11492--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 92 (🔴 down 1 from production)
Accessibility: 81 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@matmair matmair added bug Identifies a bug which needs to be addressed User Interface Related to the frontend / User Interface labels Mar 11, 2026
@matmair matmair modified the milestones: 1.3.0, 1.2.4 Mar 11, 2026
@codecov

codecov Bot commented Mar 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.06%. Comparing base (6ca102c) to head (ea9b207).
⚠️ Report is 374 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11492      +/-   ##
==========================================
- Coverage   88.06%   88.06%   -0.01%     
==========================================
  Files        1296     1296              
  Lines       59074    59076       +2     
  Branches     1935     1935              
==========================================
+ Hits        52025    52026       +1     
- Misses       6568     6569       +1     
  Partials      481      481              
Flag Coverage Δ
backend 89.24% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend Apps 91.69% <100.00%> (ø)
Backend General 93.37% <ø> (ø)
Frontend 70.91% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SchrodingersGat

Copy link
Copy Markdown
Member

@matmair nice work and fix. Can you please add a quick playwright test to prevent a regression here?

@SchrodingersGat SchrodingersGat added backport Apply this label to a PR to enable auto-backport action backport-to-1.2.x api Relates to the API labels Mar 12, 2026
@matmair

matmair commented Mar 14, 2026

Copy link
Copy Markdown
Member Author

@SchrodingersGat ready for review and merge

@SchrodingersGat
SchrodingersGat merged commit fda3204 into inventree:master Mar 14, 2026
35 checks passed
@SchrodingersGat
SchrodingersGat deleted the matmair/issue11486 branch March 14, 2026 01:02
@SchrodingersGat

Copy link
Copy Markdown
Member

Thanks for the fix @matmair

github-actions Bot pushed a commit that referenced this pull request Mar 14, 2026
* [bug] Users cannot create their own API tokens
Fixes #11486

* fix detection of metadata

* make easier to read

* add handler for IsAuthenticated

* use correct method

* fix style see #11487

* add frontend test

* make test more reliable?

(cherry picked from commit fda3204)
@github-actions

Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
✅ 1.2.x

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

SchrodingersGat pushed a commit that referenced this pull request Mar 14, 2026
* [bug] Users cannot create their own API tokens
Fixes #11486

* fix detection of metadata

* make easier to read

* add handler for IsAuthenticated

* use correct method

* fix style see #11487

* add frontend test

* make test more reliable?

(cherry picked from commit fda3204)

Co-authored-by: Matthias Mair <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Relates to the API backport Apply this label to a PR to enable auto-backport action bug Identifies a bug which needs to be addressed User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Users cannot create their own API tokens

3 participants