()
| 848 | } |
| 849 | |
| 850 | func buildTokenCommand() *cli.Command { |
| 851 | return &cli.Command{ |
| 852 | Name: "token", |
| 853 | Action: cliutil.ConfiguredAction(tokenCommand), |
| 854 | Usage: "Fetch the credentials token for an existing tunnel (by name or UUID) that allows to run it", |
| 855 | UsageText: "cloudflared tunnel [tunnel command options] token [subcommand options] TUNNEL", |
| 856 | Description: "cloudflared tunnel token will fetch the credentials token for a given tunnel (by its name or UUID), which is then used to run the tunnel. This command fails if the tunnel does not exist or has been deleted. Use the flag `cloudflared tunnel token --cred-file /my/path/file.json TUNNEL` to output the token to the credentials JSON file. Note: this command only works for Tunnels created since cloudflared version 2022.3.0", |
| 857 | Flags: []cli.Flag{credentialsFileFlagCLIOnly}, |
| 858 | CustomHelpTemplate: commandHelpTemplate(), |
| 859 | } |
| 860 | } |
| 861 | |
| 862 | func tokenCommand(c *cli.Context) error { |
| 863 | sc, err := newSubcommandContext(c) |
no test coverage detected