Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Split the agent screens, and stopped offering an agent the right to manage agents

Damian Legawiec20408e43c05f
diff --git a/packages/dashboard/src/components/spree/oauth-application-sheet.tsx b/packages/dashboard/src/components/spree/oauth-application-sheet.tsx
index 5b3079c5d8..8bf880a6e7 100644
--- a/packages/dashboard/src/components/spree/oauth-application-sheet.tsx
+++ b/packages/dashboard/src/components/spree/oauth-application-sheet.tsx
@@ -77,11 +77,11 @@ export function OauthApplicationSheet({
<SheetHeader>
<SheetTitle>
{application
- ? t('admin.pages.settings.connected_apps.form.edit_title')
- : t('admin.pages.settings.connected_apps.form.create_title')}
+ ? t('admin.pages.settings.oauth_clients.form.edit_title')
+ : t('admin.pages.settings.oauth_clients.form.create_title')}
</SheetTitle>
<SheetDescription>
- {t('admin.pages.settings.connected_apps.form.description')}
+ {t('admin.pages.settings.oauth_clients.form.description')}
</SheetDescription>
</SheetHeader>
diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.json
index c328d0922d..7c36817aa6 100644
--- a/packages/dashboard/src/locales/ar.json
+++ b/packages/dashboard/src/locales/ar.json
@@ -4146,17 +4146,27 @@
"revoke_confirm": {
"title": "إلغاء الوصول؟",
"message": "سيتوقف {{name}} عن العمل فورًا. وسيحتاج أي شخص يستخدمه إلى الاتصال من جديد."
- },
+ }
+ },
+ "oauth_clients": {
+ "title": "عملاء OAuth",
+ "subtitle": "عملاء OAuth المسجّلون لهذا المتجر. يتم الربط من صفحة الوكلاء المتصلين.",
+ "empty": "لم يُسجَّل أي عميل بعد.",
"register": "تسجيل عميل",
+ "table": {
+ "client_id": "معرّف العميل",
+ "created": "تاريخ التسجيل"
+ },
+ "delete_confirm": {
+ "title": "حذف هذا العميل؟",
+ "message": "سيتوقف {{name}} عن العمل فورًا وسيُحذف تسجيله."
+ },
"form": {
"create_title": "تسجيل عميل",
"edit_title": "تعديل العميل",
"description": "سجّل عميل OAuth حتى يمكن ربطه بهذا المتجر."
},
- "delete_confirm": {
- "title": "حذف هذا العميل؟",
- "message": "سيتوقف {{name}} عن العمل فورًا وسيُحذف تسجيله."
- }
+ "copy_client_id": "نسخ معرّف العميل"
}
},
"staff": {
@@ -5219,7 +5229,8 @@
"package_types": "صناديق وكراتين ومنصات وحاويات",
"suppliers": "من تشتري منه المخزون، وكيفية التواصل معه",
"marketplace": "مدفوعات البائعين، والموافقة على البائعين، ورسائل البائعين، والضريبة على العمولة",
- "connected_apps": "وكلاء الذكاء الاصطناعي الذين لديهم حق الوصول إلى هذا المتجر"
+ "connected_apps": "وكلاء الذكاء الاصطناعي الذين لديهم حق الوصول إلى هذا المتجر",
+ "oauth_clients": "تسجيل عملاء OAuth وتهيئتهم"
},
"groups": {
"audit": "التدقيق",
@@ -5258,7 +5269,8 @@
"package_types": "أنواع التغليف",
"suppliers": "الموردون",
"marketplace": "الإعدادات",
- "connected_apps": "الوكلاء المتصلون"
+ "connected_apps": "الوكلاء المتصلون",
+ "oauth_clients": "عملاء OAuth"
},
"breadcrumbs": {
"marketplace": "السوق"
diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.json
index 568ad409fe..0d6ce224fb 100644
--- a/packages/dashboard/src/locales/de.json
+++ b/packages/dashboard/src/locales/de.json
@@ -4118,17 +4118,27 @@
"revoke_confirm": {
"title": "Zugriff widerrufen?",
"message": "{{name}} funktioniert ab sofort nicht mehr. Wer es nutzt, muss sich erneut verbinden."
- },
+ }
+ },
+ "oauth_clients": {
+ "title": "OAuth-Clients",
+ "subtitle": "Die für diesen Shop registrierten OAuth-Clients. Verbunden werden sie unter „Verbundene Agenten“.",
+ "empty": "Noch keine Clients registriert.",
"register": "Client registrieren",
+ "table": {
+ "client_id": "Client-ID",
+ "created": "Registriert"
+ },
+ "delete_confirm": {
+ "title": "Diesen Client löschen?",
+ "message": "{{name}} funktioniert sofort nicht mehr und die Registrierung wird entfernt."
+ },
"form": {
"create_title": "Client registrieren",
"edit_title": "Client bearbeiten",
"description": "Registrieren Sie einen OAuth-Client, damit er mit diesem Shop verbunden werden kann."
},
- "delete_confirm": {
- "title": "Diesen Client löschen?",
- "message": "{{name}} funktioniert sofort nicht mehr und die Registrierung wird entfernt."
- }
+ "copy_client_id": "Client-ID kopieren"
}
},
"staff": {
@@ -5186,7 +5196,8 @@
"package_types": "Kartons, Paletten und Container",
"suppliers": "Von wem Sie Ware einkaufen und wie Sie sie erreichen",
"marketplace": "Auszahlungen, Verkäuferfreigabe, Verkäufer-E-Mails und Steuer auf Provision",
- "connected_apps": "KI-Agenten mit Zugriff auf diesen Shop"
+ "connected_apps": "KI-Agenten mit Zugriff auf diesen Shop",
+ "oauth_clients": "OAuth-Clients registrieren und konfigurieren"
},
"groups": {
"audit": "Audit",
@@ -5225,7 +5236,8 @@
"package_types": "Verpackungsarten",
"suppliers": "Lieferanten",
"marketplace": "Einstellungen",
- "connected_apps": "Verbundene Agenten"
+ "connected_apps": "Verbundene Agenten",
+ "oauth_clients": "OAuth-Clients"
},
"breadcrumbs": {
"marketplace": "Marktplatz"
diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.json
index fbeec39ec0..53aced8f6c 100644
--- a/packages/dashboard/src/locales/en.json
+++ b/packages/dashboard/src/locales/en.json
@@ -4118,17 +4118,27 @@
"revoke_confirm": {
"title": "Revoke access?",
"message": "{{name}} will stop working immediately. Anyone using it will need to connect again."
- },
+ }
+ },
+ "oauth_clients": {
+ "title": "OAuth clients",
+ "subtitle": "The OAuth clients registered against this store. A merchant connects one from Connected agents.",
+ "empty": "No clients registered yet.",
"register": "Register a client",
+ "table": {
+ "client_id": "Client ID",
+ "created": "Registered"
+ },
+ "delete_confirm": {
+ "title": "Delete this client?",
+ "message": "{{name}} will stop working immediately and its registration will be removed."
+ },
"form": {
"create_title": "Register a client",
"edit_title": "Edit client",
"description": "Register an OAuth client so it can be connected to this store."
},
- "delete_confirm": {
- "title": "Delete this client?",
- "message": "{{name}} will stop working immediately and its registration will be removed."
- }
+ "copy_client_id": "Copy client ID"
}
},
"staff": {
@@ -5186,7 +5196,8 @@
"package_types": "Boxes, cartons, pallets and containers",
"suppliers": "Who you buy stock from, and how to reach them",
"marketplace": "Seller payouts, seller approval, seller emails and commission tax",
- "connected_apps": "AI agents with access to this store"
+ "connected_apps": "AI agents with access to this store",
+ "oauth_clients": "Register and configure OAuth clients"
},
"groups": {
"audit": "Audit",
@@ -5225,7 +5236,8 @@
"package_types": "Package types",
"suppliers": "Suppliers",
"marketplace": "Settings",
- "connected_apps": "Connected agents"
+ "connected_apps": "Connected agents",
+ "oauth_clients": "OAuth clients"
},
"breadcrumbs": {
"marketplace": "Marketplace"
diff --git a/packages/dashboard/src/locales/es.json b/packages/dashboard/src/locales/es.json
index 8452feb485..8488580a2a 100644
--- a/packages/dashboard/src/locales/es.json
+++ b/packages/dashboard/src/locales/es.json
@@ -734,17 +734,27 @@
"revoke_confirm": {
"title": "¿Revocar el acceso?",
"message": "{{name}} dejará de funcionar de inmediato. Quien lo use tendrá que conectarse de nuevo."
- },
+ }
+ },
+ "oauth_clients": {
+ "title": "Clientes OAuth",
+ "subtitle": "Los clientes OAuth registrados en esta tienda. La conexión se hace desde Agentes conectados.",
+ "empty": "Aún no hay clientes registrados.",
"register": "Registrar un cliente",
+ "table": {
+ "client_id": "ID de cliente",
+ "created": "Registrado"
+ },
+ "delete_confirm": {
+ "title": "¿Eliminar este cliente?",
+ "message": "{{name}} dejará de funcionar de inmediato y se eliminará su registro."
+ },
"form": {
"create_title": "Registrar un cliente",
"edit_title": "Editar cliente",
"description": "Registre un cliente OAuth para poder conectarlo a esta tienda."
},
- "delete_confirm": {
- "title": "¿Eliminar este cliente?",
- "message": "{{name}} dejará de funcionar de inmediato y se eliminará su registro."
- }
+ "copy_client_id": "Copiar ID de cliente"
}
},
"staff": {
@@ -4257,7 +4267,8 @@
"package_types": "Cajas, cajones, palets y contenedores",
"suppliers": "A quién le comprás stock y cómo contactarlos",
"marketplace": "Pagos a vendedores, aprobación de vendedores, correos a vendedores e impuesto sobre la comisión",
- "connected_apps": "Agentes de IA con acceso a esta tienda"
+ "connected_apps": "Agentes de IA con acceso a esta tienda",
+ "oauth_clients": "Registrar y configurar clientes OAuth"
},
"groups": {
"audit": "Auditoría",
@@ -4296,7 +4307,8 @@
"package_types": "Tipos de empaque",
"suppliers": "Proveedores",
"marketplace": "Configuración",
- "connected_apps": "Agentes conectados"
+ "connected_apps": "Agentes conectados",
+ "oauth_clients": "Clientes OAuth"
},
"breadcrumbs": {
"marketplace": "Marketplace"
diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.json
index 4ee1f28fb6..7fcdc486fc 100644
--- a/packages/dashboard/src/locales/fr.json
+++ b/packages/dashboard/src/locales/fr.json
@@ -4118,17 +4118,27 @@
"revoke_confirm": {
"title": "Révoquer l’accès ?",
"message": "{{name}} cessera de fonctionner immédiatement. Toute personne qui l’utilise devra se connecter à nouveau."
- },
+ }
+ },
+ "oauth_clients": {
+ "title": "Clients OAuth",
+ "subtitle": "Les clients OAuth enregistrés pour cette boutique. La connexion se fait depuis Agents connectés.",
+ "empty": "Aucun client enregistré.",
"register": "Enregistrer un client",
+ "table": {
+ "client_id": "Identifiant client",
+ "created": "Enregistré"
+ },
+ "delete_confirm": {
+ "title": "Supprimer ce client ?",
+ "message": "{{name}} cessera de fonctionner immédiatement et son enregistrement sera supprimé."
+ },
"form": {
"create_title": "Enregistrer un client",
"edit_title": "Modifier le client",
"description": "Enregistrez un client OAuth pour pouvoir le connecter à cette boutique."
},
- "delete_confirm": {
- "title": "Supprimer ce client ?",
- "message": "{{name}} cessera de fonctionner immédiatement et son enregistrement sera supprimé."
- }
+ "copy_client_id": "Copier l'identifiant client"
}
},
"staff": {
@@ -5186,7 +5196,8 @@
"package_types": "Cartons, palettes et conteneurs",
"suppliers": "À qui vous achetez votre stock, et comment les joindre",
"marketplace": "Paiements, validation des vendeurs, e-mails vendeurs et taxe sur la commission",
- "connected_apps": "Agents IA ayant accès à cette boutique"
+ "connected_apps": "Agents IA ayant accès à cette boutique",
+ "oauth_clients": "Enregistrer et configurer des clients OAuth"
},
"groups": {
"audit": "Audit",
@@ -5225,7 +5236,8 @@
"package_types": "Types d'emballage",
"suppliers": "Fournisseurs",
"marketplace": "Paramètres",
- "connected_apps": "Agents connectés"
+ "connected_apps": "Agents connectés",
+ "oauth_clients": "Clients OAuth"
},
"breadcrumbs": {
"marketplace": "Marketplace"
diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.json
index d73392055c..803774f0e7 100644
--- a/packages/dashboard/src/locales/pl.json
+++ b/packages/dashboard/src/locales/pl.json
@@ -4172,17 +4172,27 @@
"revoke_confirm": {
"title": "Odebrać dostęp?",
"message": "{{name}} przestanie działać natychmiast. Każdy, kto z niej korzysta, będzie musiał połączyć się ponownie."
- },
+ }
+ },
+ "oauth_clients": {
+ "title": "Klienci OAuth",
+ "subtitle": "Klienci OAuth zarejestrowani w tym sklepie. Połączenie nawiązuje się w Połączonych agentach.",
+ "empty": "Nie zarejestrowano jeszcze żadnego klienta.",
"register": "Zarejestruj klienta",
+ "table": {
+ "client_id": "Identyfikator klienta",
+ "created": "Zarejestrowano"
+ },
+ "delete_confirm": {
+ "title": "Usunąć tego klienta?",
+ "message": "{{name}} przestanie działać natychmiast, a jego rejestracja zostanie usunięta."
+ },
"form": {
"create_title": "Zarejestruj klienta",
"edit_title": "Edytuj klienta",
"description": "Zarejestruj klienta OAuth, aby można go było połączyć z tym sklepem."
},
- "delete_confirm": {
- "title": "Usunąć tego klienta?",
- "message": "{{name}} przestanie działać natychmiast, a jego rejestracja zostanie usunięta."
- }
+ "copy_client_id": "Kopiuj identyfikator klienta"
}
},
"staff": {
@@ -5250,7 +5260,8 @@
"package_types": "Kartony, palety i kontenery",
"suppliers": "Od kogo kupujesz towar i jak się z nimi skontaktować",
"marketplace": "Wypłaty, zatwierdzanie sprzedawców, e-maile do sprzedawców i podatek od prowizji",
- "connected_apps": "Agenty AI z dostępem do tego sklepu"
+ "connected_apps": "Agenty AI z dostępem do tego sklepu",
+ "oauth_clients": "Rejestrowanie i konfiguracja klientów OAuth"
},
"groups": {
"audit": "Audyt",
@@ -5289,7 +5300,8 @@
"package_types": "Rodzaje opakowań",
"suppliers": "Dostawcy",
"marketplace": "Ustawienia",
- "connected_apps": "Połączone agenty"
+ "connected_apps": "Połączone agenty",
+ "oauth_clients": "Klienci OAuth"
},
"breadcrumbs": {
"marketplace": "Marketplace"
diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.json
index 0ef955d19a..7901a66575 100644
--- a/packages/dashboard/src/locales/zh-CN.json
+++ b/packages/dashboard/src/locales/zh-CN.json
@@ -4108,17 +4108,27 @@
"revoke_confirm": {
"title": "撤销访问权限?",
"message": "{{name}} 将立即停止工作。使用它的人需要重新连接。"
- },
+ }
+ },
+ "oauth_clients": {
+ "title": "OAuth 客户端",
+ "subtitle": "已在此店铺注册的 OAuth 客户端。连接请在“已连接的代理”中完成。",
+ "empty": "尚未注册任何客户端。",
"register": "注册客户端",
+ "table": {
+ "client_id": "客户端 ID",
+ "created": "注册时间"
+ },
+ "delete_confirm": {
+ "title": "删除此客户端?",
+ "message": "{{name}} 将立即停止工作,其注册记录也会被删除。"
+ },
"form": {
"create_title": "注册客户端",
"edit_title": "编辑客户端",
"description": "注册 OAuth 客户端后即可将其连接到此店铺。"
},
- "delete_confirm": {
- "title": "删除此客户端?",
- "message": "{{name}} 将立即停止工作,其注册记录也会被删除。"
- }
+ "copy_client_id": "复制客户端 ID"
}
},
"staff": {
@@ -5175,7 +5185,8 @@
"package_types": "纸箱、外箱、托盘与集装箱",
"suppliers": "你从谁那里采购库存,以及如何联系他们",
"marketplace": "卖家付款、卖家审核、卖家邮件与佣金税",
- "connected_apps": "有权访问此店铺的 AI 代理"
+ "connected_apps": "有权访问此店铺的 AI 代理",
+ "oauth_clients": "注册并配置 OAuth 客户端"
},
"groups": {
"audit": "审计",
@@ -5214,7 +5225,8 @@
"package_types": "包装类型",
"suppliers": "供应商",
"marketplace": "设置",
- "connected_apps": "已连接的代理"
+ "connected_apps": "已连接的代理",
+ "oauth_clients": "OAuth 客户端"
},
"breadcrumbs": {
"marketplace": "平台"
diff --git a/packages/dashboard/src/nav/settings.ts b/packages/dashboard/src/nav/settings.ts
index 8407b33c9b..b3a356f22a 100644
--- a/packages/dashboard/src/nav/settings.ts
+++ b/packages/dashboard/src/nav/settings.ts
@@ -355,6 +355,17 @@ settingsNav.add({
subject: Subject.OauthApplication,
})
+settingsNav.add({
+ key: 'settings.oauth_clients',
+ labelKey: 'admin.settings_nav.items.oauth_clients',
+ descriptionKey: 'admin.settings_nav.descriptions.oauth_clients',
+ path: '/oauth-clients',
+ icon: KeyRoundIcon,
+ group: 'developer',
+ position: 151,
+ subject: Subject.OauthApplication,
+})
+
settingsNav.add({
key: 'settings.webhooks',
labelKey: 'admin.settings_nav.items.webhooks',
diff --git a/packages/dashboard/src/routeTree.gen.ts b/packages/dashboard/src/routeTree.gen.ts
index 96a1fd87e5..c51492e6f5 100644
--- a/packages/dashboard/src/routeTree.gen.ts
+++ b/packages/dashboard/src/routeTree.gen.ts
@@ -66,6 +66,7 @@ import { Route as SettingsCustomFieldDefinitionsRouteImport } from './routes/_au
import { Route as SettingsIntegrationsRouteImport } from './routes/_authenticated/$storeId/settings/integrations'
import { Route as SettingsMarketplaceRouteImport } from './routes/_authenticated/$storeId/settings/marketplace'
import { Route as SettingsMarketsRouteImport } from './routes/_authenticated/$storeId/settings/markets'
+import { Route as SettingsOauthClientsRouteImport } from './routes/_authenticated/$storeId/settings/oauth-clients'
import { Route as SettingsPackageTypesRouteImport } from './routes/_authenticated/$storeId/settings/package-types'
import { Route as SettingsPaymentMethodsRouteImport } from './routes/_authenticated/$storeId/settings/payment-methods'
import { Route as SettingsPayoutsRouteImport } from './routes/_authenticated/$storeId/settings/payouts'
@@ -397,6 +398,11 @@ const SettingsMarketsRoute = SettingsMarketsRouteImport.update({
path: '/markets',
getParentRoute: () => SettingsRoute,
} as any)
+const SettingsOauthClientsRoute = SettingsOauthClientsRouteImport.update({
+ id: '/oauth-clients',
+ path: '/oauth-clients',
+ getParentRoute: () => SettingsRoute,
+} as any)
const SettingsPackageTypesRoute = SettingsPackageTypesRouteImport.update({
id: '/package-types',
path: '/package-types',
@@ -681,6 +687,7 @@ export interface FileRoutesByFullPath {
'/$storeId/settings/integrations': typeof SettingsIntegrationsRoute
'/$storeId/settings/marketplace': typeof SettingsMarketplaceRoute
'/$storeId/settings/markets': typeof SettingsMarketsRoute
+ '/$storeId/settings/oauth-clients': typeof SettingsOauthClientsRoute
'/$storeId/settings/package-types': typeof SettingsPackageTypesRoute
'/$storeId/settings/payment-methods': typeof SettingsPaymentMethodsRoute
'/$storeId/settings/payouts': typeof SettingsPayoutsRoute
@@ -781,6 +788,7 @@ export interface FileRoutesByTo {
'/$storeId/settings/integrations': typeof SettingsIntegrationsRoute
'/$storeId/settings/marketplace': typeof SettingsMarketplaceRoute
'/$storeId/settings/markets': typeof SettingsMarketsRoute
+ '/$storeId/settings/oauth-clients': typeof SettingsOauthClientsRoute
'/$storeId/settings/package-types': typeof SettingsPackageTypesRoute
'/$storeId/settings/payment-methods': typeof SettingsPaymentMethodsRoute
'/$storeId/settings/payouts': typeof SettingsPayoutsRoute
@@ -885,6 +893,7 @@ export interface FileRoutesById {
'/_authenticated/$storeId/settings/integrations': typeof SettingsIntegrationsRoute
'/_authenticated/$storeId/settings/marketplace': typeof SettingsMarketplaceRoute
'/_authenticated/$storeId/settings/markets': typeof SettingsMarketsRoute
+ '/_authenticated/$storeId/settings/oauth-clients': typeof SettingsOauthClientsRoute
'/_authenticated/$storeId/settings/package-types': typeof SettingsPackageTypesRoute
'/_authenticated/$storeId/settings/payment-methods': typeof SettingsPaymentMethodsRoute
'/_authenticated/$storeId/settings/payouts': typeof SettingsPayoutsRoute
@@ -989,6 +998,7 @@ export interface FileRouteTypes {
| '/$storeId/settings/integrations'
| '/$storeId/settings/marketplace'
| '/$storeId/settings/markets'
+ | '/$storeId/settings/oauth-clients'
| '/$storeId/settings/package-types'
| '/$storeId/settings/payment-methods'
| '/$storeId/settings/payouts'
@@ -1089,6 +1099,7 @@ export interface FileRouteTypes {
| '/$storeId/settings/integrations'
| '/$storeId/settings/marketplace'
| '/$storeId/settings/markets'
+ | '/$storeId/settings/oauth-clients'
| '/$storeId/settings/package-types'
| '/$storeId/settings/payment-methods'
| '/$storeId/settings/payouts'
@@ -1192,6 +1203,7 @@ export interface FileRouteTypes {
| '/_authenticated/$storeId/settings/integrations'
| '/_authenticated/$storeId/settings/marketplace'
| '/_authenticated/$storeId/settings/markets'
+ | '/_authenticated/$storeId/settings/oauth-clients'
| '/_authenticated/$storeId/settings/package-types'
| '/_authenticated/$storeId/settings/payment-methods'
| '/_authenticated/$storeId/settings/payouts'
@@ -1658,6 +1670,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof SettingsMarketsRouteImport
parentRoute: typeof SettingsRoute
}
+ '/_authenticated/$storeId/settings/oauth-clients': {
+ id: '/_authenticated/$storeId/settings/oauth-clients'
+ path: '/oauth-clients'
+ fullPath: '/$storeId/settings/oauth-clients'
+ preLoaderRoute: typeof SettingsOauthClientsRouteImport
+ parentRoute: typeof SettingsRoute
+ }
'/_authenticated/$storeId/settings/package-types': {
id: '/_authenticated/$storeId/settings/package-types'
path: '/package-types'
@@ -1979,6 +1998,7 @@ interface SettingsRouteChildren {
SettingsIntegrationsRoute: typeof SettingsIntegrationsRoute
SettingsMarketplaceRoute: typeof SettingsMarketplaceRoute
SettingsMarketsRoute: typeof SettingsMarketsRoute
+ SettingsOauthClientsRoute: typeof SettingsOauthClientsRoute
SettingsPackageTypesRoute: typeof SettingsPackageTypesRoute
SettingsPaymentMethodsRoute: typeof SettingsPaymentMethodsRoute
SettingsPayoutsRoute: typeof SettingsPayoutsRoute
@@ -2015,6 +2035,7 @@ const SettingsRouteChildren: SettingsRouteChildren = {
SettingsIntegrationsRoute: SettingsIntegrationsRoute,
SettingsMarketplaceRoute: SettingsMarketplaceRoute,
SettingsMarketsRoute: SettingsMarketsRoute,
+ SettingsOauthClientsRoute: SettingsOauthClientsRoute,
SettingsPackageTypesRoute: SettingsPackageTypesRoute,
SettingsPaymentMethodsRoute: SettingsPaymentMethodsRoute,
SettingsPayoutsRoute: SettingsPayoutsRoute,
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/connected-apps.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/connected-apps.tsx
index fe04af0a63..52c262527f 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/connected-apps.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/connected-apps.tsx
@@ -12,8 +12,7 @@ import { createFileRoute } from '@tanstack/react-router'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { McpConnectSheet } from '../../../../components/spree/mcp-connect-sheet'
-import { OauthApplicationSheet } from '../../../../components/spree/oauth-application-sheet'
-import { useDeleteOauthApplication, useRevokeOauthApplication } from '../../../../hooks/use-oauth'
+import { useRevokeOauthApplication } from '../../../../hooks/use-oauth'
import '../../../../tables/oauth-applications'
export const Route = createFileRoute('/_authenticated/$storeId/settings/connected-apps')({
@@ -28,28 +27,6 @@ function ConnectedAppsSettingsPage() {
const revoke = useRevokeOauthApplication()
const { permissions } = usePermissions()
const [connectOpen, setConnectOpen] = useState(false)
- const [editing, setEditing] = useState<OauthApplication | undefined>()
- const [formOpen, setFormOpen] = useState(false)
- const remove = useDeleteOauthApplication()
-
- function openForm(application?: OauthApplication) {
- setEditing(application)
- setFormOpen(true)
- }
-
- async function handleDelete(application: OauthApplication) {
- const ok = await confirm({
- title: t('admin.pages.settings.connected_apps.delete_confirm.title'),
- message: t('admin.pages.settings.connected_apps.delete_confirm.message', {
- name: application.name,
- }),
- variant: 'destructive',
- confirmLabel: t('admin.common.delete'),
- })
- if (!ok) return
-
- await remove.mutateAsync(application.id).catch(() => undefined)
- }
async function handleRevoke(application: OauthApplication) {
const ok = await confirm({
@@ -71,28 +48,13 @@ function ConnectedAppsSettingsPage() {
title={t('admin.pages.settings.connected_apps.title')}
description={t('admin.pages.settings.connected_apps.subtitle')}
actions={
- <div className="flex gap-2">
- {permissions.can('update', Subject.OauthApplication) && (
- <Button size="sm" variant="outline" onClick={() => openForm()}>
- {t('admin.pages.settings.connected_apps.register')}
- </Button>
- )}
- <Button size="sm" onClick={() => setConnectOpen(true)}>
- {t('admin.mcp_connect.open_cta')}
- </Button>
- </div>
+ <Button size="sm" onClick={() => setConnectOpen(true)}>
+ {t('admin.mcp_connect.open_cta')}
+ </Button>
}
/>
<McpConnectSheet open={connectOpen} onOpenChange={setConnectOpen} />
- <OauthApplicationSheet
- application={editing}
- open={formOpen}
- onOpenChange={(next) => {
- setFormOpen(next)
- if (!next) setEditing(undefined)
- }}
- />
<ResourceTable<OauthApplication>
tableKey="oauth-applications"
@@ -103,12 +65,6 @@ function ConnectedAppsSettingsPage() {
rowActions={(application) => (
<RowActions
actions={[
- {
- key: 'edit',
- label: t('admin.common.edit'),
- visible: permissions.can('update', Subject.OauthApplication),
- onSelect: () => openForm(application),
- },
{
key: 'revoke',
label: t('admin.pages.settings.connected_apps.revoke'),
@@ -117,14 +73,6 @@ function ConnectedAppsSettingsPage() {
disabled: revoke.isPending,
onSelect: () => handleRevoke(application),
},
- {
- key: 'delete',
- label: t('admin.common.delete'),
- destructive: true,
- visible: permissions.can('destroy', Subject.OauthApplication),
- disabled: remove.isPending,
- onSelect: () => handleDelete(application),
- },
]}
/>
)}
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/oauth-clients.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/oauth-clients.tsx
new file mode 100644
index 0000000000..22e7a5ac36
--- /dev/null
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/oauth-clients.tsx
@@ -0,0 +1,110 @@
+import type { OauthApplication } from '@spree/admin-sdk'
+import {
+ adminClient,
+ PageHeader,
+ ResourceTable,
+ resourceSearchSchema,
+ Subject,
+ usePermissions,
+} from '@spree/dashboard-core'
+import { Button, RowActions, useConfirm } from '@spree/dashboard-ui'
+import { createFileRoute } from '@tanstack/react-router'
+import { useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { OauthApplicationSheet } from '../../../../components/spree/oauth-application-sheet'
+import { useDeleteOauthApplication } from '../../../../hooks/use-oauth'
+import '../../../../tables/oauth-clients'
+
+export const Route = createFileRoute('/_authenticated/$storeId/settings/oauth-clients')({
+ validateSearch: resourceSearchSchema,
+ component: OauthClientsSettingsPage,
+})
+
+/**
+ * The developer's surface: the OAuth client registrations themselves.
+ *
+ * Connected agents answers "what did someone connect, and how do I stop it".
+ * This answers "what clients exist and how is one configured" — the client
+ * id and callback a developer needs, which a merchant never does.
+ */
+function OauthClientsSettingsPage() {
+ const { t } = useTranslation()
+ const search = Route.useSearch()
+ const confirm = useConfirm()
+ const remove = useDeleteOauthApplication()
+ const { permissions } = usePermissions()
+ const [editing, setEditing] = useState<OauthApplication | undefined>()
+ const [formOpen, setFormOpen] = useState(false)
+
+ function openForm(client?: OauthApplication) {
+ setEditing(client)
+ setFormOpen(true)
+ }
+
+ async function handleDelete(client: OauthApplication) {
+ const ok = await confirm({
+ title: t('admin.pages.settings.oauth_clients.delete_confirm.title'),
+ message: t('admin.pages.settings.oauth_clients.delete_confirm.message', {
+ name: client.name,
+ }),
+ variant: 'destructive',
+ confirmLabel: t('admin.common.delete'),
+ })
+ if (!ok) return
+
+ await remove.mutateAsync(client.id).catch(() => undefined)
+ }
+
+ return (
+ <div className="flex flex-col gap-6">
+ <PageHeader
+ title={t('admin.pages.settings.oauth_clients.title')}
+ description={t('admin.pages.settings.oauth_clients.subtitle')}
+ actions={
+ permissions.can('update', Subject.OauthApplication) ? (
+ <Button size="sm" onClick={() => openForm()}>
+ {t('admin.pages.settings.oauth_clients.register')}
+ </Button>
+ ) : undefined
+ }
+ />
+
+ <OauthApplicationSheet
+ application={editing}
+ open={formOpen}
+ onOpenChange={(next) => {
+ setFormOpen(next)
+ if (!next) setEditing(undefined)
+ }}
+ />
+
+ <ResourceTable<OauthApplication>
+ tableKey="oauth-clients"
+ queryKey="oauth-applications"
+ hideHeader
+ queryFn={(params) => adminClient.oauth.applications.list(params)}
+ searchParams={search}
+ rowActions={(client) => (
+ <RowActions
+ actions={[
+ {
+ key: 'edit',
+ label: t('admin.common.edit'),
+ visible: permissions.can('update', Subject.OauthApplication),
+ onSelect: () => openForm(client),
+ },
+ {
+ key: 'delete',
+ label: t('admin.common.delete'),
+ destructive: true,
+ visible: permissions.can('destroy', Subject.OauthApplication),
+ disabled: remove.isPending,
+ onSelect: () => handleDelete(client),
+ },
+ ]}
+ />
+ )}
+ />
+ </div>
+ )
+}
diff --git a/packages/dashboard/src/tables/oauth-clients.tsx b/packages/dashboard/src/tables/oauth-clients.tsx
new file mode 100644
index 0000000000..2e8f084123
--- /dev/null
+++ b/packages/dashboard/src/tables/oauth-clients.tsx
@@ -0,0 +1,48 @@
+import type { OauthApplication } from '@spree/admin-sdk'
+import { defineTable } from '@spree/dashboard-core'
+import { CopyToClipboardButton, RelativeTime, ResourceNameCell } from '@spree/dashboard-ui'
+import { KeyRoundIcon } from '@spree/dashboard-ui/icons'
+import i18n from 'i18next'
+
+// The developer's view of the same records the merchant connects: the raw
+// registration, including the identifiers a client is configured with.
+defineTable<OauthApplication>('oauth-clients', {
+ title: i18n.t('admin.pages.settings.oauth_clients.title'),
+ description: i18n.t('admin.pages.settings.oauth_clients.subtitle'),
+ emptyIcon: <KeyRoundIcon className="size-8 text-muted-foreground" />,
+ emptyMessage: i18n.t('admin.pages.settings.oauth_clients.empty'),
+ columns: [
+ {
+ key: 'name',
+ label: i18n.t('admin.fields.oauth_application.name.label'),
+ default: true,
+ render: (client) => <ResourceNameCell id={client.id} name={client.name} />,
+ },
+ {
+ key: 'client_id',
+ label: i18n.t('admin.pages.settings.oauth_clients.table.client_id'),
+ default: true,
+ render: (client) => (
+ <span className="flex items-center gap-1">
+ <code className="truncate font-mono text-xs">{client.client_id}</code>
+ <CopyToClipboardButton
+ value={client.client_id}
+ aria-label={i18n.t('admin.pages.settings.oauth_clients.copy_client_id')}
+ />
+ </span>
+ ),
+ },
+ {
+ key: 'redirect_uri',
+ label: i18n.t('admin.fields.oauth_application.redirect_uri.label'),
+ default: true,
+ render: (client) => <code className="font-mono text-xs">{client.redirect_uri}</code>,
+ },
+ {
+ key: 'created_at',
+ label: i18n.t('admin.pages.settings.oauth_clients.table.created'),
+ default: true,
+ render: (client) => <RelativeTime iso={client.created_at} />,
+ },
+ ],
+})
diff --git a/spree/api/lib/spree/api/oauth.rb b/spree/api/lib/spree/api/oauth.rb
index 2d2626f442..8544cf54e6 100644
--- a/spree/api/lib/spree/api/oauth.rb
+++ b/spree/api/lib/spree/api/oauth.rb
@@ -81,9 +81,21 @@ module Spree
)
end
+ # Scopes that govern credentials rather than commerce, and so are
+ # never offered to a delegated client.
+ #
+ # Granting an agent `write_agents` would let it connect another
+ # agent; `write_api_keys` would let it mint a key that outlives the
+ # grant it was given. Neither is an escalation a merchant could
+ # reasonably be asked to judge on a consent screen, and the tools
+ # withhold the models anyway — so the scopes should not be offered in
+ # the first place, rather than offered and quietly inert.
+ CREDENTIAL_SCOPES = %w[agents api_keys integrations webhooks staff].freeze
+
# @return [Array<String>]
def staff_scope_keys
- Spree.permissions.grantable_keys(Spree::PermissionConfiguration::STAFF_AUDIENCE)
+ Spree.permissions.grantable_keys(Spree::PermissionConfiguration::STAFF_AUDIENCE).
+ reject { |key| CREDENTIAL_SCOPES.any? { |scope| key.to_s.end_with?("_#{scope}") } }
end
# Whether every requested audience names a resource this application