package pier import ( "context" "git.golem15.com/golem15/summercms/modules/backpack" "git.golem15.com/golem15/summercms/modules/bouncer" "git.golem15.com/golem15/summercms/modules/cabana" ) // Test seams (package pier, compiled into the test binary only). // SetBackendTokens replaces the admin personal token resolver, which needs // a database in production (cabana.ResolveBackendToken). func (p *Pier) SetBackendTokens(fn func(ctx context.Context, app *backpack.App, raw string) (*bouncer.Principal, *cabana.BackendAPIToken, []string, error)) { p.identities.backendTokens = fn } // Resolve resolves a bearer into an Identity as the endpoint does. func (p *Pier) Resolve(ctx context.Context, raw string) (Identity, error) { return p.identities.resolve(ctx, raw) } // Ceiling reports whether the read/write ceiling applies to the identity. func (id Identity) Ceiling() bool { return id.ceiling }