From ccece5cd21ad01c2a52f34d1db36bf0c3b05644e Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Fri, 17 Apr 2020 13:35:24 -0700 Subject: [PATCH] http: rename paresTokenResolveProxy to parseTokenWithDefault --- agent/http.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agent/http.go b/agent/http.go index 7fba3b0067..7645fc849a 100644 --- a/agent/http.go +++ b/agent/http.go @@ -976,10 +976,10 @@ func (s *HTTPServer) parseTokenInternal(req *http.Request, token *string) { return } -// parseTokenResolveProxy passes through to parseTokenInternal and optionally resolves proxy tokens to real ACL tokens. +// parseTokenWithDefault passes through to parseTokenInternal and optionally resolves proxy tokens to real ACL tokens. // If the token is invalid or not specified it will populate the token with the agents UserToken (acl_token in the // consul configuration) -func (s *HTTPServer) parseTokenResolveProxy(req *http.Request, token *string) { +func (s *HTTPServer) parseTokenWithDefault(req *http.Request, token *string) { s.parseTokenInternal(req, token) // parseTokenInternal modifies *token if token != nil && *token == "" { *token = s.agent.tokens.UserToken() @@ -991,7 +991,7 @@ func (s *HTTPServer) parseTokenResolveProxy(req *http.Request, token *string) { // parseToken is used to parse the ?token query param or the X-Consul-Token header or // Authorization Bearer token header (RFC6750). This function is used widely in Consul's endpoints func (s *HTTPServer) parseToken(req *http.Request, token *string) { - s.parseTokenResolveProxy(req, token) + s.parseTokenWithDefault(req, token) } func sourceAddrFromRequest(req *http.Request) string { @@ -1051,7 +1051,7 @@ func (s *HTTPServer) parseMetaFilter(req *http.Request) map[string]string { func (s *HTTPServer) parseInternal(resp http.ResponseWriter, req *http.Request, dc *string, b structs.QueryOptionsCompat) bool { s.parseDC(req, dc) var token string - s.parseTokenResolveProxy(req, &token) + s.parseTokenWithDefault(req, &token) b.SetToken(token) var filter string s.parseFilter(req, &filter)