tursodatabase / turso-cli

Command line interface to Turso.
https://turso.tech
MIT License
215 stars 35 forks source link

`turso db shell` only works from a single machine by default #326

Closed penberg closed 1 year ago

penberg commented 1 year ago

I created a database on one machine, but I am unable to access it from another machine:

[penberg@turing ~]$ turso db list
NAME           LOCATIONS              URL
foo            arn (primary)          libsql://foo-penberg.turso.io
[penberg@turing ~]$ turso db shell foo
Error: failed to connect: 401 Unauthorized

The issue is embarrassing and obvious when you think about it: the CLI uses basic authentication credentials to login. But those credentials are only ever stored on the machine that created the database.

Suggested fix: let's automatically generate a JWT for a database on every machine the CLI is installed on and use that for db shell.

penberg commented 1 year ago

@athoscouto You fixed this, no?

StefanoSaffran commented 1 year ago

so, is this one done?

penberg commented 1 year ago

Yes, it's fixed.

penberg commented 1 year ago

Thanks for the reminder!