Allow for optionally specifying an audience for containerboot. This is
passed to tailscale up to allow for containerboot to use automatic ID
token generation for authentication.
Updates https://github.com/tailscale/corp/issues/34430
Signed-off-by: Mario Minardi <mario@tailscale.com>
returnerrors.New("TS_EXPERIMENTAL_VERSIONED_CONFIG_DIR cannot be set in combination with TS_HOSTNAME, TS_EXTRA_ARGS, TS_AUTHKEY, TS_ROUTES, TS_ACCEPT_DNS, TS_CLIENT_ID, TS_CLIENT_SECRET, TS_ID_TOKEN.")
ifs.TailscaledConfigFilePath!=""&&
(s.AcceptDNS!=nil||
s.AuthKey!=""||
s.Routes!=nil||
s.ExtraArgs!=""||
s.Hostname!=""||
s.ClientID!=""||
s.ClientSecret!=""||
s.IDToken!=""||
s.Audience!=""){
conflictingArgs:=[]string{
"TS_HOSTNAME",
"TS_EXTRA_ARGS",
"TS_AUTHKEY",
"TS_ROUTES",
"TS_ACCEPT_DNS",
"TS_CLIENT_ID",
"TS_CLIENT_SECRET",
"TS_ID_TOKEN",
"TS_AUDIENCE",
}
returnfmt.Errorf("TS_EXPERIMENTAL_VERSIONED_CONFIG_DIR cannot be set in combination with %s.",strings.Join(conflictingArgs,", "))
}
ifs.IDToken!=""&&s.ClientID==""{
returnerrors.New("TS_ID_TOKEN is set but TS_CLIENT_ID is not set")
}
ifs.Audience!=""&&s.ClientID==""{
returnerrors.New("TS_AUDIENCE is set but TS_CLIENT_ID is not set")
}
ifs.IDToken!=""&&s.ClientSecret!=""{
returnerrors.New("TS_ID_TOKEN and TS_CLIENT_SECRET cannot both be set")