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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Renamed the agents permission scope to oauth_applications
Damian Legawiec3b7ef4202214
diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.jsonindex 7c36817aa6..81344b3501 100644--- a/packages/dashboard/src/locales/ar.json+++ b/packages/dashboard/src/locales/ar.json@@ -4292,7 +4292,7 @@"stock": "مستويات المخزون والمواقع والحركات والتحويلات","store_credits": "أرصدة المتجر للعملاء","webhooks": "نقاط الويب هوك وعمليات التسليم",- "agents": "وكلاء الذكاء الاصطناعي المتصلون بهذا المتجر"+ "oauth_applications": "عملاء OAuth المسجّلون لهذا المتجر"},"grid": {"read_aria": "عرض {{resource}}",@@ -4345,7 +4345,7 @@"stock": "مخزون","store_credits": "Store credits","webhooks": "Webhooks",- "agents": "الوكلاء"+ "oauth_applications": "تطبيقات OAuth"}},"policies": {diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.jsonindex 0d6ce224fb..aa49fd2eaa 100644--- a/packages/dashboard/src/locales/de.json+++ b/packages/dashboard/src/locales/de.json@@ -4264,7 +4264,7 @@"stock": "Bestände, Lagerorte, Bewegungen und Transfers","store_credits": "Guthaben der Kunden","webhooks": "Webhook-Endpunkte und Zustellungen",- "agents": "Mit diesem Shop verbundene KI-Agenten"+ "oauth_applications": "Für diesen Shop registrierte OAuth-Clients"},"grid": {"read_aria": "{{resource}} ansehen",@@ -4317,7 +4317,7 @@"stock": "Bestand","store_credits": "Guthaben","webhooks": "Webhooks",- "agents": "Agenten"+ "oauth_applications": "OAuth-Anwendungen"}},"policies": {diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.jsonindex 53aced8f6c..12a8ce912d 100644--- a/packages/dashboard/src/locales/en.json+++ b/packages/dashboard/src/locales/en.json@@ -4264,7 +4264,7 @@"stock": "Stock levels, locations, movements and transfers","store_credits": "Customer store credit balances","webhooks": "Webhook endpoints and deliveries",- "agents": "AI agents connected to this store"+ "oauth_applications": "OAuth clients registered against this store"},"grid": {"read_aria": "View {{resource}}",@@ -4317,7 +4317,7 @@"stock": "Stock","store_credits": "Store credits","webhooks": "Webhooks",- "agents": "Agents"+ "oauth_applications": "OAuth applications"}},"policies": {diff --git a/packages/dashboard/src/locales/es.json b/packages/dashboard/src/locales/es.jsonindex 8488580a2a..8ec4b10edd 100644--- a/packages/dashboard/src/locales/es.json+++ b/packages/dashboard/src/locales/es.json@@ -4184,7 +4184,7 @@"stock": "Niveles de stock, ubicaciones, movimientos y transferencias","store_credits": "Saldos de crédito de tienda de los clientes","webhooks": "Endpoints y entregas de webhooks",- "agents": "Agentes de IA conectados a esta tienda"+ "oauth_applications": "Clientes OAuth registrados en esta tienda"},"grid": {"read_aria": "Ver {{resource}}",@@ -4237,7 +4237,7 @@"stock": "Stock","store_credits": "Créditos de tienda","webhooks": "Webhooks",- "agents": "Agentes"+ "oauth_applications": "Aplicaciones OAuth"}},"settings_nav": {diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.jsonindex 7fcdc486fc..cce6c99190 100644--- a/packages/dashboard/src/locales/fr.json+++ b/packages/dashboard/src/locales/fr.json@@ -4264,7 +4264,7 @@"stock": "Niveaux de stock, emplacements, mouvements et transferts","store_credits": "Avoirs des clients","webhooks": "Points de terminaison et livraisons de webhooks",- "agents": "Agents IA connectés à cette boutique"+ "oauth_applications": "Clients OAuth enregistrés pour cette boutique"},"grid": {"read_aria": "Voir {{resource}}",@@ -4317,7 +4317,7 @@"stock": "Stock","store_credits": "Avoirs en boutique","webhooks": "Webhooks",- "agents": "Agents"+ "oauth_applications": "Applications OAuth"}},"policies": {diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.jsonindex 803774f0e7..95f969a16d 100644--- a/packages/dashboard/src/locales/pl.json+++ b/packages/dashboard/src/locales/pl.json@@ -4318,7 +4318,7 @@"stock": "Stany magazynowe, lokalizacje, ruchy i transfery","store_credits": "Salda środków sklepowych klientów","webhooks": "Punkty końcowe i dostarczenia webhooków",- "agents": "Agenty AI połączone z tym sklepem"+ "oauth_applications": "Klienci OAuth zarejestrowani w tym sklepie"},"grid": {"read_aria": "Podgląd: {{resource}}",@@ -4371,7 +4371,7 @@"stock": "Stan magazynowy","store_credits": "Środki w sklepie","webhooks": "Webhooki",- "agents": "Agenty"+ "oauth_applications": "Aplikacje OAuth"}},"policies": {diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.jsonindex 7901a66575..17eda161ea 100644--- a/packages/dashboard/src/locales/zh-CN.json+++ b/packages/dashboard/src/locales/zh-CN.json@@ -4254,7 +4254,7 @@"stock": "库存水平、仓库、变动与调拨","store_credits": "客户店铺余额","webhooks": "Webhook 端点与投递记录",- "agents": "连接到此店铺的 AI 代理"+ "oauth_applications": "已在此店铺注册的 OAuth 客户端"},"grid": {"read_aria": "查看{{resource}}",@@ -4307,7 +4307,7 @@"stock": "库存","store_credits": "店铺信用","webhooks": "Webhooks",- "agents": "代理"+ "oauth_applications": "OAuth 应用"}},"policies": {diff --git a/spree/api/app/controllers/spree/api/v3/admin/oauth/application_tokens_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/oauth/application_tokens_controller.rbindex 131345fdcf..d3c362fa1f 100644--- a/spree/api/app/controllers/spree/api/v3/admin/oauth/application_tokens_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/oauth/application_tokens_controller.rb@@ -10,7 +10,7 @@ module Spree# again, while anything still holding a token stops working on its# next call.class ApplicationTokensController < Spree::Api::V3::Admin::BaseController- scoped_resource :agents+ scoped_resource :oauth_applicationsdef destroyapplication = current_store.oauth_applications.find_by_prefix_id!(params[:application_id])diff --git a/spree/api/app/controllers/spree/api/v3/admin/oauth/applications_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/oauth/applications_controller.rbindex bd87688387..18e505e24c 100644--- a/spree/api/app/controllers/spree/api/v3/admin/oauth/applications_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/oauth/applications_controller.rb@@ -14,7 +14,7 @@ module Spree# Its own permission rather than store configuration: a standing# credential to the back office is not the same kind of thing as# a delivery zone.- scoped_resource :agents+ scoped_resource :oauth_applicationsprotecteddiff --git a/spree/api/lib/spree/api/oauth.rb b/spree/api/lib/spree/api/oauth.rbindex 8544cf54e6..719559ba7b 100644--- a/spree/api/lib/spree/api/oauth.rb+++ b/spree/api/lib/spree/api/oauth.rb@@ -84,13 +84,13 @@ module Spree# 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+ # Granting an agent `write_oauth_applications` 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+ CREDENTIAL_SCOPES = %w[oauth_applications api_keys integrations webhooks staff].freeze# @return [Array<String>]def staff_scope_keysdiff --git a/spree/api/spec/requests/spree/api/v3/admin/oauth/authorizations_spec.rb b/spree/api/spec/requests/spree/api/v3/admin/oauth/authorizations_spec.rbindex 61c84441bb..51550e7ef6 100644--- a/spree/api/spec/requests/spree/api/v3/admin/oauth/authorizations_spec.rb+++ b/spree/api/spec/requests/spree/api/v3/admin/oauth/authorizations_spec.rb@@ -19,7 +19,7 @@ RSpec.describe 'Admin OAuth consent', type: :request dolet(:staffer) docreate(:admin_user, :without_admin_role).tap do |user|role = create(:role, name: "products-only-#{SecureRandom.hex(4)}",- permissions: %w[write_agents read_products], resource: store)+ permissions: %w[write_oauth_applications read_products], resource: store)create(:role_user, user: user, role: role)endenddiff --git a/spree/core/lib/spree/core/permissions/default_catalog.rb b/spree/core/lib/spree/core/permissions/default_catalog.rbindex 4d6c5d594f..50ef873f76 100644--- a/spree/core/lib/spree/core/permissions/default_catalog.rb+++ b/spree/core/lib/spree/core/permissions/default_catalog.rb@@ -206,7 +206,7 @@ module Spree# the store, so it is its own permission rather than part of settings# — a merchandiser who may edit a delivery zone is not thereby someone# who may connect Claude to the back office.- catalog.register_scope(:agents, group: :access, resources: -> { [Spree::OauthApplication] })+ catalog.register_scope(:oauth_applications, group: :access, resources: -> { [Spree::OauthApplication] })catalog.register_scope(:staff, group: :access, resources: -> {[Spree.admin_user_class, Spree::Invitation, Spree::Role, Spree::RoleUser]})