21137: Tighten TestEndSessionEndpointBadScheme check 21137-rp-initiated-logout
authorBrett Smith <brett.smith@curii.com>
Tue, 21 Nov 2023 21:33:57 +0000 (16:33 -0500)
committerBrett Smith <brett.smith@curii.com>
Tue, 21 Nov 2023 21:33:57 +0000 (16:33 -0500)
Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>

lib/controller/localdb/login_oidc_test.go

index 7384935246e13dda071a3725840cca39a12ee3d3..f505f5bc4997682f759176624e851be5a700f8fa 100644 (file)
@@ -15,6 +15,7 @@ import (
        "net/http"
        "net/http/httptest"
        "net/url"
+       "regexp"
        "sort"
        "strings"
        "sync"
@@ -149,9 +150,11 @@ func (s *OIDCLoginSuite) TestRPInitiatedLogoutWithReturnTo(c *check.C) {
 
 func (s *OIDCLoginSuite) TestEndSessionEndpointBadScheme(c *check.C) {
        // RP-Initiated Logout 1.0 says: "This URL MUST use the https scheme..."
-       s.fakeProvider.EndSessionEndpoint = &url.URL{Scheme: "http", Host: "example.com"}
+       u := url.URL{Scheme: "http", Host: "example.com"}
+       s.fakeProvider.EndSessionEndpoint = &u
        _, err := s.localdb.Logout(s.ctx, arvados.LogoutOptions{})
-       c.Check(err, check.NotNil)
+       c.Check(err, check.ErrorMatches,
+               `.*\bend_session_endpoint MUST use HTTPS but does not: `+regexp.QuoteMeta(u.String()))
 }
 
 func (s *OIDCLoginSuite) TestNoRPInitiatedLogoutWithoutToken(c *check.C) {