CLI Help - doppler configs tokens get/revoke

I’m trying to automate a process that will need a service token. Ideally, I don’t want to generate a new one if one already exists that is not expired.
However, while doing doppler configs tokens create my-token --plain successfully generates a token, I’m having get ‘invalid slug’ errors with both ‘get’ and ‘revoke’ subcommands.

$ doppler configs tokens create doppler-secrets-sync --plain
<REDACTED>
$ doppler configs tokens get doppler-secrets-sync 
Doppler Error: invalid service token slug
$ doppler configs tokens get --slug doppler-secrets-sync 
Doppler Error: invalid service token slug
$ doppler configs tokens revoke doppler-secrets-sync
Unable to delete service token
Doppler Error: Invalid service token.
$

Is there a trick that I’m missing here?

Hi @binnsr!

Welcome to the Doppler Community!

The slug that’s requested there is a UUID that’s returned when you create the token, not the name that you’re passing in. To get the slug, you’d need to not use --plain though. That said, the revoke command takes either the slug or the token itself, so a token can be used to revoke itself.

Alternately, you can get the slug for the current token using:

doppler me --json | jq -r '.slug'

Does that help at all?

Regards,
-Joel

1 Like

that helps. Thanks - I need to do some more thinking on my proposed architecture … might be back with more questions :slight_smile: