Documentation
¶
Overview ¶
Package stdcrpcaccess implements access control for our RPC.
Index ¶
- func FixedKeyServer() *httptest.Server
- func SignToken(tok openid.Token) (string, error)
- func WithFixedAuthBackend() fx.Option
- func WithSignedToken(base connect.HTTPClient, createToken func(r *http.Request) openid.Token) connect.HTTPClient
- type AccessControl
- type AuthBackend
- type Claims
- type FixedAuthBackend
- type RealAuthBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedKeyServer ¶ added in v0.0.83
FixedKeyServer starts a server for testing that serves the key set.
func SignToken ¶ added in v0.0.83
SignToken signs a valid JWT against a well-known private key for testing.
func WithFixedAuthBackend ¶ added in v0.0.83
WithFixedAuthBackend injects dependencies for allowing tests to sign and validate access tokens.
func WithSignedToken ¶ added in v0.0.83
func WithSignedToken(base connect.HTTPClient, createToken func(r *http.Request) openid.Token) connect.HTTPClient
WithSignedToken is a http client middleware that always adds a valid (self signed) token for testing.
Types ¶
type AccessControl ¶
type AccessControl[T Claims] struct { // contains filtered or unexported fields }
AccessControl implements a simple access control scheme.
type AuthBackend ¶
type AuthBackend interface {
JWKSEndpoint() string
}
AuthBackend represents what is required of an auth backend.
type Claims ¶ added in v0.0.94
type Claims interface { ProcedurePermissions() []string DecorateContext(ctx context.Context) context.Context }
Claims constrains the type that will hold authentication claims.
type FixedAuthBackend ¶ added in v0.0.83
type FixedAuthBackend struct {
// contains filtered or unexported fields
}
FixedAuthBackend is an auth backend that is run locally and we control the signing process for.
func (FixedAuthBackend) JWKSEndpoint ¶ added in v0.0.83
func (ap FixedAuthBackend) JWKSEndpoint() string
type RealAuthBackend ¶
type RealAuthBackend string
RealAuthBackend is used when actually deploying.
func (RealAuthBackend) JWKSEndpoint ¶
func (ap RealAuthBackend) JWKSEndpoint() string