stdcrpcaccesstest

package
v0.0.80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package stdcrpcaccesstest provides testing utilities for testing with access control.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignTestJWT

func SignTestJWT(tb testing.TB, permissions []string) string

SignTestJWT signs a valid JWT against a well-known private key for testing.

func TestKeyServer

func TestKeyServer() *httptest.Server

TestKeyServer starts a server for testing that serves the key set.

func WithTestAuthBackend

func WithTestAuthBackend() fx.Option

WithTestAuthBackend injects dependencies for allowing tests to sign and validate access tokens.

func WithTestToken

func WithTestToken(tb testing.TB, base connect.HTTPClient) connect.HTTPClient

WithTestToken is a http client middleware that always adds a valid (self signed) token for testing.

Types

type TestAuthBackend

type TestAuthBackend struct {
	// contains filtered or unexported fields
}

TestAuthBackend is an auth backend that is run locally and we control the signing process for.

func (TestAuthBackend) JWKSEndpoint

func (ap TestAuthBackend) JWKSEndpoint() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL