Documentation
¶
Overview ¶
Package vfsapi serves the VFS over HTTP: files, folders and the access list that decides who may read and write them.
Routes are registered without a prefix and the host mounts them where it wants them, which is what lets one surface serve an operator's admin API and a user-facing one without a second implementation:
sub := http.NewServeMux()
api.AddRoutes(sub)
mux.Handle("/v1/admin/vfs/", http.StripPrefix("/v1/admin/vfs", sub))
Every request is resolved to a vfs.Actor by the host, and that actor is stamped onto the request context so the access list's callbacks see it: the surface does not invent an identity, and it never consults the access list itself for file reads — the VFS does, per resource.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoActor = errors.New("vfsapi: request carries no actor")
ErrNoActor is what an Authenticator returns when a request carries no identity. It is the only error answered 401; anything else is the authenticator's own failure and is answered 500.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
Authenticator resolves a request to the identity it acts as. The host owns this: a relay answers with the signed-in user and their platform role, a local install with the machine's own identity.
type Config ¶
type Config struct {
// VFS is the store every route reads and writes. Required.
VFS vfs.Service
// ACL holds the grants and is what the access-control routes operate on.
// Optional: without it, per-resource checks do not run and the
// access-control routes are not mounted — a single-user install has no
// grants to manage.
ACL *vfs.ACL
// Actor resolves the request's identity. Required.
Actor Authenticator
// Tracker instruments failures. Nil degrades to a no-op tracker.
Tracker libtracker.ActivityTracker
}
Config is the surface's whole configuration.