TW-4787 Fix CLI auth and secret-store regressions#44
Merged
qasim-nylas merged 1 commit intomainfrom Apr 6, 2026
Merged
Conversation
qasim-nylas
approved these changes
Apr 5, 2026
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
This PR fixes a set of CLI correctness, security, and secret-store regressions centered around OAuth auth flow hardening, secret-store behavior, webhook validation, grant resolution, and MCP transport robustness.
It also addresses the
TW-4787bug where the CLI reportedAPI key not configuredwhen the encrypted file-store fallback existed but could not be unlocked.What changed
GetNylasClient()andGetAPIKey()instead of collapsing them intoAPI key not configuredGetGrantID()prefer direct args /NYLAS_GRANT_ID, treat the stored default as authoritative, and only fall back to config forErrNoDefaultGrantstatevalidation and real PKCE generation / verification to the login flownylas auth providershuman-readable output so blank connectorName/IDfields are not rendered as empty placeholdersTests
Added and updated unit and integration coverage for:
auth removeconfig/default-grant synchronizationauth providersoutput renderingValidation
Ran:
go test ./internal/cli/authgo build -o bin/nylas ./cmd/nylasgo test -tags=integration ./internal/cli/integration -run 'TestCLI_AuthProviders_HidesEmptyConnectorFields|TestCLI_AuthProviders_RequiresFileStorePassphrase' -count=1make ci-fullmake ci-fullpassed end to end, including unit tests, race tests, integration tests, air integration tests, and cleanup.Jira