/** * @module sync saga context helpers */ import { Ib } from '@ibgib/ts-gib/dist/types.mjs'; import { SyncSagaContextData_V1, SyncSagaContextIbGib_V1, SyncSagaContextIb_V1 } from './sync-saga-context-types.mjs'; import { IbGibSpaceAny } from '../../witness/space/space-base-v1.mjs'; /** * Constructs the standard 'ib' string for a Sync Saga Context stone. */ export declare function getSyncSagaContextIb({ data, }: { data: SyncSagaContextData_V1; }): Promise; /** * Parses a standard Sync Saga Context 'ib' string. */ export declare function parseSyncSagaContextIb({ ib, }: { ib: Ib; }): Promise; export declare function isSyncSagaContextIbGib(x: any): x is SyncSagaContextIbGib_V1; /** * Validates ONLY the {@link context} ibgib itself and saga frame/msg stone(s) * ({@link SyncSagaContextIbGib_V1.sagaFrame}). * * Does NOT... * * validate authn or authz * * validate domain payload ibgibs... * * intrinsically * * in relation to this context (addrs match up) * * @returns empty array if valid, else validation errors */ export declare function validateContextAndSagaFrame({ context, }: { context: SyncSagaContextIbGib_V1; }): Promise; /** * validates {@link SyncSagaContextIbGib_V1.payloadIbGibsDomain} intrinsically, * and ensures that these payloadIbGibs also match the expected addrs in * {@link SyncSagaContextData_V1}[{@link SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN}]. * * @returns empty array if valid, else validation errors */ export declare function validateContextDomainPayloadIbGibs({ context }: { context: SyncSagaContextIbGib_V1; }): Promise; /** * "Intrinsically": This authenticates assuming we have already established that * this context is a valid continuation of previous sync contexts/saga state. It * does not check that the session identity contained on this context is a valid * continuation. * * ## notes * * Say an attacker tries to hijack a legit sync process by capturing previous * context(s). Then the attacker just either creates its own sessionIdentity * * ## implementation notes * * This is a HUGE function right now, because there are just a lot of things to * check. I'm basically going through and just taking every assumption that I * can think of and encoding it. * * We will need to refactor this at some point to neaten it up, but we should * not remove sections without EXTREMELY good reasoning, as this would reduce * security. */ export declare function authenticateContextIntrinsically({ context, controlSpace, }: { context: SyncSagaContextIbGib_V1; controlSpace: IbGibSpaceAny; }): Promise; //# sourceMappingURL=sync-saga-context-helpers.d.mts.map