Skip to content

Commit 1fe2a37

Browse files
committed
code cleanup
Signed-off-by: Slach <[email protected]>
1 parent 9b9a265 commit 1fe2a37

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

cmd/altinity-mcp/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ func (a *application) jweTokenGeneratorHandler(w http.ResponseWriter, r *http.Re
349349
Port int `json:"port"`
350350
Database string `json:"database"`
351351
Username string `json:"username"`
352-
Password string `json:"password,omitempty"`
352+
Password string `json:"password"`
353353
Protocol string `json:"protocol"`
354-
Limit int `json:"limit,omitempty"`
355354
Expiry int `json:"expiry"` // in seconds
355+
Limit int `json:"limit,omitempty"`
356356
TLSEnabled bool `json:"tls_enabled,omitempty"`
357357
TLSCaCert string `json:"tls_ca_cert,omitempty"`
358358
TLSClientCert string `json:"tls_client_cert,omitempty"`
@@ -361,7 +361,7 @@ func (a *application) jweTokenGeneratorHandler(w http.ResponseWriter, r *http.Re
361361
}
362362

363363
if err := json.NewDecoder(r.Body).Decode(&reqBody); err != nil {
364-
http.Error(w, "Invalid request body", http.StatusBadRequest)
364+
http.Error(w, fmt.Sprintf("Invalid request body parsing error: %v", err), http.StatusBadRequest)
365365
return
366366
}
367367

cmd/jwe_auth/jwe_token_generator.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package main
33
import (
44
"flag"
55
"fmt"
6-
"github.com/altinity/altinity-mcp/pkg/jwe_auth"
76
"io"
87
"os"
98
"time"
9+
10+
"github.com/altinity/altinity-mcp/pkg/jwe_auth"
1011
)
1112

1213
// Generate JWE token using CLI flags
@@ -25,8 +26,8 @@ func run(output io.Writer, args []string) error {
2526
fs.SetOutput(output)
2627

2728
var (
28-
jweSecretKey = fs.String("jwe-secret-key", "your-jwe-secret-key", "Secret key for JWE token encryption")
29-
jwtSecretKey = fs.String("jwt-secret-key", "", "Symmetric secret key for JWT signing (required)")
29+
jweSecretKey = fs.String("jwe-secret-key", "your-jwe-secret-key", "Secret key for JWE token encryption (required)")
30+
jwtSecretKey = fs.String("jwt-secret-key", "", "Symmetric secret key for JWT signing (optional)")
3031
host = fs.String("host", "localhost", "ClickHouse host")
3132
port = fs.Int("port", 8123, "ClickHouse port")
3233
database = fs.String("database", "default", "ClickHouse database")

0 commit comments

Comments
 (0)