feat(auth): add authentication routes and user token handling
- Implemented user authentication routes in `auth.ts` for fetching current user info and admin verification. - Added caching mechanism for user tokens to improve performance. - Created middleware for admin authentication. feat(opencode): create OpenCode client route - Added `opencode-cnb` route for creating OpenCode clients with session management. - Integrated OpenCode SDK for client operations and session handling. refactor(client): encapsulate OpenCode client creation - Created a utility function `getClient` in `client.ts` to initialize OpenCode clients. test(opencode): add tests for OpenCode routes - Implemented test cases for OpenCode routes in `list.ts` to validate functionality. - Created common utilities for testing in `common.ts`.
This commit is contained in:
9
assistant/src/routes/opencode/test/common.ts
Normal file
9
assistant/src/routes/opencode/test/common.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { app } from '@/app.ts';
|
||||
import '../cnb.ts'
|
||||
import "@/routes/auth.ts"
|
||||
import util from "node:util"
|
||||
export { app }
|
||||
|
||||
export const showMore = (data: any) => {
|
||||
return util.inspect(data, { depth: null, colors: true })
|
||||
}
|
||||
Reference in New Issue
Block a user