HPPR Repository Access Control

Tags: repo, auth, policy

© R.A.Sol

ACL rules are defined per repository identity.

Each rule targets a coordinate prefix and controls three operations:

Rule evaluation uses longest-prefix match with per-operation inheritance.

Operations

Rule Format

Rule syntax:

<ops> <coordinate-prefix>

<ops> is exactly three characters:

[r|d|.][w|d|.][l|d|.]

Meaning:

Examples:

ACL-Rule: rwl //u/chess//
ACL-Rule: r.l //u/mail//
ACL-Rule: rdl //u/market//
ACL-Rule: .w. //u/market//nl/eindhoven/

Common patterns:

Prefix Forms

ACL prefixes are parsed coordinates or coordinate-tree prefixes. They are not raw string prefixes. Matching compares group, API segments, the API/Key boundary, Key segments, and version-selector components as coordinate tree components.

Common forms:

Prefix Meaning
//g/ all APIs in group g
//g/chat/ API subtree under chat
//g/chat// all Keys in exact API chat
//g/chat//rooms/ Key subtree under rooms
//g/chat//rooms/7/| exact Key version root

//g/chat//x does not match //g/chatty//x. //g/a//b does not match //g/a/b//c.

Rule Ordering

Rules MUST be stored in canonical sorted order.

Sort by parsed coordinate-prefix components:

  1. group
  2. API segments
  3. API/Key boundary marker
  4. Key segments
  5. version selector components

Within each component list, sort bytewise by UTF-8 bytes. A version boundary sorts before a child segment at the same Key.

Resolution

Given a request coordinate:

  1. Parse the request coordinate.
  2. Find the longest matching parsed rule prefix.
  3. For each operation, apply explicit allow or deny when present.
  4. For . values, continue to the next-longest matching rule.
  5. If no explicit decision is found, deny.

For read and write checks, evaluate against the packet versioned coordinate.

Prefix examples:

Prefix Matches
//u/a//README.md/| exact README.md Key version root
//u/a//README.md/ README.md and children
//u/a//README.md also README.md-draft

Policy Storage

Rules are stored as ACL-Rule headers in policy packets.

Policy coordinate depends on identity scheme:

Policy packets carry only ACL-Rule headers. Auth-config headers and member headers are invalid in policy packets.