Replace API token auth with OAuth flow and multi-project support#6
Open
stefanoverna wants to merge 1 commit intomainfrom
Open
Replace API token auth with OAuth flow and multi-project support#6stefanoverna wants to merge 1 commit intomainfrom
stefanoverna wants to merge 1 commit intomainfrom
Conversation
Remove DATOCMS_API_TOKEN/DATOCMS_ENVIRONMENT env vars in favor of browser-based OAuth authentication. All tools now accept project and environment arguments, enabling multi-project workflows in a single session.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OAuth authentication (replaces API token)
The
DATOCMS_API_TOKENandDATOCMS_ENVIRONMENTenvironment variables have been removed. Authentication now uses an OAuth flow.Three new tools handle authentication:
datocms_login— Opens a browser for OAuth authorization, saves credentials to~/.config/datocms-mpc/credentials.json(chmod 600).datocms_logout— Removes saved credentials.datocms_whoami— Shows the currently authenticated account (name, email, company).Multi-project support
Every tool that interacts with the DatoCMS API now accepts a
projectargument (site ID, internal subdomain,*.admin.datocms.comURL, custom domain, or full URL) and an optionalenvironmentargument. This means you can work across multiple projects in a single session without restarting the server.Project resolution searches across the user's personal account and all organizations in parallel.
Breaking changes
DATOCMS_API_TOKENenv var is no longer supported. Users must authenticate viadatocms_login.DATOCMS_ENVIRONMENTenv var is no longer supported. Passenvironmentas a tool argument instead.projectargument.Other changes
execSyncbrowser opening with theopenpackage.dashboardBaseUrlfrom credentials — only the standard DatoCMS OAuth endpoint is supported.Test plan
datocms_loginand verify browser opens, credentials are saveddatocms_whoamiand verify account info is returneddatocms_logoutand verify credentials are removed*.admin.datocms.comURL, and custom domain