Repository navigation
feat(import-tool): sign in with an API token instead of user and password - #11142
Open
MichaelUray wants to merge 1 commit into
Open
MichaelUray wants to merge 1 commit into
MichaelUray wants to merge 1 commit into
Conversation
…word The import commands required --user and --password, so accounts that sign in with Google, GitHub or another single sign-on provider had no way to use the import tool. The import commands now also accept a revocable API token, either with --token or in the HULY_API_TOKEN environment variable. The token goes through the same account service flow as before (getUserWorkspaces and selectWorkspace), and the social id is taken from the account's primary social id, as the API client does. --user and --password keep working; giving both a token and a password is rejected. The workspace token is no longer printed to the log. The README and the import guides describe the new option. Fixes hcengineering#9851 Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
This branch has not been deployed
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.
Fixes #9851
Problem and change
The import commands required --user and --password, so accounts that sign in with Google, GitHub or another single sign-on provider had no way to use the import tool.
The import commands now also accept a revocable API token, either with --token or in the HULY_API_TOKEN environment variable. The token goes through the same account service flow as before (getUserWorkspaces and selectWorkspace), and the social id is taken from the account's primary social id, as the API client does. --user and --password keep working; giving both a token and a password is rejected. The workspace token is no longer printed to the log. The README and the import guides describe the new option.
Tests
New unit tests
dev/import-tool/src/__tests__/credentials.test.ts. Manual check: create a token in Settings → API Tokens and run an import withHULY_API_TOKEN=<token>(or--token), then with--user/--password, and without credentials (clear error).Notes
The export part of the issue is already covered by the existing export plugin (CSV/JSON export of issues, documents etc.).