keys is the full path in the secret object, with dots. A path to an object gives the object.
Over HTTP the default secret of the account answers. From code, fromSecretName reads another secret of the account by its name ; over HTTP that key is ignored.
constkey=awaitg.sys.system.getSecret('stripe.apiKey');const[key2,cs]=awaitg.sys.system.getSecret(['stripe.apiKey','common.connectionString.mysql_8']);conststaging=awaitg.sys.system.getSecret('stripe.apiKey','staging');// from the secret named staging
key=awaitg.sys.system.get_secret('stripe.apiKey')key2,cs=awaitg.sys.system.get_secrets(['stripe.apiKey','common.connectionString.mysql_8'])staging=awaitg.sys.system.get_secret('stripe.apiKey','staging')# from the secret named staging
$key = $g->sys->system->getSecret('stripe.apiKey');[$key2, $cs] = $g->sys->system->getSecrets(['stripe.apiKey', 'common.connectionString.mysql_8']);$staging = $g->sys->system->getSecret('stripe.apiKey', 'staging'); // from the secret named staging
varkey=awaitg.Sys.System.GetSecret("stripe.apiKey");varboth=awaitg.Sys.System.GetSecrets(["stripe.apiKey","common.connectionString.mysql_8"]);var(key2,cs)=(both[0],both[1]);varstaging=awaitg.Sys.System.GetSecret("stripe.apiKey","staging");// from the secret named staging
key,err:=g.Sys.System.GetSecret("stripe.apiKey")iferr!=nil{returnnil,err}both,err:=g.Sys.System.GetSecrets([]string{"stripe.apiKey","common.connectionString.mysql_8"})iferr!=nil{returnnil,err}key2,cs:=both[0],both[1]staging,err:=g.Sys.System.GetSecret("stripe.apiKey","staging")// from the secret named stagingiferr!=nil{returnnil,err}
letkey=g.sys.system.get_secret("stripe.apiKey",None)?;letboth=g.sys.system.get_secrets(&["stripe.apiKey","common.connectionString.mysql_8"],None)?;let(key2,cs)=(&both[0],&both[1]);letstaging=g.sys.system.get_secret("stripe.apiKey",Some("staging"))?;// from the secret named staging
Objectkey=g.sys.system.getSecret("stripe.apiKey");List<Object>both=g.sys.system.getSecrets(List.of("stripe.apiKey","common.connectionString.mysql_8"));Objectkey2=both.get(0),cs=both.get(1);Objectstaging=g.sys.system.getSecret("stripe.apiKey","staging");// from the secret named staging
valkey=g.sys.system.getSecret("stripe.apiKey")val(key2,cs)=g.sys.system.getSecrets(listOf("stripe.apiKey","common.connectionString.mysql_8"))valstaging=g.sys.system.getSecret("stripe.apiKey","staging")// from the secret named staging
Secrets are never in Git and never in the answer of another API : this API is the way to read them, and it is a sensitive one. Grant it to the groups which need it, or read the secret from your code only (NO_ACCESS custom APIs).
Over HTTP, a system API answers once its settings give it apiAccessType: TOKEN_ACCESS (the token of an API user whose group grants this system API, in x-am-authorization) or IS_PUBLIC. Without settings it is NO_ACCESS : your code calls it through g.sys, the admin panel tests it, and an HTTP call is refused.
The settings can also cache the answer or require person tokens (authProviders) ; pre and post hooks run around it like around any API.
The request headers apply : x-am-response-case, x-am-content-type-response, x-am-internationalization, x-am-tenant-username…