Initial AuthModule, ApiGateway, and DatabaseLayer stubs.
This commit is contained in:
commit
b8664e15b1
8
README.md
Normal file
8
README.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Halite sample service
|
||||||
|
|
||||||
|
Tiny TypeScript-style tree used to demo Halite decision invalidation.
|
||||||
|
|
||||||
|
Watched paths:
|
||||||
|
- `src/auth/auth.service.ts` (AuthModule)
|
||||||
|
- `src/api/gateway.ts` (ApiGateway)
|
||||||
|
- `src/db/postgres.ts` (DatabaseLayer)
|
||||||
6
src/api/gateway.ts
Normal file
6
src/api/gateway.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export class ApiGateway {
|
||||||
|
/** API routing gateway — auth checks and rate limiting live here. */
|
||||||
|
route(path: string): string {
|
||||||
|
return `/internal${path}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
src/auth/auth.service.ts
Normal file
8
src/auth/auth.service.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export class AuthModule {
|
||||||
|
/** JWT authentication service — matches Halite component path. */
|
||||||
|
validateAccessToken(token: string): boolean {
|
||||||
|
if (!token) return false;
|
||||||
|
const parts = token.split(".");
|
||||||
|
return parts.length === 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
6
src/db/postgres.ts
Normal file
6
src/db/postgres.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export class DatabaseLayer {
|
||||||
|
/** PostgreSQL connection pool owned by DatabaseLayer. */
|
||||||
|
async query(_sql: string): Promise<unknown[]> {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user