You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(dashboard,api): improve encryption error handling for legacy API keys (#513)
Legacy API keys lack embedded master keys and cannot derive KEK for
encryption. The API returned a generic "parameter error" with no
guidance, and the Dashboard had no client-side validation.
- API: return descriptive error messages instead of generic "parameter error"
- Dashboard: detect legacy vs compact keys using configurable prefix
- Dashboard: show warning banner and disable toggle for legacy keys
- Dashboard: validate API key prefix on save
- Dashboard: add eye toggle and autoComplete=off on API key input
@@ -119,13 +121,20 @@ export function EncryptionPageClient({
119
121
);
120
122
return;
121
123
}
124
+
if(!isCompactKey){
125
+
toast.error(
126
+
"Your API key is in legacy format and does not support encryption. Please rotate your API key on the API Keys page to get a new key that supports encryption.",
c.JSON(http.StatusBadRequest, serializer.ParamErr("", fmt.Errorf("project not found")))
76
+
c.JSON(http.StatusBadRequest, serializer.ParamErr("project not found", fmt.Errorf("project not found")))
77
77
return
78
78
}
79
79
80
80
userKEK:=middleware.GetUserKEK(c)
81
81
ifuserKEK==nil {
82
-
c.JSON(http.StatusBadRequest, serializer.ParamErr("", fmt.Errorf("API key required to derive encryption key")))
82
+
c.JSON(http.StatusBadRequest, serializer.ParamErr("compact API key required to derive encryption key; rotate your API key to disable encryption", nil))
0 commit comments