Documentation
¶
Index ¶
- func GenerateJWK() (jwk.Key, jwk.Set, string, error)
- func GenerateJWKS() (string, error)
- func GetUniqueAvailablePorts(count int) ([]int, error)
- func InitClient(t *testing.T, initCfg map[string]any)
- func MockFederationRoot(t *testing.T, fInfo *pelican_url.FederationDiscovery, kSet *jwk.Set)
- func MockIssuer(t *testing.T, kSet *jwk.Set) string
- func RegistryMockup(t *testing.T, prefix string) *httptest.Server
- func TestContext(ictx context.Context, t *testing.T) (ctx context.Context, cancel context.CancelFunc, egrp *errgroup.Group)
- func WriteBigBuffer(t *testing.T, fp io.WriteCloser, sizeMB int) (size int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateJWK ¶
GenerateJWK generates a JWK private key and a corresponding JWKS public key, and the string representation of the public key
func GenerateJWKS ¶
func GetUniqueAvailablePorts ¶
getUniqueAvailablePorts returns `count` unique, available ports. **WARNING**: There is a small race condition between getting the list of available ports and actually binding to them in whatever service uses these values. Be warned they may (but are hopefully unlikely to) disappear before you can use them!
func InitClient ¶
Initialize the client for a unit test
Will set the configuration to a temporary directory (to avoid pulling in global configuration) and set some arbitrary viper configurations
func MockFederationRoot ¶
func MockFederationRoot(t *testing.T, fInfo *pelican_url.FederationDiscovery, kSet *jwk.Set)
Create a mock federation root that can respond to requests for metadata and federation keys
func MockIssuer ¶
Create a mock issuer that responds to request for /.well-known/openid-configuration and /.well-known/issuer.jwks
func RegistryMockup ¶
For these tests, we only need to lookup key locations. Create a dummy registry that only returns the jwks_uri location for the given key. Once a server is instantiated, it will only return locations for the provided prefix. To change prefixes, create a new registry mockup.
func TestContext ¶
func WriteBigBuffer ¶
Writes a file at least the specified size in MB
Types ¶
This section is empty.