mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-10 23:03:23 +02:00
These chagnes standardize how session loading is done for session cookie, auth bearer token, and query params. - Bearer token previously combined with session cookie. - rearranged cookie-store to put exported methods above unexported - added header store that implements session loader interface - added query param store that implements session loader interface Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
23 lines
493 B
Go
23 lines
493 B
Go
package sessions
|
|
|
|
import "testing"
|
|
|
|
func Test_ParentSubdomain(t *testing.T) {
|
|
t.Parallel()
|
|
tests := []struct {
|
|
s string
|
|
want string
|
|
}{
|
|
{"httpbin.corp.example.com", "corp.example.com"},
|
|
{"some.httpbin.corp.example.com", "httpbin.corp.example.com"},
|
|
{"example.com", ""},
|
|
{"", ""},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.s, func(t *testing.T) {
|
|
if got := ParentSubdomain(tt.s); got != tt.want {
|
|
t.Errorf("ParentSubdomain() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|