Skip to content

microvm: access-token create, list, and revoke - #2092

Merged
anup-deka merged 1 commit into
digitalocean:mainfrom
apinonformoso:apinon/mdrop/630-microvm-access-tokens
Nov 4, 2026
Merged

anup-deka merged 1 commit into
digitalocean:mainfrom
apinonformoso:apinon/mdrop/630-microvm-access-tokens

Conversation

@apinonformoso

@apinonformoso apinonformoso commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

The MicroVM API supports access tokens scoped to one MicroVM. doctl has no commands for that API. Users cannot create, list, or revoke these tokens from the command line.

What changed

  • Add doctl compute microvm access-token create <microvm-id> --name <name> [--expires-in-seconds N]. The output shows the token value once. list never shows it.
  • Add doctl compute microvm access-token list <microvm-id>. It shows the ID, name, created time, and expiry of each live token.
  • Add doctl compute microvm access-token revoke <microvm-id> <token-id>. It asks for confirmation unless you pass --force.
  • Add the three methods to do.MicroVMsService and regenerate its mock.
  • Add the MicroVMAccessToken displayer. The Token column appears only in the create output.
  • Bump godo to v1.236.0, which carries the access token methods from microvms: add access token create, list, and revoke godo#1197.

Vendored godo changes outside this feature

The bump from v1.234.0 to v1.236.0 also vendors two other godo changes. One needs a test update here:

  • godo#1204 drops omitempty from HostedAgentSession.ResumeOnTopoff so a revoked consent reads as false instead of absent. I updated the tag assertion in TestResumeOnTopoffWireNames to match.
  • godo#1201 adds Insights dashboard support (insights.go). No doctl change needed.

How it was tested

  • New unit tests cover create, list, and revoke.
  • Argument tests cover a missing name, a name over 64 characters, a negative expiry, and a missing token ID.
  • go test -mod=vendor ./commands/... ./do/... ./pkg/... ./internal/... . passes. TestRegistryLogout fails locally on main too and passes in CI.
  • go vet passes. gofmt reports no changes.
  • I built the binary and checked the --help output of the new commands.

@apinonformoso
apinonformoso force-pushed the apinon/mdrop/630-microvm-access-tokens branch from a1f89cd to 987db57 Compare November 4, 2026 14:09
Co-authored-by: Cursor <cursoragent@cursor.com>
@apinonformoso
apinonformoso force-pushed the apinon/mdrop/630-microvm-access-tokens branch from b7fcd63 to 38f13a7 Compare November 4, 2026 16:22
@anup-deka
anup-deka merged commit 7e22058 into digitalocean:main Nov 4, 2026
6 checks passed
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.

3 participants

⌂ 换网址