mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-15 01:48:06 +00:00
Compare commits
1 Commits
fix/codera
...
claude/sla
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4ed7f0735 |
@@ -56,6 +56,7 @@
|
||||
"@alloc/quick-lru": "catalog:",
|
||||
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
|
||||
"@comfyorg/comfyui-electron-types": "catalog:",
|
||||
"@comfyorg/auth": "workspace:*",
|
||||
"@comfyorg/design-system": "workspace:*",
|
||||
"@comfyorg/registry-types": "workspace:*",
|
||||
"@comfyorg/shared-frontend-utils": "workspace:*",
|
||||
|
||||
24
packages/auth/package.json
Normal file
24
packages/auth/package.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@comfyorg/auth",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "Authentication package for ComfyUI Frontend",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./types": "./src/types/index.ts",
|
||||
"./constants": "./src/constants/index.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "catalog:"
|
||||
},
|
||||
"packageManager": "pnpm@10.17.1",
|
||||
"nx": {
|
||||
"tags": [
|
||||
"scope:shared",
|
||||
"type:auth"
|
||||
]
|
||||
}
|
||||
}
|
||||
21
packages/auth/src/constants/index.ts
Normal file
21
packages/auth/src/constants/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Storage keys used for workspace authentication state.
|
||||
*/
|
||||
export const WORKSPACE_STORAGE_KEYS = {
|
||||
// sessionStorage keys (cleared on browser close)
|
||||
CURRENT_WORKSPACE: 'Comfy.Workspace.Current',
|
||||
TOKEN: 'Comfy.Workspace.Token',
|
||||
EXPIRES_AT: 'Comfy.Workspace.ExpiresAt',
|
||||
// localStorage key (persists across browser sessions)
|
||||
LAST_WORKSPACE_ID: 'Comfy.Workspace.LastWorkspaceId'
|
||||
} as const
|
||||
|
||||
/**
|
||||
* Buffer time before token expiry to trigger a refresh (5 minutes).
|
||||
*/
|
||||
export const TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1000
|
||||
|
||||
/**
|
||||
* Storage key for API key authentication.
|
||||
*/
|
||||
export const API_KEY_STORAGE_KEY = 'comfy_api_key'
|
||||
23
packages/auth/src/types/index.ts
Normal file
23
packages/auth/src/types/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
type LoggedInAuthHeader = {
|
||||
Authorization: `Bearer ${string}`
|
||||
}
|
||||
|
||||
export type ApiKeyAuthHeader = {
|
||||
'X-API-KEY': string
|
||||
}
|
||||
|
||||
export type AuthHeader = LoggedInAuthHeader | ApiKeyAuthHeader
|
||||
|
||||
export interface AuthUserInfo {
|
||||
id: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a workspace with the user's role in it.
|
||||
*/
|
||||
export interface WorkspaceWithRole {
|
||||
id: string
|
||||
name: string
|
||||
type: 'personal' | 'team'
|
||||
role: 'owner' | 'member'
|
||||
}
|
||||
12
packages/auth/tsconfig.json
Normal file
12
packages/auth/tsconfig.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"paths": {
|
||||
"@/*": ["../../src/*"],
|
||||
"@comfyorg/auth/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
1
packages/auth/tsconfig.tsbuildinfo
Normal file
1
packages/auth/tsconfig.tsbuildinfo
Normal file
File diff suppressed because one or more lines are too long
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@@ -368,6 +368,9 @@ importers:
|
||||
'@atlaskit/pragmatic-drag-and-drop':
|
||||
specifier: ^1.3.1
|
||||
version: 1.3.1
|
||||
'@comfyorg/auth':
|
||||
specifier: workspace:*
|
||||
version: link:packages/auth
|
||||
'@comfyorg/comfyui-electron-types':
|
||||
specifier: 'catalog:'
|
||||
version: 0.6.2
|
||||
@@ -836,6 +839,12 @@ importers:
|
||||
specifier: 'catalog:'
|
||||
version: 3.2.5(typescript@5.9.3)
|
||||
|
||||
packages/auth:
|
||||
devDependencies:
|
||||
typescript:
|
||||
specifier: 'catalog:'
|
||||
version: 5.9.3
|
||||
|
||||
packages/design-system:
|
||||
dependencies:
|
||||
'@iconify-json/lucide':
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
export const WORKSPACE_STORAGE_KEYS = {
|
||||
// sessionStorage keys (cleared on browser close)
|
||||
CURRENT_WORKSPACE: 'Comfy.Workspace.Current',
|
||||
TOKEN: 'Comfy.Workspace.Token',
|
||||
EXPIRES_AT: 'Comfy.Workspace.ExpiresAt',
|
||||
// localStorage key (persists across browser sessions)
|
||||
LAST_WORKSPACE_ID: 'Comfy.Workspace.LastWorkspaceId'
|
||||
} as const
|
||||
|
||||
export const TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1000
|
||||
/**
|
||||
* Re-export workspace constants from the @comfyorg/auth package.
|
||||
* This file is kept for backward compatibility with existing imports.
|
||||
*/
|
||||
export {
|
||||
TOKEN_REFRESH_BUFFER_MS,
|
||||
WORKSPACE_STORAGE_KEYS
|
||||
} from '@comfyorg/auth/constants'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
export interface WorkspaceWithRole {
|
||||
id: string
|
||||
name: string
|
||||
type: 'personal' | 'team'
|
||||
role: 'owner' | 'member'
|
||||
}
|
||||
/**
|
||||
* Re-export workspace types from the @comfyorg/auth package.
|
||||
* This file is kept for backward compatibility with existing imports.
|
||||
*/
|
||||
export type { WorkspaceWithRole } from '@comfyorg/auth/types'
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
type LoggedInAuthHeader = {
|
||||
Authorization: `Bearer ${string}`
|
||||
}
|
||||
|
||||
export type ApiKeyAuthHeader = {
|
||||
'X-API-KEY': string
|
||||
}
|
||||
|
||||
export type AuthHeader = LoggedInAuthHeader | ApiKeyAuthHeader
|
||||
|
||||
export interface AuthUserInfo {
|
||||
id: string
|
||||
}
|
||||
/**
|
||||
* Re-export auth types from the @comfyorg/auth package.
|
||||
* This file is kept for backward compatibility with existing imports.
|
||||
*/
|
||||
export type {
|
||||
ApiKeyAuthHeader,
|
||||
AuthHeader,
|
||||
AuthUserInfo
|
||||
} from '@comfyorg/auth/types'
|
||||
|
||||
Reference in New Issue
Block a user