mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-24 13:38:17 +02:00
internal/sessions: fix cookie clear session (#376)
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>
This commit is contained in:
parent
d3d60d1055
commit
b9ab49c32c
19 changed files with 173 additions and 217 deletions
26
internal/encoding/mock/mock_encoder_test.go
Normal file
26
internal/encoding/mock/mock_encoder_test.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
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")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue