Initial AuthModule, ApiGateway, and DatabaseLayer stubs.

This commit is contained in:
Halite Demo 2026-08-16 12:42:22 +05:00
commit b8664e15b1
4 changed files with 28 additions and 0 deletions

8
README.md Normal file
View 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
View 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
View 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
View File

@ -0,0 +1,6 @@
export class DatabaseLayer {
/** PostgreSQL connection pool owned by DatabaseLayer. */
async query(_sql: string): Promise<unknown[]> {
return [];
}
}