AccessGuard

class AccessGuard(session: HostSession, policy: AccessPolicy, callerResolver: () -> String? = CallerAttribution::callingPackage)

The three gates every guarded verb passes, in order: the caller resolves to a package, the WebID has a live session, and the caller's grant covers the verb.

caller must run on the binder thread, where the calling UID is known; gate captures it there and defers the rest to the dispatched coroutine. The codes match what the old resource-only guard answered, so the client SDK maps them the same way.

Constructors

Link copied to clipboard
constructor(session: HostSession, policy: AccessPolicy, callerResolver: () -> String? = CallerAttribution::callingPackage)

Functions

Link copied to clipboard
fun caller(): String?

The calling app's package, read now, on the binder thread.

Link copied to clipboard
suspend fun check(caller: String?, webId: String, vararg requirements: Requirement): AccessCheck
Link copied to clipboard
fun gate(webId: String, vararg requirements: Requirement): suspend () -> AccessCheck

Captures the caller now and answers the full check when invoked inside the coroutine.

fun gate(webId: String, target: VerbTarget, level: AccessLevel): suspend () -> AccessCheck

The one-requirement form of gate.