feat: implement attestation and usage read endpoints with row-level authorization - #69
Open
ayo-ola0710 wants to merge 4 commits into
Open
feat: implement attestation and usage read endpoints with row-level authorization#69ayo-ola0710 wants to merge 4 commits into
ayo-ola0710 wants to merge 4 commits into
Conversation
Contributor
|
@ayo-ola0710, Ci fails, ensure all ci passes and also resolve conflicts |
Author
|
Pls review again |
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.
What this changes
I introduced the core read API endpoints (/v1/attestations and /v1/usage) required to serve dashboard exports and verification flows. To support these endpoints, we configured Prisma ORM using a local SQLite adapter and defined schemas for both attestations and usage. The service layer logic is now firmly secured with strict row-level authorization—ensuring callers can only fetch data scoped to their tenant identity—and includes stable cursor pagination designed to handle continuously growing datasets without skipping rows. Finally, we tied this together with comprehensive Zod query validation, added robust integration tests to prevent cross-tenant data leaks, and updated our .gitignore to prevent committing local development databases.
Close #56
Why
How it was verified
Risk