mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-03 04:16:03 +02:00
CookieStore's ClearSession now properly clears the user session cookie by setting MaxAge to -1. internal/sessions: move encoder interface to encoding package, and rename to MarshalUnmarshaler. internal/encoding: move mock to own package authenticate: use INFO log level for authZ error. Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
26 lines
551 B
Go
26 lines
551 B
Go
package mock // import "github.com/pomerium/pomerium/internal/encoding/mock"
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
func TestMockEncoder(t *testing.T) {
|
|
e := errors.New("err")
|
|
mc := Encoder{
|
|
MarshalResponse: []byte("MarshalResponse"),
|
|
MarshalError: e,
|
|
UnmarshalError: e,
|
|
}
|
|
s, err := mc.Marshal("test")
|
|
if err != e {
|
|
t.Error("unexpected Marshal error")
|
|
}
|
|
if string(s) != "MarshalResponse" {
|
|
t.Error("unexpected MarshalResponse error")
|
|
}
|
|
err = mc.Unmarshal([]byte("s"), "s")
|
|
if err != e {
|
|
t.Error("unexpected Unmarshal error")
|
|
}
|
|
}
|