[PR #2143] [MERGED] feat(api-tokens): support title and scopes query parameters #9807

Closed
opened 2026-04-23 09:13:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2143
Author: @kolaente
Created: 1/24/2026
Status: Merged
Merged: 1/24/2026
Merged by: @kolaente

Base: mainHead: feat-api-token-query-params


📝 Commits (7)

  • d28e7a7 feat(helpers): add parseScopesFromQuery helper for API token URL params
  • c2bb5fe test(helpers): add unit tests for parseScopesFromQuery
  • e8486a9 feat(api-tokens): support title and scopes query parameters
  • 8d495fa test(api-tokens): add e2e tests for query parameter pre-population
  • 3c2568d more cases
  • 087fe1f test(api-tokens): assert specific checkbox is checked in scope test
  • ac62ec6 fix(e2e): use exact checkbox name matching in api-tokens scope test

📊 Changes

4 files changed (+218 additions, -6 deletions)

View changed files

frontend/src/helpers/parseScopesFromQuery.test.ts (+80 -0)
frontend/src/helpers/parseScopesFromQuery.ts (+23 -0)
📝 frontend/src/views/user/settings/ApiTokens.vue (+45 -6)
frontend/tests/e2e/user/api-tokens.spec.ts (+70 -0)

📄 Description

Summary

  • Allow external integrations to link directly to the API token creation page with pre-selected title and permission scopes
  • URLs can now use ?title=Name&scopes=group:perm,group:perm format to pre-populate the form
  • Added parseScopesFromQuery helper function with comprehensive unit tests
  • Added E2E tests for the query parameter pre-population feature

Example URL

/user/settings/api-tokens?title=My%20Integration&scopes=tasks:create,tasks:delete,projects:read_all

Test plan

  • Unit tests pass for parseScopesFromQuery helper
  • E2E tests pass for query parameter pre-population
  • Frontend lint passes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2143 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 1/24/2026 **Status:** ✅ Merged **Merged:** 1/24/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `feat-api-token-query-params` --- ### 📝 Commits (7) - [`d28e7a7`](https://github.com/go-vikunja/vikunja/commit/d28e7a7c2a018598f6a99db45f4aec560a325ed7) feat(helpers): add parseScopesFromQuery helper for API token URL params - [`c2bb5fe`](https://github.com/go-vikunja/vikunja/commit/c2bb5feb1dee6d80057de1dc28294d37ab2d6066) test(helpers): add unit tests for parseScopesFromQuery - [`e8486a9`](https://github.com/go-vikunja/vikunja/commit/e8486a9a909977b541edb98d2043f0828fe761e5) feat(api-tokens): support title and scopes query parameters - [`8d495fa`](https://github.com/go-vikunja/vikunja/commit/8d495fac7fd8ca26a41022063c7ff8d43b6867ed) test(api-tokens): add e2e tests for query parameter pre-population - [`3c2568d`](https://github.com/go-vikunja/vikunja/commit/3c2568d0605c04c2e94380135afd9b6e0789ff30) more cases - [`087fe1f`](https://github.com/go-vikunja/vikunja/commit/087fe1f9809706c20ede6ad87d7658d50824f435) test(api-tokens): assert specific checkbox is checked in scope test - [`ac62ec6`](https://github.com/go-vikunja/vikunja/commit/ac62ec688f9ec8d62d9394df51dabc41abbc9da2) fix(e2e): use exact checkbox name matching in api-tokens scope test ### 📊 Changes **4 files changed** (+218 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `frontend/src/helpers/parseScopesFromQuery.test.ts` (+80 -0) ➕ `frontend/src/helpers/parseScopesFromQuery.ts` (+23 -0) 📝 `frontend/src/views/user/settings/ApiTokens.vue` (+45 -6) ➕ `frontend/tests/e2e/user/api-tokens.spec.ts` (+70 -0) </details> ### 📄 Description ## Summary - Allow external integrations to link directly to the API token creation page with pre-selected title and permission scopes - URLs can now use `?title=Name&scopes=group:perm,group:perm` format to pre-populate the form - Added `parseScopesFromQuery` helper function with comprehensive unit tests - Added E2E tests for the query parameter pre-population feature ## Example URL ``` /user/settings/api-tokens?title=My%20Integration&scopes=tasks:create,tasks:delete,projects:read_all ``` ## Test plan - [x] Unit tests pass for parseScopesFromQuery helper - [x] E2E tests pass for query parameter pre-population - [x] Frontend lint passes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 09:13:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#9807