Documentation
¶
Overview ¶
Package testauth is an auth.Authenticator for ContentKit's package tests, which cannot import a real provider: a request's bearer names its actor (As) and an Authorizer answers its Can. The end-to-end suite (e2e/) runs the same gates against a real AuthKit.
Index ¶
Constants ¶
View Source
const Issuer = "https://auth.test"
Issuer is the test credentials' issuer.
Variables ¶
View Source
var Scope = auth.Scope{Authority: Issuer, ID: "root"}
Scope is the test Authenticator's root scope, where staff hold their permissions.
Functions ¶
func Actor ¶
func Actor(a access.Actor, authz Authorizer) access.Actor
Actor is a as the gate builds it, with a Verified answering Can by authz, for calls that take an actor directly.
Types ¶
type Auth ¶
type Auth struct{ Authz Authorizer }
Auth authenticates "Bearer user:{id}" and "Bearer app:{id}"; any other bearer is refused. Authz answers Can in Scope; nil holds nothing.
type Authorizer ¶
Authorizer decides a test actor's permissions in Scope.
Click to show internal directories.
Click to hide internal directories.