Skip to content

Add Database.authorizer() API #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2025
Merged

Add Database.authorizer() API #180

merged 3 commits into from
Apr 23, 2025

Conversation

penberg
Copy link
Contributor

@penberg penberg commented Apr 23, 2025

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new API, Database.authorizer(), to configure table-level authorization rules in the database. Key changes include:

  • Adding a new js_authorizer function on Database to process authorization rules.
  • Implementing an AuthorizerBuilder and Authorizer in a new module (auth.rs) to manage allow/deny logic.
  • Exposing the new API in both Node.js bindings (promise.js, index.js) and documentation (docs/api.md), along with integration tests.

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/statement.rs Minor reformatting of the interrupt() call.
src/lib.rs New export of databaseAuthorizer function.
src/database.rs Implements the js_authorizer method to configure rules.
src/auth.rs New module with AuthorizerBuilder and Authorizer logic.
promise.js, index.js Expose and utilize the new authorizer API in JS layer.
integration-tests/tests/extensions.test.js Adds tests for both allow and deny authorization cases.
docs/api.md API documentation update for authorizer() functionality.
auth.js Exports the Authorization enum used by the new API.
Files not reviewed (1)
  • package.json: Language not supported

@penberg penberg merged commit 51d9df6 into main Apr 23, 2025
9 checks passed
@penberg penberg deleted the authorizer branch April 23, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant