feat: add scoped tenant api keys
This commit is contained in:
@@ -241,6 +241,11 @@ func RequireKBAccess(
|
||||
}
|
||||
|
||||
ctx := c.Request.Context()
|
||||
if err := authorizeTenantAPIKeyKnowledgeBase(ctx, kbID); err != nil {
|
||||
_ = c.Error(apperrors.NewForbiddenError("API key scope does not allow this knowledge base"))
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
// Rollout window: enforcement off -> log the would-be check and
|
||||
// pass through. We still resolve the KB (best-effort) so the
|
||||
|
||||
Reference in New Issue
Block a user