Add audit log schema and multi-tenant isolation strategies#89
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…tures Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add audit log architecture for compliance blocking
Add audit log schema and multi-tenant isolation strategies
Jan 23, 2026
hotlong
approved these changes
Jan 23, 2026
Contributor
|
This PR is very large. Consider breaking it into smaller PRs for easier review. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive audit logging and multi-tenant isolation specifications to the ObjectStack spec repository. It introduces two major components: a complete audit event system for compliance tracking (SOX, HIPAA, GDPR) and detailed documentation of three multi-tenant isolation strategies with operational trade-offs.
Changes:
- Added
audit.zod.tswith audit event schemas supporting compliance requirements - Extended
tenant.zod.tswith three isolation strategy schemas (row-level, schema-level, database-level) and security policies - Added comprehensive test suites (43 audit tests, 39 tenant tests)
Reviewed changes
Copilot reviewed 93 out of 93 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/spec/src/system/audit.zod.ts | Complete audit logging specification with event types, storage, retention, and suspicious activity rules |
| packages/spec/src/system/audit.test.ts | Comprehensive test suite for audit schemas |
| packages/spec/src/system/tenant.zod.ts | Extended with multi-tenant isolation strategies and security policies |
| packages/spec/src/system/tenant.test.ts | Tests for isolation strategies and security policies |
| packages/spec/src/system/index.ts | Export added for audit module |
| packages/spec/json-schema/*.json | Generated JSON schemas for all new types |
| content/docs/references/**/*.mdx | Documentation files for schemas |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds compliance audit logging specification and documents three multi-tenant isolation patterns with operational trade-offs.
Audit Log Schema (
audit.zod.ts)Complete audit event specification supporting SOX/HIPAA/GDPR compliance:
Event Coverage:
Architecture:
Multi-Tenant Isolation Strategies (
tenant.zod.ts)Documents three isolation patterns with decision matrix:
Row-Level (RLS)
PostgreSQL policies, shared schema. Use for: cost-sensitive SaaS.
Schema-Level
Separate schema per tenant. Use for: enterprise B2B with compliance needs.
Database-Level
Separate database per tenant. Use for: regulated industries (healthcare, finance).
Each strategy includes configuration schemas for connection pooling, migrations, backups, and encryption.
Security Policy Schema
Adds compliance requirements per tenant:
Test Coverage
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.