Signing in
On a channel whose peer the kernel cannot identify, a caller is established by the host's own
authentication service, once, and carries the answer as a session token. Yoke stores no password,
hashes none, keeps no list of users and creates no account. This page gives how the host is asked
through yoke-auth, the session token, how each projection carries it, and a browser signing in from
end to end.
| Where | How the caller is established |
|---|---|
| an administrative surface, and an interface channel on a local socket | the kernel's peer credential, resolved to an account by the host; nothing is asked of the person |
| an interface channel on a routable address | an account name and a secret, put by the Core to the host's authentication service |
The host's answer
On the reference host the service is PAM, under the service name yoke. A site that wants a stack of
its own writes /etc/pam.d/yoke; otherwise the host's other stack decides.
The Core asks through yoke-auth, executed once per authentication. The Core is statically linked and
opens no library; yoke-auth opens the host's authentication library at run time, so a host without it
loses authentication and nothing else.
| where | beside the Core's executable — /usr/bin/yoke-auth in the service form |
| what it is given | on standard input: the account name, a zero byte, the secret. Nothing on its command line or in its environment |
| what it asks | the service yoke: the authentication step, then the account step |
| what it answers | its exit status alone: 0 accepted, 1 refused, 2 the service could not be asked |
| how long | at most 30s; then it is killed and the attempt counts as one that could not be asked |
| with what privileges | the Core's own |
--probe | 0 where the service can be asked, 2 otherwise, asking nothing |
The caller hears auth.invalid whether the answer was 1 or 2, and nothing about why. The Core's
own log names a 2 as a fault, which is an operator's problem. Which accounts a host will answer for is
the host's policy.
The session token
| what it is | 32 bytes from the host's random source, as base64url: opaque, with nothing to parse |
| where it is kept | in the Core's memory, against one account and the one channel that issued it |
| how long | 12h from issue, and never past the life of the Core that issued it |
| what ends it early | the Core stopping, the channel being unbound, the same account signing in again |
| where it is accepted | on the channel that issued it, and no other |
Nothing about a session is persisted. A Core that restarts has ended every session it held.
In the browser projection
POST /v1/authenticate {"version": 1, "authenticate": {"password": {"account": "alice", "secret": "…"}}}
→ 200 Set-Cookie: yoke-session=…; Path=/v1; HttpOnly; SameSite=Strict; Secure
{"authenticate": {"account": "alice", "expires": "…"}}
GET /v1/events (upgraded, with the cookie)
→ the opening picture
- Signing in comes before attaching.
/v1/eventsrefusesauth.requireduntil the request carries the cookie, andauth.invalidwhen the cookie holds a token never issued, expired or issued elsewhere. - The token is never in a body. The answer names the account and the expiry; the token travels only in
yoke-session, which the page cannot read. - The cookie is
Secure, so a browser keeps it only from a page served over HTTPS — which is how the page and the channel share one origin.
In the typed projection
The first frame of an attachment is an authenticate request, carrying either the password or a token
issued earlier on that channel. Once the host accepts it the opening picture arrives, then the answer:
for a password it names the account, the token and its expiry. An attachment whose first frame is
anything else, or whose credential is refused, is refused with auth.required or auth.invalid, and
channel.attached names the account it was established as.
A browser, end to end
- The client completes a TLS 1.3 handshake with ALPN
http/1.1, and verifies the Core's certificate against what whoever provisioned both ends arranged. POST /v1/authenticatewith an account and a secret. The Core asks the host, and sets the cookie.GET /v1/events, upgraded, with the cookie. The opening picture arrives.POST /v1/command. Whether the unit's Plugin was granted that command is decided when the unit is named: a command not granted is refusedscope.withheld,403, whatever the first two steps established.