Edit icon Edit This Page

Replace the secret of a personal access token, or of a deploy token with –repo

Replace the secret of a token and show the new secret once. The old secret stops working at once, so every client that uses it breaks until it gets the new one.

Without –repo this rotates one of YOUR PERSONAL ACCESS TOKENS (see rp token list). The new token keeps the name, the scopes and the expiry of the old one; none of them can be changed here (an expired token comes back with 365 days from now). It has a NEW id, which rp prints and puts in the structured output as “id”: revoke it with that id. It works with a login, a browser sign-in or a personal access token, also one in REPSY_TOKEN (RPS-2440). A token whose scopes the credential in use does not cover is refused (403) and nothing changes.

With –repo <name> this rotates a DEPLOY TOKEN of that repository. The server answers only the new secret, not the username, so the structured output has an empty username; the username of the token does not change (see rp token list –repo <name>). Repsy Cloud also gives the token a new id (Repsy OS keeps it); rp prints the id the token has now and puts it in the structured output as “id”. If the server does not say it, rp says so and the id is empty.

rp asks for confirmation on a terminal; in a script pass –yes. The secret is printed like in rp token create (–show-secret, or –output json|yaml / –jq).

NEW=$(rp token rotate <token-id> --yes --show-secret)
rp token rotate <token-id> --repo libs --yes --output json --jq .token
rp token rotate <token-id> [flags]

Options

      --repo string   Rotate a deploy token of this repository (without it: a personal access token)
      --show-secret   Print the new secret on stdout (once); implied by a structured --output

Options inherited from parent commands

      --api-url string           Panel API URL of the profile, overrides the stored value
      --ca-file string           PEM file with extra trusted CA certificates
      --debug                    Print debug output with secrets redacted
      --hostname string          Repsy host to use instead of the current profile
      --insecure                 Do not verify TLS certificates (unsafe; plain http is chosen with the URL, not with this flag)
      --insecure-storage         Keep credentials in a plain 0600 file instead of the OS keyring (unsafe; a warning is printed once per command)
      --jq string                Filter JSON output with a jq expression (implies --output json)
      --no-color                 Disable colored output
      --no-input                 Never prompt; fail when input is needed
      --output table|json|yaml   Output format: table, json or yaml (default table; json when --jq is given)
      --owner string             Owner segment of Cloud protocol URLs; --owner= means none
      --registry-url string      Protocol host URL of the profile, overrides the stored value
      --type os|cloud            Product of the host, overrides detection
      --web-url string           Panel UI URL of the profile (where /cli/auth lives), overrides the stored value
      --yes                      Answer yes to confirmation prompts

See also

  • rp token - Manage personal access tokens and deploy tokens
Found a problem with this page?