ScopeHeader

The Wow-Scope header: an RFC 8941 dictionary whose members, all optional, are tenant, owner and space, each a string or a token: Wow-Scope: tenant="t1", owner="u1", space="s1". It always names a scope: an owner or a space it leaves out is none, not the sender's own, so the TargetScope it reads has a non-null TargetScope.scope (tenant="t1" alone acts in t1 with no owner or space checked), and format writes the sender's own scope for a target that keeps it (scope null), given as format's own.

On a query route alone (parseQuery), tenant may name several tenants instead: tenant=* for every tenant, or an inner list of strings or tokens, tenant=("t1" "t2").

A member that is not one of them, one without a value, a value that is not a string or a token (or, for a query's tenant, an inner list of them), a member with parameters, a member given twice, and a dictionary without members are malformed. RFC 8941 lets a member given twice take its last value; here it is refused, so no proxy that appends one chooses the scope. The lines of a header given more than once are one dictionary, joined by commas, as the routes read them.

It is public as the one parser of a public header: a gateway in front of a node, or a host of its own, reads Wow-Scope exactly as Wow does.

Types

Link copied to clipboard
class QueryTarget @InternalWowApi constructor(val targetScope: TargetScope, val crossTenant: CrossTenant?)

What Wow-Scope names on a query route: the targetScope and, for a cross-tenant query, the tenants it reads (crossTenant), in which case targetScope names no tenant.

Properties

Link copied to clipboard
const val ALL_TENANTS: String

Every tenant, as tenant names it on a query route.

Link copied to clipboard
const val OWNER: String
Link copied to clipboard
const val SPACE: String
Link copied to clipboard
const val TENANT: String

Functions

Link copied to clipboard
fun format(target: TargetScope, own: Scope): String

target as parse reads it, a target that keeps its sender's scope (TargetScope.scope null) written with own, the sender's, since the header always names a scope.

Link copied to clipboard
fun parse(value: String): TargetScope

The target scope value spells, which names one tenant at most.

Link copied to clipboard

The target scope value spells on a query route: a tenant of * or an inner list is the QueryTarget.crossTenant of a cross-tenant query, its QueryTarget.targetScope then naming no tenant.