Skip to content
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

Implement EdgeDB and Role Management Functionality in Server-side TypeScript SDK #12

Open
moonlightnexus opened this issue Mar 30, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@moonlightnexus
Copy link
Contributor

Server-side SDK UPDATE

Description:

We need to implement the EdgeDB and role management functionality in the server-side TypeScript SDK, similar to the Python SDK ( https://github.com/One-Click-Auth/TrustAuthx-Py-SDK ) implementation. This includes the following features:

  1. EdgeDB Role Query: Implement the _EdgeDBRoleQuery class to query and manage roles and permissions. This class should support in-memory and database storage modes, with methods for querying roles, validating permissions, and counting roles.

  2. Role Management: Implement the _Roles class, which inherits from _EdgeDBRoleQuery. This class should provide methods for retrieving all roles, adding/deleting roles, and adding/deleting permissions for roles.

  3. Response Classes: Implement separate response classes for each method in the _Roles class, such as GetAllRolesResponse, AddRoleResponse, DeleteRoleResponse, AddPermissionResponse, and DeletePermissionResponse. These classes should match the response formats expected from the corresponding methods.

  4. Database Storage: Provide the option to store roles and permissions in a database. Recommend a suitable database solution for the server-side TypeScript SDK to use for this purpose. Some potential options include PostgreSQL, MySQL, or MongoDB.

  5. Documentation: Update the server-side TypeScript SDK documentation to include detailed information about the new classes, methods, and usage examples.

Implementation Steps:

  1. Create a new branch for this feature implementation.
  2. Implement the _EdgeDBRoleQuery class with the appropriate methods for querying and managing roles and permissions.
  3. Implement the _Roles class and its methods for role and permission management.
  4. Create separate response classes for each method in the _Roles class, following the expected response formats.
  5. Integrate a database solution (e.g., PostgreSQL, MySQL, or MongoDB) for storing roles and permissions, and provide the option to use either in-memory or database storage.
  6. Update the server-side TypeScript SDK documentation with detailed information about the new classes, methods, and usage examples.
  7. Test the implementation thoroughly, ensuring it works as expected.
  8. Create a pull request for review and merge the changes into the main branch once approved.

Recommendations:

For the server-side TypeScript SDK,

There's AI suggestion for SQLLITE

In TypeScript, you have several options to work with SQLite:

  1. sqlite3 with TypeScript: You can use the sqlite3 package along with its TypeScript definitions. You can install them using npm:

    npm install sqlite3
    npm install --save-dev @types/sqlite3

    This will allow you to use SQLite in your TypeScript project².

  2. sqlite: This is a wrapper library written in TypeScript that adds ES6 promises and SQL-based migrations API to sqlite3¹. You can install it using npm:

    npm install sqlite3 --save
    npm install sqlite --save

    This library has the same API as the original sqlite3 library, except that all its API methods return ES6 Promises¹.

  3. Prisma: If you're looking for an Object-Relational Mapping (ORM) solution, Prisma is a good option. It supports SQLite and has strong TypeScript integration³.

  4. better-sqlite3: This is another SQLite library that you can use in TypeScript⁴. It's designed to be simpler and faster than sqlite3.

@moonlightnexus moonlightnexus added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant