commit b8664e15b1c75adfb9a2673b4f42a08a917dd388 Author: Halite Demo Date: Sun Aug 16 12:42:22 2026 +0500 Initial AuthModule, ApiGateway, and DatabaseLayer stubs. diff --git a/README.md b/README.md new file mode 100644 index 0000000..df10f5d --- /dev/null +++ b/README.md @@ -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) diff --git a/src/api/gateway.ts b/src/api/gateway.ts new file mode 100644 index 0000000..dc18366 --- /dev/null +++ b/src/api/gateway.ts @@ -0,0 +1,6 @@ +export class ApiGateway { + /** API routing gateway — auth checks and rate limiting live here. */ + route(path: string): string { + return `/internal${path}`; + } +} diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts new file mode 100644 index 0000000..24b3fd3 --- /dev/null +++ b/src/auth/auth.service.ts @@ -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; + } +} diff --git a/src/db/postgres.ts b/src/db/postgres.ts new file mode 100644 index 0000000..4c05e66 --- /dev/null +++ b/src/db/postgres.ts @@ -0,0 +1,6 @@ +export class DatabaseLayer { + /** PostgreSQL connection pool owned by DatabaseLayer. */ + async query(_sql: string): Promise { + return []; + } +}