mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 16:37:24 +02:00
cache : add cache service (#457)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
8a9cb0f803
commit
dccc7cd2ff
46 changed files with 1837 additions and 587 deletions
|
@ -16,6 +16,7 @@ func Test_isValidService(t *testing.T) {
|
|||
{"authenticate bad case", "AuThenticate", false},
|
||||
{"authorize implemented", "authorize", true},
|
||||
{"jiberish", "xd23", false},
|
||||
{"cache", "cache", true},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
@ -27,6 +28,7 @@ func Test_isValidService(t *testing.T) {
|
|||
}
|
||||
|
||||
func Test_isAuthenticate(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
name string
|
||||
service string
|
||||
|
@ -50,6 +52,7 @@ func Test_isAuthenticate(t *testing.T) {
|
|||
}
|
||||
|
||||
func Test_isAuthorize(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
name string
|
||||
service string
|
||||
|
@ -92,3 +95,27 @@ func Test_IsProxy(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_IsCache(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
name string
|
||||
service string
|
||||
want bool
|
||||
}{
|
||||
{"proxy", "proxy", false},
|
||||
{"all", "all", true},
|
||||
{"authorize", "authorize", false},
|
||||
{"proxy bad case", "PrOxY", false},
|
||||
{"jiberish", "xd23", false},
|
||||
{"cache", "cache", true},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := IsCache(tt.service); got != tt.want {
|
||||
t.Errorf("IsCache() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue