diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-05-01 07:56:25 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-05-01 07:56:25 -0600 |
commit | 9a2da81b11ad0064cca24ce7974827d032309369 (patch) | |
tree | 4313224dc089208423e78bffc3ec50833e35bcea /contrib/tlsauth/gemini_test.go | |
parent | 21e2758145d100d74013060f7090d84679cae683 (diff) |
name change gus -> sliderule
Diffstat (limited to 'contrib/tlsauth/gemini_test.go')
-rw-r--r-- | contrib/tlsauth/gemini_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/tlsauth/gemini_test.go b/contrib/tlsauth/gemini_test.go index 7823de6..655307a 100644 --- a/contrib/tlsauth/gemini_test.go +++ b/contrib/tlsauth/gemini_test.go @@ -8,38 +8,38 @@ import ( "github.com/stretchr/testify/assert" - "tildegit.org/tjp/gus" - "tildegit.org/tjp/gus/contrib/tlsauth" - "tildegit.org/tjp/gus/gemini" + sr "tildegit.org/tjp/sliderule" + "tildegit.org/tjp/sliderule/contrib/tlsauth" + "tildegit.org/tjp/sliderule/gemini" ) func TestGeminiAuth(t *testing.T) { - handler1 := gus.HandlerFunc(func(_ context.Context, request *gus.Request) *gus.Response { + handler1 := sr.HandlerFunc(func(_ context.Context, request *sr.Request) *sr.Response { if !strings.HasPrefix(request.Path, "/one") { return nil } return gemini.Success("", &bytes.Buffer{}) }) - handler2 := gus.HandlerFunc(func(_ context.Context, request *gus.Request) *gus.Response { + handler2 := sr.HandlerFunc(func(_ context.Context, request *sr.Request) *sr.Response { if !strings.HasPrefix(request.Path, "/two") { return nil } return gemini.Success("", &bytes.Buffer{}) }) - handler3 := gus.HandlerFunc(func(_ context.Context, request *gus.Request) *gus.Response { + handler3 := sr.HandlerFunc(func(_ context.Context, request *sr.Request) *sr.Response { if !strings.HasPrefix(request.Path, "/three") { return nil } return gemini.Success("", &bytes.Buffer{}) }) - handler4 := gus.HandlerFunc(func(_ context.Context, request *gus.Request) *gus.Response { + handler4 := sr.HandlerFunc(func(_ context.Context, request *sr.Request) *sr.Response { return gemini.Success("", &bytes.Buffer{}) }) - handler := gus.FallthroughHandler( + handler := sr.FallthroughHandler( tlsauth.GeminiAuth(tlsauth.Allow)(handler1), tlsauth.GeminiAuth(tlsauth.Allow)(handler2), tlsauth.GeminiAuth(tlsauth.Reject)(handler3), @@ -73,8 +73,8 @@ func TestGeminiAuth(t *testing.T) { } func TestGeminiOptionalAuth(t *testing.T) { - pathHandler := func(path string) gus.Handler { - return gus.HandlerFunc(func(_ context.Context, request *gus.Request) *gus.Response { + pathHandler := func(path string) sr.Handler { + return sr.HandlerFunc(func(_ context.Context, request *sr.Request) *sr.Response { if !strings.HasPrefix(request.Path, path) { return nil } @@ -82,7 +82,7 @@ func TestGeminiOptionalAuth(t *testing.T) { }) } - handler := gus.FallthroughHandler( + handler := sr.FallthroughHandler( tlsauth.GeminiOptionalAuth(tlsauth.Allow)(pathHandler("/one")), tlsauth.GeminiOptionalAuth(tlsauth.Allow)(pathHandler("/two")), tlsauth.GeminiOptionalAuth(tlsauth.Reject)(pathHandler("/three")), |