BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Harrier · Apply freshness policy to a verified session

Apply time and assurance policy to a session after upstream identity verification.

Apply freshness policy to a verified session

A still-valid token can represent an old or insufficiently verified session. Apply application policy after the identity provider has verified the token. The verified session is eight ticks old and meets the required assurance level. The expiration boundary remains exclusive.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-harrier.git
cd blyx-harrier
blyxc native-run project.blyx -- 100 90 110 0 2 2 92 10

API and return values

Returns [policy accepted, claims time accepted, assurance/freshness accepted, session age]. Use only after the host has authenticated and verified the issuer, audience and signature. Invalid input returns an empty vector.

ArgumentAccepted input
nowexact signed integer
beginsexact signed integer
expiresexact signed integer
skewnonnegative exact integer
observednonnegative exact integer
requirednonnegative exact integer
auth_timeexact signed integer
max_agenonnegative exact integer

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
1
1
1
8
Open in the full playground →

Practice

Change now = 110.0, auth_time = 105.0. Predict the result, then run the program.

Hint

Returns [policy accepted, claims time accepted, assurance/freshness accepted, session age]. Use only after the host has authenticated and verified the issuer, audience and signature.

Worked solution

The result vector is [0, 0, 1, 5]. Compare its fields with the return layout in the API section.

Find

    let now = 100.0;

Replace with

    let now = 110.0;

Find

    let auth_time = 92.0;

Replace with

    let auth_time = 105.0;

Output after the change

0
0
1
5