From 6550223ee49d02d48c5e2f2c361e476a508d4c31 Mon Sep 17 00:00:00 2001 From: James Read Date: Wed, 19 Feb 2025 23:18:02 +0000 Subject: [PATCH] fmt: code style (#518) --- internal/config/config.go | 4 ++-- internal/httpservers/restapi_auth_local.go | 2 +- internal/httpservers/restapi_auth_oauth2.go | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 14d5b55..6c672ec 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -147,9 +147,9 @@ type AuthLocalUsersConfig struct { } type LocalUser struct { - Username string + Username string Usergroup string - Password string + Password string } type OAuth2Provider struct { diff --git a/internal/httpservers/restapi_auth_local.go b/internal/httpservers/restapi_auth_local.go index 8422a29..21e5c7d 100644 --- a/internal/httpservers/restapi_auth_local.go +++ b/internal/httpservers/restapi_auth_local.go @@ -4,8 +4,8 @@ import ( "google.golang.org/grpc/metadata" "net/http" - "github.com/google/uuid" "github.com/OliveTin/OliveTin/internal/config" + "github.com/google/uuid" log "github.com/sirupsen/logrus" ) diff --git a/internal/httpservers/restapi_auth_oauth2.go b/internal/httpservers/restapi_auth_oauth2.go index 7b13044..39fa098 100644 --- a/internal/httpservers/restapi_auth_oauth2.go +++ b/internal/httpservers/restapi_auth_oauth2.go @@ -13,8 +13,8 @@ import ( "golang.org/x/oauth2" "io" "net/http" - "time" "os" + "time" ) var ( @@ -169,8 +169,8 @@ func checkOAuthCallbackCookie(w http.ResponseWriter, r *http.Request) (*oauth2St } type HttpClientSettings struct { - Transport *http.Transport - Timeout time.Duration + Transport *http.Transport + Timeout time.Duration } func getOAuth2HttpClient(providerConfig *config.OAuth2Provider) *HttpClientSettings { @@ -178,7 +178,7 @@ func getOAuth2HttpClient(providerConfig *config.OAuth2Provider) *HttpClientSetti Transport: &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: providerConfig.InsecureSkipVerify}, }, - Timeout: time.Duration(min(3, providerConfig.CallbackTimeout)) * time.Second, + Timeout: time.Duration(min(3, providerConfig.CallbackTimeout)) * time.Second, } if providerConfig.CertBundlePath != "" { @@ -228,7 +228,7 @@ func handleOAuthCallback(w http.ResponseWriter, r *http.Request) { exchangeClient := &http.Client{ Transport: clientSettings.Transport, - Timeout: clientSettings.Timeout, + Timeout: clientSettings.Timeout, } ctx := context.Background() @@ -245,7 +245,7 @@ func handleOAuthCallback(w http.ResponseWriter, r *http.Request) { userInfoClient := &http.Client{ Transport: &oauth2.Transport{ Source: registeredState.providerConfig.TokenSource(ctx, tok), - Base: clientSettings.Transport, + Base: clientSettings.Transport, }, Timeout: clientSettings.Timeout, } @@ -270,7 +270,7 @@ func handleOAuthCallback(w http.ResponseWriter, r *http.Request) { } type UserInfo struct { - Username string + Username string Usergroup string }