Skip to content

microvms: add access token create, list, and revoke - #1197

Merged
DO-rrao merged 5 commits into
digitalocean:mainfrom
apinonformoso:apinon/mdrop/629-microvm-access-tokens
Nov 4, 2026
Merged

DO-rrao merged 5 commits into
digitalocean:mainfrom
apinonformoso:apinon/mdrop/629-microvm-access-tokens

Conversation

@apinonformoso

Copy link
Copy Markdown
Contributor

Why

The MicroVM API supports access tokens scoped to one MicroVM. godo has no methods for that API. Go users cannot manage scoped tokens from code.

What changed

  • Add MicroVMs.CreateAccessToken to create a token for one MicroVM. The API returns the token value once, in the create response only.
  • Add MicroVMs.ListAccessTokens to list the live tokens of one MicroVM. The list does not return token values.
  • Add MicroVMs.RevokeAccessToken to revoke one token. Revoke is permanent.
  • Add MicroVMAccessToken, MicroVMAccessTokenCreated, and MicroVMAccessTokenCreateRequest. Field names match the API contract.

How it was tested

  • Unit tests cover create, list, and revoke. The create test checks the request body and the 201 response.
  • Argument tests cover empty IDs and a null create request.
  • go test ./... passes. go vet ./... passes. gofmt reports no changes.

MDROP-629

Co-authored-by: Cursor <cursoragent@cursor.com>
@apinonformoso
apinonformoso marked this pull request as ready for review October 29, 2026 16:35
@DO-rrao
DO-rrao merged commit b9ae988 into digitalocean:main Nov 4, 2026
8 checks passed
@apinonformoso
apinonformoso deleted the apinon/mdrop/629-microvm-access-tokens branch November 4, 2026 14:04
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

⌂ 换网址