diff --git a/pkg/handler/handler_sso_server.go b/pkg/handler/handler_sso_server.go index f2d670f..cafa0df 100644 --- a/pkg/handler/handler_sso_server.go +++ b/pkg/handler/handler_sso_server.go @@ -44,7 +44,7 @@ func (s *SSOServer) LogoutLocal(w http.ResponseWriter, r *http.Request) { s.Standalone.LogoutLocal(w, r) } -// Wildcard redirects unhandled requests to the default redirect URI. +// Wildcard redirects unhandled requests to the default redirect URL. func (s *SSOServer) Wildcard(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, s.Config.SSO.ServerDefaultRedirectURL, http.StatusFound) } diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 62a2fb3..92d4ce5 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -75,7 +75,7 @@ func TestCallback_SessionStateRequired(t *testing.T) { resp := authorize(t, rpClient, idp) - // Get callback URI after successful auth + // Get callback URL after successful auth params := resp.Location.Query() sessionState := params.Get("session_state") assert.NotEmpty(t, sessionState) @@ -513,7 +513,7 @@ func authorize(t *testing.T, rpClient *http.Client, idp *mock.IdentityProvider) } func callback(t *testing.T, rpClient *http.Client, authorizeResponse response) *http.Cookie { - // Get callback URI after successful auth + // Get callback URL after successful auth callbackURL := authorizeResponse.Location // Follow redirect to callback diff --git a/pkg/strings/generator.go b/pkg/strings/generator.go index 621426f..1f4c32f 100644 --- a/pkg/strings/generator.go +++ b/pkg/strings/generator.go @@ -7,7 +7,7 @@ import ( "io" ) -// GenerateBase64 generates a random string of a given length, and base64 URI-encodes it. +// GenerateBase64 generates a random string of a given length, and base64 URL-encodes it. func GenerateBase64(length int) (string, error) { bytes, err := Generate(length) if err != nil { diff --git a/pkg/url/redirect.go b/pkg/url/redirect.go index 4c0afc9..bc7d835 100644 --- a/pkg/url/redirect.go +++ b/pkg/url/redirect.go @@ -12,9 +12,9 @@ import ( type Redirect interface { Validator - // Canonical constructs a redirect URI that points back to the application. + // Canonical constructs a redirect URL that points back to the application. Canonical(r *http.Request) string - // Clean parses and cleans a target URI according to implementation-specific validations. It should always return a fallback URI string, regardless of validation errors. + // Clean parses and cleans a target URL according to implementation-specific validations. It should always return a fallback URL string, regardless of validation errors. Clean(r *http.Request, target string) string } @@ -37,7 +37,7 @@ func (h *StandaloneRedirect) Canonical(r *http.Request) string { redirect = fallback(r, target, h.getFallbackRedirect(r)) } - // redirect must be a relative URI to avoid cross-domain redirects + // redirect must be a relative URL to avoid cross-domain redirects redirect.Scheme = "" redirect.Host = "" diff --git a/pkg/url/url.go b/pkg/url/url.go index 1ca62de..92947ae 100644 --- a/pkg/url/url.go +++ b/pkg/url/url.go @@ -15,7 +15,7 @@ const ( var ErrNoMatchingIngress = errors.New("request host does not match any configured ingresses") -// Login constructs a URI string that points to the login path for the given target URI. +// Login constructs a URL string that points to the login path for the given target URL. // The given redirect string should point to the location to be redirected to after login. func Login(target *url.URL, redirect string) string { u := target.JoinPath(paths.OAuth2, paths.Login) @@ -29,7 +29,7 @@ func Login(target *url.URL, redirect string) string { return u.String() } -// LoginRelative constructs the relative URI with an absolute path that points to the application's login path, given an optional path prefix. +// LoginRelative constructs the relative URL with an absolute path that points to the application's login path, given an optional path prefix. // The given redirect string should point to the location to be redirected to after login. func LoginRelative(prefix, redirect string) string { u := new(url.URL) @@ -42,7 +42,7 @@ func LoginRelative(prefix, redirect string) string { return Login(u, redirect) } -// Logout constructs a URI string that points to the logout path for the given target URI. +// Logout constructs a URL string that points to the logout path for the given target URL. // The given redirect string should point to the location to be redirected to after logout. func Logout(target *url.URL, redirect string) string { u := target.JoinPath(paths.OAuth2, paths.Logout) diff --git a/pkg/url/validator.go b/pkg/url/validator.go index d8d2e51..f866c3e 100644 --- a/pkg/url/validator.go +++ b/pkg/url/validator.go @@ -27,7 +27,7 @@ func NewAbsoluteValidator(allowedDomains []string) *AbsoluteValidator { return &AbsoluteValidator{allowedDomains: allowedDomains} } -// IsValidRedirect validates that the given redirect string is a valid absolute URI. +// IsValidRedirect validates that the given redirect string is a valid absolute URL. // It must use the 'http' or 'https' scheme. // It must point to a host that matches the configured list of allowed domains. func (v *AbsoluteValidator) IsValidRedirect(r *http.Request, redirect string) bool { @@ -66,7 +66,7 @@ func NewRelativeValidator() *RelativeValidator { return &RelativeValidator{} } -// IsValidRedirect validates that the given redirect string is a valid relative URI. +// IsValidRedirect validates that the given redirect string is a valid relative URL. // It must be an absolute path (i.e. has a leading '/'). func (v *RelativeValidator) IsValidRedirect(r *http.Request, redirect string) bool { u, ok := parsableRequestURI(r, redirect)