MCPcopy Create free account
hub / github.com/cloudflare/cloudflared / get_management_token

Method get_management_token

component-tests/cli.py:32–43  ·  view source on GitHub ↗
(self, config, config_path, resource)

Source from the content-addressed store, hash-verified

30 return json.loads(listed.stdout)
31
32 def get_management_token(self, config, config_path, resource):
33 basecmd = [config.cloudflared_binary]
34 if config_path is not None:
35 basecmd += ["--config", str(config_path)]
36 origincert = get_config_from_file()["origincert"]
37 if origincert:
38 basecmd += ["--origincert", origincert]
39
40 cmd_args = ["management", "token", "--resource", resource, config.get_tunnel_id()]
41 cmd = basecmd + cmd_args
42 result = run_subprocess(cmd, "token", self.logger, check=True, capture_output=True, timeout=15)
43 return json.loads(result.stdout.decode("utf-8").strip())["token"]
44
45 def get_tail_token(self, config, config_path):
46 """

Callers 2

get_management_urlMethod · 0.95
get_management_wsurlMethod · 0.95

Calls 3

get_config_from_fileFunction · 0.90
run_subprocessFunction · 0.85
get_tunnel_idMethod · 0.80

Tested by

no test coverage detected