Skip to content

Add optional separate source/target Personal Access Tokens - #39

Open
alpipego wants to merge 1 commit into
storyblok:mainfrom
alpipego:feat/separate-source-target-tokens
Open

Add optional separate source/target Personal Access Tokens#39
alpipego wants to merge 1 commit into
storyblok:mainfrom
alpipego:feat/separate-source-target-tokens

Conversation

@alpipego

Copy link
Copy Markdown

Allow the source and target spaces to use different Personal Access Tokens, so each can be scoped with least privilege.

What

Two optional env vars:

  • VITE_SOURCE_PERSONAL_ACCESS_TOKEN — used only for source-space requests
  • VITE_TARGET_PERSONAL_ACCESS_TOKEN — used only for target-space requests

Both fall back to VITE_PERSONAL_ACCESS_TOKEN when unset, so existing single-token setups are unaffected.

Why

The tool reads from the source and writes to the target with one token today, so that token needs write scope on both spaces. With a separate source token you can scope it read-only (assets + asset folders), which means the tool can never mutate the source space regardless of a bug. The target token keeps the write scopes it needs.

.env.example and the readme are updated to document the two optional vars.

Allow VITE_SOURCE_PERSONAL_ACCESS_TOKEN and
VITE_TARGET_PERSONAL_ACCESS_TOKEN so each space can use a
least-privilege token: the source token can be scoped read-only,
which prevents the tool from ever mutating the source space. Both
fall back to VITE_PERSONAL_ACCESS_TOKEN, so existing single-token
setups are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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