Skip to content

Results

actual is the result calculated for one test. It is not the input echoed back and not a live session. Read it inside verify and compare fields with t:IsEqual. All fields are read-only; the decision controls which other fields exist:

Outcome Available data
Flow/target selected Common fields, flow, identity, authentication and target settings.
No flow accepted Common fields only.
Local loginAllowed denied Common fields, flow, identity and stage = "local-login"; no target or authentication result.
Evaluation error A report error, not an invented Result passed to verify.

Reading a field that is absent for this outcome is an error, not a nil return. Choose assertions for the outcome being tested rather than probing success-only properties after a denial.

Properties

decision

Whether the supported selection steps selected a target or denied the request.

scope

string

Always post-authentication/session-target.

authenticationAssumed

bool

Always true: authentication outcomes were supplied by the test.

request

The request values used for matching, after normalization.

flow

The selected configured flow name. Also present for local-login denial; absent when no flow accepted the request.

identity

The identity after configured principal mapping, present on selection or local-login denial.

authentication

The authentication identity used on selection, before principal mapping. This is distinct from the target account and absent on denials.

environment

Calculated target settings on selection. Unlike t.environment, this is not the list of supplied account facts.

stage

string

local-login when the local loginAllowed rule denied. Absent otherwise.

Request result

The request values used for matching, after normalization. Compare this with t.input.request when testing normalization. It is not a live Connection context. It has the following properties:

requestingName

The requesting name, unchanged; not an authenticated principal.

transport

The effective request transport.

method

The effective method, including the password default when omitted in input.

host

HTTP only: canonical host without port.

origin

URL

HTTP only: canonical HTTPS origin, including a nondefault port.

slug

HTTP only: case-sensitive slug, including "" for the root. See request normalization.

Identity

The identity after configured principal mapping, present on selection or local-login denial. These are the three returned data fields, not the entire production Authentication context:

principal

string

The mapped principal. It is not automatically the target account.

issuer

string

The identity's authority: local for local accounts, or the OIDC issuer.

subject

string

UID/SID as a string for local accounts, or the assumed OIDC subject. Mapping the principal does not change issuer or subject. See the product's identity explanation.

Authentication result

The authentication identity used on selection, before principal mapping. This is distinct from the target account and absent on denials. Unlike the flow-keyed input assumptions, this object has the following properties:

mode

The effective mode that supplied the selected identity.

account

string

Local modes only: the canonical bound account name, before principal mapping.

remoteName

string

Mapped-local only: the name produced by the configured remoteName expression.

issuer

URL

OIDC only: the assumed issuer.

subject

string

OIDC only: the assumed subject. Neither tokens nor raw claims are returned here.

Target types

The selected configuration determines which shape below is returned. Values are settings, not evidence that a target exists or a connection/login succeeds. Forwarding settings are not a complete permission evaluation.

SSH target

See SSH environment configuration for the corresponding product settings. This shape has these properties:

type

string

Always ssh.

address

Rendered and normalized address, including port, e.g. work.example.org:22.

user

string

Rendered target account name, e.g. mapped-alice.

portForwardingAllowed

bool

Rendered forwarding setting.

reversePortForwardingAllowed

bool

Rendered reverse-forwarding setting.

Local target

The local environment returns common settings plus platform-specific account/group selectors. A name-based selector does not automatically acquire the supplied account's current UID/SID. Known absence can still produce settings for deferred provisioning; the test never provisions. The common properties are:

type

string

Always local.

kind

string

local-unix or local-windows.

shellCommand

[]string

Rendered shell command arguments.

execCommandPrefix

[]string

Rendered command prefix arguments.

directory

string

Rendered working directory. The path is not opened or created by the test.

portForwardingAllowed

bool

Rendered forwarding setting.

account

Unix only. Requested account settings, not a copy of Account facts. Integer IDs are preserved. Its properties are listed with the selector types below.

name

string

Windows only. Rendered/resolved target account name.

requestedSID

Windows only. Requested SID selector. An empty string is not an assertion of the current SID.

displayName

string

Windows only. Rendered display-name setting.

skel

string

Windows only. Rendered skeleton setting, not a directory copied by the test.

groups

Windows only. Rendered requested groups; not the current account membership list.

Selector types

Unix account selector

The local Unix target's account object has the following properties:

name

string

Requested/resolved account name. Name precedence and UID 0 follow the product resolver.

uid

Requested UID, or null when no UID was requested.

displayName

string

Rendered display-name setting.

group

Requested primary group.

groups

Requested supplementary groups.

shell

string

Rendered shell setting.

homeDir

string

Rendered home directory setting.

skel

string

Rendered skeleton setting. No account or filesystem changes are performed.

Unix group selector

Used by the local Unix account selector's group and groups properties.

name

string

Requested group name.

gid

Requested GID, or null if none was requested.

Windows group selector

Used by the local Windows target's groups property.

name

string

Requested group name.

gid

Requested SID-valued group identifier. The name gid follows the product's Windows selector vocabulary; it is not a numeric Unix GID.

Denial example

For an expected general denial, do not read success-only fields:

1
2
3
local function verify(t, actual)
  t:IsEqual("deny", actual.decision)
end