Skip to content

feat(import-tool): sign in with an API token instead of user and password - #11142

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/import-tool-token
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/import-tool-token

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

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 with HULY_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.).

…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

No deployments
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.

Cannot use Import Tool with Google Sign-In (no way to set password or export CSV)

1 participant