MCPcopy Create free account
hub / github.com/crewjam/saml / TestSessionKeyFallsBackToKey

Function TestSessionKeyFallsBackToKey

samlsp/session_key_test.go:28–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestSessionKeyFallsBackToKey(t *testing.T) {
29 opts := sessionKeyTestOptions(t, nil)
30
31 sessionCodec := DefaultSessionCodec(opts)
32 assert.Check(t, sessionCodec.Key == opts.Key)
33 assert.Check(t, is.Equal(jwt.SigningMethodRS256, sessionCodec.SigningMethod))
34
35 trackedCodec := DefaultTrackedRequestCodec(opts)
36 assert.Check(t, trackedCodec.Key == opts.Key)
37 assert.Check(t, is.Equal(jwt.SigningMethodRS256, trackedCodec.SigningMethod))
38
39 // A typed nil is treated as unset too.
40 var nilKey *ecdsa.PrivateKey
41 opts.SessionKey = nilKey
42 assert.Check(t, DefaultSessionCodec(opts).Key == opts.Key)
43}
44
45func TestSessionKeySignsSessionsAndTrackedRequests(t *testing.T) {
46 _, edKey, err := ed25519.GenerateKey(rand.Reader)

Callers

nothing calls this directly

Calls 3

sessionKeyTestOptionsFunction · 0.85
DefaultSessionCodecFunction · 0.85

Tested by

no test coverage detected