true if setAirGapped(true) was called
Whether the curl commands are printed.
true if setCurlirize(true) was called
Whether the curl commands show the real credentials.
true if setCurlirizeSecrets(true) was called
Get the AM host base URL
the AM host base URL
Get the IDM host base URL
the IDM host base URL
Get a clone of the full state as an object. The clone is plain data that
JSON.stringify accepts: it has no auto-refresh timer (a live timer is
circular; getAutoRefreshTimer() returns it) and no functions. It holds
the credentials and tokens the state holds, as they are, so do not log it.
a clone of the state
Get the directory that was set for the cache of the application template catalog.
the directory that was set, or undefined if none was (the library then uses ~/.frodo/AppTemplates)
Whether the fallback of placeholders to the environment of the process is on (see
setUseProcessEnvironmentForPlaceholders).
true if setUseProcessEnvironmentForPlaceholders(true) was called
Whether the cache of the application template catalog is on.
true if setUseTemplateCatalogCache(true) was called
Reset the state to default values. The environment values (setEnv, setEnvs) are removed.
Which credential type is currently active for this session — set once,
wherever getTokens()'s non-interactive branches (or a browser login)
actually activate a credential. Used by ops/PrivilegeEscalationOps.ts
to know where on the escalation ladder the current session sits.
Turn air-gapped mode on or off. While it is on, the library makes no request to a host that the caller did not name: the tenant the state is connected to is not affected, but a function that would download from a public host on its own (for example the default source of the application template catalog) fails with an error instead, and says that the data must be given explicitly. A caller that names a host itself (for example the URL of a mirror) is not blocked. Off by default and not persisted: the state does not read it from the environment, a connection profile or a file, so the caller (frodo-cli, the MCP server) decides every time.
true to turn air-gapped mode on
Cached for the life of the session by determineCallerTrustTier() (ops/CallerTrustTierOps.ts).
Extension point letting a customer plug in their own privilege model for browser-login sessions — see ops/CallerTrustTierOps.ts.
Print the curl command of every REST call the library makes (the handler
set with setCurlirizeHandler receives it). Off by default.
By default the command shows the name of every header that carries a
credential and replaces its value with a placeholder
(-H "Authorization:Bearer <redacted>", -H "Cookie:iPlanetDirectoryPro=<redacted>"),
and does the same for the password, token and secret fields of a request
body. The header overrides (setAuthenticationHeaderOverrides,
setConfigurationHeaderOverrides) are all masked. To see the real values,
call setCurlirizeSecrets(true).
true to print the curl commands
Show the real credentials in the curl commands (see setCurlirize), so that
a command can be copied and run. Off by default and never persisted: the
state does not read it from the environment, a connection profile or a
file, so a caller has to ask for it every time. The first time a command
with a credential is printed, the print handler also gets one warning (type
warn) that the output contains valid credentials.
true to print real credentials
since v4.9.0 — use setPreferredCredential()/
getPreferredCredential() instead, which also support 'browser'.
Kept working, unchanged, for external callers still typed against the
3-value union: getDefaultCredential() defensively filters out
'browser' (returning undefined instead) so it can never hand back a
value outside its own declared type, even though it now shares storage
with the wider preferredCredential.
Optionalclear: booleanSet the AM host base URL
Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring or alias.
Set the IDM host base URL
Identity Management base URL, e.g.: https://cdk.iam.example.com/openidm. To use a connection profile, just specify a unique substring or alias.
Explicit, persisted preference for which credential type later implicit
commands against this profile should use — 'browser' included, unlike
the deprecated defaultCredential accessors below. An undefined value
means "no preference set," not "none of the above." Never mirrors
ambient session state on save; only ever written when the caller
explicitly requests it (e.g. via --preferred-credential), so an
unrelated save never silently overwrites a previously-configured
preference — and, when explicitly set, takes priority over a stale
legacy authMode: 'interactive' a profile may already carry (the fix
for there previously being no way to undo that once persisted). Backed
by the same underlying storage defaultCredential uses below — the two
are two typed views onto one value, not two separate fields. See
AuthenticateOps.ts's tryBrowserLogin()/getTokens() for how this is
consulted.
Only meaningful when preferredCredential === 'browser': whether this
profile prefers the OAuth2 Device Authorization Grant over the default
loopback-redirect flow for its interactive logins, without needing
--device repeated on every invocation. undefined means no
preference set (falls back to whatever --device/the env var says for
that one invocation, exactly like today).
Extension point letting api/BaseApi.ts trigger a credential-privilege
escalation without importing ops/AuthenticateOps.ts directly (would be
circular — AuthenticateOps.ts already depends on BaseApi.ts
transitively). Installed once by getTokens() after the initial
credential activates; called by attachCredentialInterceptor() when a
pre-flight scope check fails. Resolves true if a higher-tier
credential was found and activated (the failed request should be
retried), false if there is nothing left to escalate to.
Set the directory of the cache of the application template catalog. When it
is not set, the library uses the folder AppTemplates in the Frodo home
directory (~/.frodo/AppTemplates), the way the token cache finds its
file.
directory of the cache
Let the placeholders ${NAME} of the files that the library reads (readJsonFile, and the readers built on it, with
placeholders resolved) fall back to the environment variables of the process: a placeholder is filled from the
value that this state holds for the name (setEnv, setEnvs) and, only when the state holds none, from the
variable of that name in the environment of the process. A name that has no value in either still fails with the
error that names the placeholder. An empty value counts as a value.
Off by default and not persisted: the state does not read the switch from the environment, a connection profile or a
file, so the caller decides every time. It is off because a file that names ${SOME_VARIABLE} would otherwise copy a
variable of the process into whatever the file is written to, and the library is embedded in programs that run with
environments of their own. It changes nothing for a caller that does not turn it on.
The reverse direction never reads the process environment, switch or not: an export replaces the values that this
state holds with their ${NAME} placeholder, and nothing else. The substitution of the configuration objects of
IDM when they are imported (importConfigEntities) also uses the values of the state only, because those objects
may legitimately contain ${...} in the source of a script.
true to turn the fallback on
Turn the cache of the application template catalog on or off. While it is
on, app.template.readCatalog (and the functions that read the catalog)
keep the catalog they download from the public source in a directory
(setTemplateCatalogCachePath), do not ask the source again while the
kept copy is fresh, ask it with the validators of the kept copy when it is
not, and read the kept copy when air-gapped mode is on. A catalog the
caller hands over and a URL the caller names are never kept. Off by default
and not read from the environment, a profile or a file: the caller decides.
true to turn the cache on
Whether air-gapped mode is on (see
setAirGapped).