From 7fe319a7b8a7faff346b8979f7a6400c4fdd764c Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Thu, 7 May 2026 12:23:27 -0400 Subject: [PATCH 1/2] feat: api scoped tokens Co-authored-by: Copilot Signed-off-by: Adam Setch --- src/renderer/i18n/locales/de.json | 2 +- src/renderer/i18n/locales/en.json | 2 +- src/renderer/i18n/locales/es.json | 2 +- src/renderer/i18n/locales/fr.json | 2 +- src/renderer/utils/system/links.ts | 32 +++++++++++++++++++++++++++++- 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/renderer/i18n/locales/de.json b/src/renderer/i18n/locales/de.json index 01fd72a10..6759dbb03 100644 --- a/src/renderer/i18n/locales/de.json +++ b/src/renderer/i18n/locales/de.json @@ -127,7 +127,7 @@ "heading": "Laden" }, "login": { - "create_token": "API-Token erstellen", + "create_token": "Erstellen Sie ein API-Token mit Bereichen", "duplicate_username": "Dieser Benutzername wurde bereits hinzugefügt. Bitte verwenden Sie einen anderen Benutzernamen.", "error_message": "Hoppla! Die angegebene Benutzernamen-Token-Kombination ist ungültig. Bitte versuchen Sie es erneut.", "security_docs": "Siehe Atlassian-Dokumentation", diff --git a/src/renderer/i18n/locales/en.json b/src/renderer/i18n/locales/en.json index e208fca11..be5123708 100644 --- a/src/renderer/i18n/locales/en.json +++ b/src/renderer/i18n/locales/en.json @@ -127,7 +127,7 @@ "heading": "Loading" }, "login": { - "create_token": "Create API token", + "create_token": "Create API token with scopes", "duplicate_username": "This username has already been added. Please use a different username.", "error_message": "Oops! The username + token combination provided are not valid. Please try again.", "security_docs": "See Atlassian documentation", diff --git a/src/renderer/i18n/locales/es.json b/src/renderer/i18n/locales/es.json index 9f4aff207..c601c42ce 100644 --- a/src/renderer/i18n/locales/es.json +++ b/src/renderer/i18n/locales/es.json @@ -127,7 +127,7 @@ "heading": "Cargando" }, "login": { - "create_token": "Crear token API", + "create_token": "Crear token API con alcances", "duplicate_username": "Este nombre de usuario ya ha sido agregado. Utilice un nombre de usuario diferente.", "error_message": "¡Ups! La combinación de token de nombre de usuario proporcionada no es válida. Por favor inténtalo de nuevo.", "security_docs": "Ver documentación de Atlassian", diff --git a/src/renderer/i18n/locales/fr.json b/src/renderer/i18n/locales/fr.json index fea99a20d..e3a535f20 100644 --- a/src/renderer/i18n/locales/fr.json +++ b/src/renderer/i18n/locales/fr.json @@ -127,7 +127,7 @@ "heading": "Chargement" }, "login": { - "create_token": "Créer un jeton API", + "create_token": "Créer un jeton API avec des étendues", "duplicate_username": "Ce nom d'utilisateur a déjà été ajouté. Veuillez utiliser un autre nom d'utilisateur.", "error_message": "Oups ! La combinaison de jetons de nom d'utilisateur fournie n'est pas valide. Veuillez réessayer.", "security_docs": "Voir la documentation Atlassian", diff --git a/src/renderer/utils/system/links.ts b/src/renderer/utils/system/links.ts index 9275780e7..b5f211bf7 100644 --- a/src/renderer/utils/system/links.ts +++ b/src/renderer/utils/system/links.ts @@ -4,6 +4,36 @@ import type { Account, AtlassifyNotification, Link } from '../../types'; import { openExternalLink, trackEvent } from './comms'; +const SECURITY_TOKEN_SCOPES = [ + // 'read:assets:twg-cli', + // 'read:board-scope.admin:jira-software', + // 'read:3p-data:twg-cli', + // 'read:board-scope:jira-software', + // 'read:csm:twg-cli', + // 'read:confluence:twg-cli', + 'read:account', + // 'read:loom:twg-cli', + // 'read:ops-alert:jira-service-management', + // 'read:jira-align:twg-cli', + // 'read:jsm:twg-cli', + // 'read:goal:townsquare', + // 'read:mercury:twg-cli', + 'read:jira-work', + // 'read:jsw:twg-cli', + 'read:jira-user', + // 'read:issue-details:jira', + // 'read:project:jira', + // 'read:project:townsquare', + // 'read:sprint:jira-software', + // 'read:trello:twg-cli', + // 'read:radar:twg-cli', + // 'read:teamwork-graph:twg-cli', +] as const; + +const SECURITY_TOKEN_SELECTED_SCOPES = encodeURIComponent( + JSON.stringify(SECURITY_TOKEN_SCOPES), +); + export const URLs = { ATLASSIAN: { API: 'https://team.atlassian.net/gateway/api/graphql' as Link, @@ -16,7 +46,7 @@ export const URLs = { MY_NOTIFICATIONS: 'https://team.atlassian.com/notifications' as Link, PEOPLE: 'https://team.atlassian.com/people' as Link, SECURITY_TOKENS: - 'https://id.atlassian.com/manage-profile/security/api-tokens' as Link, + `https://id.atlassian.com/manage-profile/security/api-tokens?autofillToken=Atlassify&appId=twg&selectedScopes=${SECURITY_TOKEN_SELECTED_SCOPES}&expiryDays=365` as Link, }, }, }; From 5a112df09568c33372732be8d9261a43b2e3b213 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Thu, 7 May 2026 12:24:04 -0400 Subject: [PATCH 2/2] feat: api scoped tokens Signed-off-by: Adam Setch --- src/renderer/routes/__snapshots__/Login.test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/routes/__snapshots__/Login.test.tsx.snap b/src/renderer/routes/__snapshots__/Login.test.tsx.snap index 8e251bf08..d59efc562 100644 --- a/src/renderer/routes/__snapshots__/Login.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/Login.test.tsx.snap @@ -183,7 +183,7 @@ exports[`renderer/routes/Login.tsx > should render itself & its children 1`] = ` - Create API token + Create API token with scopes