Skip to content

Input

Input describes the situation to test, not what you expect to happen. For example: someone requests ops, and authentication for flow primary returns account alice. Expectations belong in assertions.

Supply an object as the value of each test's input. The runner does not obtain missing observations from the host or an IdP.

Properties

request

The logical SSH or HTTP request. At least requestingName must be explicit.

authentication

An object keyed by configured YAML flow name, not username or test name. Supply a result for every flow whose authentication the request needs to attempt. Omitting a needed result is an error, not an assumed denial.

If no flow reaches authentication, no outcomes are needed; object {} makes that explicit. Requirements may exclude a flow before its outcome is consulted.

Authentication assumption

Each value in input.authentication describes one flow's authentication assumption with the properties below. Bifröst does not check a password or run an OIDC exchange to obtain it.

outcome

The authentication result to assume for this flow, not the expected overall test decision.

mode

How to interpret the assumption. Local authentication defaults to post-authentication; OIDC success requires explicit verified-oidc. See local mapping and OIDC data.

account

string

Required for local allow in post-authentication mode. It names an existing supplied Account, not an account to look up on the host. Optional in mapped-local mode, but must agree with the resolved name when supplied. Do not supply it for OIDC.

oidc

Required for an OIDC allow with mode = "verified-oidc". Not accepted for local authentication or with an OIDC deny. The identity must match the configured flow's issuer.

Examples

Use this object as a test's input:

1
2
3
4
5
6
local input = object {
  request = object { requestingName = "ops" },
  authentication = object {
    primary = object { outcome = "allow", account = "alice" },
  },
}

primary refers to flows[].name: primary in the YAML. alice is a supplied account fact. Neither name is derived from the suite's name.

For an assumed authentication denial:

1
2
3
local outcomes = object {
  primary = object { outcome = "deny" },
}

Use outcomes as input.authentication. A denial can permit a later eligible flow to be tried. An evaluation error stops that path instead. For published HTTP assignments, see flow matching.