Răsfoiți Sursa

fmt: code style (#518)

James Read 1 an în urmă
părinte
comite
6550223ee4

+ 2 - 2
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 {

+ 1 - 1
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"
 )
 

+ 7 - 7
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
 }