feat: add authentication for OSS (#167)

* feat: add authentication for OSS

Fixes #157 and #156

* fix: fix token generation

* fix: limit fastapi workers to 1
This commit is contained in:
Abhishek 2026-02-20 18:21:24 +05:30 committed by GitHub
parent 0791975864
commit 642cc34e8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 994 additions and 303 deletions

View file

@ -20,12 +20,14 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, D
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Skeleton } from '@/components/ui/skeleton';
import { useAppConfig } from '@/context/AppConfigContext';
import { useAuth } from '@/lib/auth';
import logger from '@/lib/logger';
import { isOSSMode } from '@/lib/utils';
export default function APIKeysPage() {
const { user, getAccessToken, redirectToLogin, loading } = useAuth();
const { config } = useAppConfig();
const isOSS = config?.deploymentMode === 'oss';
logger.debug('[APIKeysPage] Component render', {
loading,
@ -313,8 +315,8 @@ export default function APIKeysPage() {
// In OSS mode, check if there's already an active service key
const activeServiceKeys = serviceKeys.filter(key => !key.archived_at);
const canCreateServiceKey = !isOSSMode() || activeServiceKeys.length === 0;
const showServiceKeyArchiveControls = !isOSSMode();
const canCreateServiceKey = !isOSS || activeServiceKeys.length === 0;
const showServiceKeyArchiveControls = !isOSS;
return (
<div className="min-h-screen bg-background">