debug(gateway): add log to verify key admin_status at gateway
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -2719,7 +2720,8 @@ func handlePublicV1ChatCompletions(w http.ResponseWriter, r *http.Request, dsn s
|
||||
|
||||
key := keys[0]
|
||||
|
||||
// 3. Governance check
|
||||
// Governance check
|
||||
log.Printf("gateway: key %s admin_status=%s paused=%v fingerprint=%s", key.KeyID, key.AdminStatus, key.AdminStatus == "paused", keyFingerprint)
|
||||
if key.AdminStatus == "paused" {
|
||||
writeHTTPError(w, &httpError{StatusCode: http.StatusForbidden, Code: "key_paused", Message: "API key is paused"})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user