Skip to content

Add initial user API #26

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 5 commits into from
May 20, 2025
Merged

Add initial user API #26

merged 5 commits into from
May 20, 2025

Conversation

darshanasbg
Copy link
Member

Purpose

This pull request introduces a new user management feature to the backend system. It includes database schema updates for both PostgreSQL and SQLite, a new UserService with REST API endpoints, and supporting models, handlers, and data storage logic. Below are the most important changes grouped by theme:

Database Schema Updates

  • Added a new USER table to both PostgreSQL (postgress.sql) and SQLite (sqlite.sql) schemas to store user details such as USER_ID, ORG_ID, TYPE, and ATTRIBUTES. The table includes timestamps for CREATED_AT and UPDATED_AT. [1] [2]
  • Inserted a sample user record into the USER table in both PostgreSQL and SQLite scripts. [1] [2]

Service Layer Implementation

  • Introduced a new UserService in userservice.go to handle user-related operations, including creating, retrieving, updating, and deleting users. The service is registered in the ServiceManager. [1] [2]

REST API for User Management

  • Added a UserHandler in userhandler.go to define REST API endpoints (POST, GET, PUT, DELETE) for user management. Each endpoint is mapped to a corresponding service method.

Supporting Models and Providers

  • Created a User model in user.go to represent user data, including Id, OrgId, Type, and Attributes.
  • Added a UserProvider in userprovider.go to abstract the creation and retrieval of the UserService instance.

Data Storage Layer

  • Defined SQL queries for user operations (create, retrieve, update, delete) in constants.go under the store package. These queries are used by the UserService to interact with the database.

@darshanasbg darshanasbg force-pushed the user branch 2 times, most recently from abb0c7c to 46bf1ef Compare May 12, 2025 11:24
@darshanasbg darshanasbg force-pushed the user branch 3 times, most recently from b20d795 to c3ebbea Compare May 20, 2025 14:58
@darshanasbg darshanasbg merged commit 6cdc8b1 into asgardeo:main May 20, 2025
2 checks passed
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.

2 participants