Skip to content

feat(oauth): storefront scopes for Continue with Fleetbase - #163

Merged
roncodes merged 1 commit into
release/v0.4.30from
feature/oauth-scopes
Oct 25, 2026
Merged

roncodes merged 1 commit into
release/v0.4.30from
feature/oauth-scopes

Conversation

@roncodes

Copy link
Copy Markdown
Member

Adds Storefront scopes for Continue with Fleetbase, the OAuth provider in fleetbase/core-api#324. With them, AppHelm can connect a Cloud customer's storefront without the customer pasting any keys.

Scope Endpoint What it does
storefront:read GET /storefront/oauth/v1/storefronts Lists the token's organization's stores and networks, with their public store_/network_ keys, name, currency, contact, logo, online, pickup_enabled and review_access_type. Nothing about customers, orders or payments
storefront:app-key POST /storefront/oauth/v1/app-key Creates one live API key per app, named "Storefront app ({app})", or returns the one that app created before. This is the Storefront app's FLEETBASE_KEY. The key is listed under Developers → API Keys, where the organization can revoke it. Keys the app didn't create are never returned
storefront:review-access core's /oauth/v1/review-access/storefront-store|storefront-network/{id} Turns App Review access on or off. Covers both types; the logic is #162's, served through core
  • Organization only. Every query is scoped to the organization the access token is bound to.
  • Optional dependency. Scope registration and the routes are skipped when core-api doesn't have the OAuth provider.
  • Release notes. Added to RELEASE.md under v0.4.30.

Base: release/v0.4.30 (#162). Needs core-api 1.6.74 with #324.

Not run: Storefront's unit tests. This checkout's server_vendor has an older core-api without the OAuth or App Review classes. The token checks these endpoints rely on are tested in core-api#324. These two endpoints still need an end-to-end check on a running stack.

storefront:read lists the token's organization's stores and networks with
their public keys; storefront:app-key creates (or returns) one named API key
per app for its Storefront app build; storefront:review-access covers the
storefront-store and storefront-network types on core's review-access
endpoint.
@roncodes
roncodes merged commit a223242 into release/v0.4.30 Oct 25, 2026
@roncodes
roncodes deleted the feature/oauth-scopes branch October 25, 2026 02:31
roncodes added a commit that referenced this pull request Oct 27, 2026
…review guards

The OAuth StorefrontController (#163) had no tests. Cover the store and
network listing (scoped to the token's organization) and the app key
(created once, reused after; expired, test and other-company keys are
never returned). Also cover the App Review notice in new-order SMS and
mail, and a customer whose account can't be loaded.

OAuthScopes no longer checks for core's OAuth provider: storefront
requires core-api ^1.6.74, which always has it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant