digitalocean / digitalocean/doctl

Support configuring new auth context without interactivity

Open
#703 3 comments 4 reactions 0 assignees View on GitHub
Needs Investigation
Dominant language
Go
Stars
3.4k
Forks
496
Avg merge
1d 2h
Merged PRs (30d)
31

Description

In some cases, it can be useful to configure `doctl` non-interactively. Currently, we support this when setting up the default context. For example, running the following will validate the token and add it to the `doctl` config file without additional user interaction:

```
doctl auth init -t $DO_TOKEN
Using token [asupersekrettokenthatisverylongidontwanttotypeit]

Validating token... OK
```

If the `--context` flag is added to that command, the token is ignored and the user is prompted to enter the token manually:

```
doctl auth init --context new-context -t $DO_TOKEN
DigitalOcean access token:
```

The behaviour should be consistent. When passing a token and a context together to `doctl auth init`, we should validate the token and configure a new context to use it without additional user input.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.