MCPcopy Index your code
hub / github.com/coder/coder / inflateClaims

Function inflateClaims

coderd/userauth_test.go:3093–3099  ·  view source on GitHub ↗

inflateClaims 'inflates' a jwt.MapClaims from a seed by adding a ridiculously large key-value pair of length size.

(t testing.TB, seed jwt.MapClaims, size int)

Source from the content-addressed store, hash-verified

3091// inflateClaims 'inflates' a jwt.MapClaims from a seed by
3092// adding a ridiculously large key-value pair of length size.
3093func inflateClaims(t testing.TB, seed jwt.MapClaims, size int) jwt.MapClaims {
3094 t.Helper()
3095 junk, err := cryptorand.String(size)
3096 require.NoError(t, err)
3097 seed["random_data"] = junk
3098 return seed
3099}
3100
3101// generateBadJWT generates a JWT with a random key. It's intended to emulate the old-style JWT's we generated.
3102func generateBadJWT(t *testing.T, claims interface{}) string {

Callers 1

TestUserOIDCFunction · 0.85

Calls 2

StringFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected