kamu-cli icon indicating copy to clipboard operation
kamu-cli copied to clipboard

Invalid accountName in tokenstore after GH login

Open sergiimk opened this issue 2 years ago • 1 comments

  • Start a local api-server in a multi-tenant mode and a web-ui
  • Run kamu login --server http://localhost:8080
  • Login with github account
  • Observe in .kamu/.kamutokenstore:
kind: KamuTokenStore
version: 1
content:
- frontendUrl: http://localhost:4200/
  backendUrl: http://localhost:8080/
  tokens:
  - accountName: kamu
    accessToken: eyJ0e...mx

Here accountName: kamu is confusing. It should either reflect the account name of the logged in user (sergiimk in my case), or not be there at all (preferred, as it doesn't really serve any functional purpose - all we need is a token).

sergiimk avatar Oct 27 '23 23:10 sergiimk

The store reflects tokens of local workspace users in relation to remote API server. If the following step was done from a workspace with single-tenant repository:

Run kamu login --server http://localhost:8080

then there is no issue, as kamu is the only possible user name in the single-tenant repository.

Using the name of the logged in user is not correct, because there may be multiple users on the same machine using the same workspace in a shared catalog.

zaychenko-sergei avatar Oct 28 '23 19:10 zaychenko-sergei