revert: "style: go fmt"

This wasn't actually formatting.

This reverts commit d71ff7ddc3.
This commit is contained in:
Trong Huu Nguyen
2023-10-10 14:50:28 +02:00
parent 8bbd947d5b
commit 7e97fd7a93
6 changed files with 12 additions and 12 deletions

View File

@@ -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)
}

View File

@@ -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

View File

@@ -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 {

View File

@@ -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 = ""

View File

@@ -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)

View File

@@ -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)