(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func 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 | |
| 45 | func TestSessionKeySignsSessionsAndTrackedRequests(t *testing.T) { |
| 46 | _, edKey, err := ed25519.GenerateKey(rand.Reader) |
nothing calls this directly
no test coverage detected