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