From c79b40ad56c37533a8d6bc14bfaa39979f530aa7 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sat, 19 Dec 2020 22:01:51 -0500 Subject: [PATCH] spelling: register Signed-off-by: Josh Soref --- api/api.pb.go | 2 +- api/api.proto | 2 +- api/v2/api.pb.go | 2 +- api/v2/api.proto | 2 +- server/handlers.go | 10 +++++----- server/server_test.go | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/api.pb.go b/api/api.pb.go index 1293ffb5..f940063c 100644 --- a/api/api.pb.go +++ b/api/api.pb.go @@ -353,7 +353,7 @@ func (m *UpdateClientReq) GetLogoUrl() string { return "" } -// UpdateClientResp returns the reponse from updating a client. +// UpdateClientResp returns the response from updating a client. type UpdateClientResp struct { NotFound bool `protobuf:"varint,1,opt,name=not_found,json=notFound,proto3" json:"not_found,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` diff --git a/api/api.proto b/api/api.proto index 64f4416e..3effea29 100644 --- a/api/api.proto +++ b/api/api.proto @@ -45,7 +45,7 @@ message UpdateClientReq { string logo_url = 5; } -// UpdateClientResp returns the reponse from updating a client. +// UpdateClientResp returns the response from updating a client. message UpdateClientResp { bool not_found = 1; } diff --git a/api/v2/api.pb.go b/api/v2/api.pb.go index 83bfb879..5f54ceff 100644 --- a/api/v2/api.pb.go +++ b/api/v2/api.pb.go @@ -353,7 +353,7 @@ func (m *UpdateClientReq) GetLogoUrl() string { return "" } -// UpdateClientResp returns the reponse from updating a client. +// UpdateClientResp returns the response from updating a client. type UpdateClientResp struct { NotFound bool `protobuf:"varint,1,opt,name=not_found,json=notFound,proto3" json:"not_found,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` diff --git a/api/v2/api.proto b/api/v2/api.proto index 64f4416e..3effea29 100644 --- a/api/v2/api.proto +++ b/api/v2/api.proto @@ -45,7 +45,7 @@ message UpdateClientReq { string logo_url = 5; } -// UpdateClientResp returns the reponse from updating a client. +// UpdateClientResp returns the response from updating a client. message UpdateClientResp { bool not_found = 1; } diff --git a/server/handlers.go b/server/handlers.go index 5a7244fa..b9da32d1 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -855,7 +855,7 @@ func (s *Server) handleAuthCode(w http.ResponseWriter, r *http.Request, client s s.writeAccessToken(w, tokenResponse) } -func (s *Server) exchangeAuthCode(w http.ResponseWriter, authCode storage.AuthCode, client storage.Client) (*accessTokenReponse, error) { +func (s *Server) exchangeAuthCode(w http.ResponseWriter, authCode storage.AuthCode, client storage.Client) (*accessTokenResponse, error) { accessToken, err := s.newAccessToken(client.ID, authCode.Claims, authCode.Scopes, authCode.Nonce, authCode.ConnectorID) if err != nil { s.logger.Errorf("failed to create new access token: %v", err) @@ -1449,7 +1449,7 @@ func (s *Server) handlePasswordGrant(w http.ResponseWriter, r *http.Request, cli s.writeAccessToken(w, resp) } -type accessTokenReponse struct { +type accessTokenResponse struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` @@ -1457,8 +1457,8 @@ type accessTokenReponse struct { IDToken string `json:"id_token"` } -func (s *Server) toAccessTokenResponse(idToken, accessToken, refreshToken string, expiry time.Time) *accessTokenReponse { - return &accessTokenReponse{ +func (s *Server) toAccessTokenResponse(idToken, accessToken, refreshToken string, expiry time.Time) *accessTokenResponse { + return &accessTokenResponse{ accessToken, "bearer", int(expiry.Sub(s.now()).Seconds()), @@ -1467,7 +1467,7 @@ func (s *Server) toAccessTokenResponse(idToken, accessToken, refreshToken string } } -func (s *Server) writeAccessToken(w http.ResponseWriter, resp *accessTokenReponse) { +func (s *Server) writeAccessToken(w http.ResponseWriter, resp *accessTokenResponse) { data, err := json.Marshal(resp) if err != nil { s.logger.Errorf("failed to marshal access token response: %v", err) diff --git a/server/server_test.go b/server/server_test.go index a909d98b..72860f2a 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -721,7 +721,7 @@ func TestOAuth2CodeFlow(t *testing.T) { defer oauth2Client.Close() - // Regester the client above with dex. + // Register the client above with dex. redirectURL := oauth2Client.URL + "/callback" client := storage.Client{ ID: clientID, @@ -1560,7 +1560,7 @@ func TestOAuth2DeviceFlow(t *testing.T) { } // Parse the response - var tokenRes accessTokenReponse + var tokenRes accessTokenResponse if err := json.Unmarshal(responseBody, &tokenRes); err != nil { t.Errorf("Unexpected Device Access Token Response Format %v", string(responseBody)) }