Skip to content

Commit

Permalink
Quetzalcoatl (#48)
Browse files Browse the repository at this point in the history
* feat: add init project structure

* feat(identity): scaffold db for default identity

* docs(auth): add architecture diagram

* feat(config): add jwt config

* perf: move endpoints to separate proj than di

* feat: add migrations for default identity

* feat(infr): add new migrations for custom user

* feat(domain): add user entity and jwt config

* perf(di): add custom user to identity auth

* feat(test): scaffold integration tests

* feat(app): implement handlers required by auth

-CreateUser
-ValidateUserCredentials
-GenerateJwtToken

* refactor(test): split test proj between integration and unit

* perf(mapper): use automapper for register endpoint

* perf(app): organize handlers based on vertical slice

* feat(test): add fixture for test containers

* feat(test): create integration test for register endpoint

* perf(api): refactor endpoints to improve readability

* fix(test): remove sqlconnection error and speed up test containers

- Declare additional IServiceCollection extension methods for ensuring db created and removing already existing DbContextOptions<AppDbContext> (not AppDbContext!!)

- Use the latest MsSql Docker Image

* feat(di): add default swagger support

* test: remove unit tests proj

As Fastendpoints Commands are hard to unit test outside of an Endpoint, it is enough to have only Integration tests to cover everything

* test(login): add integration test for login

* style: rename username prop and move jwt mapper here

* docs(swagger): add swagger support

* feat(users): scaffold CRUD users api

* style(auth): move validators to separate files

* feat(users): add get all endpoint

* test(users): add integration tests for get all endpoint

* feat(users): add get user endpoint

* test(users): add integration test for get user endpoint

* style(tests): add regions to enhance readability

* style: replace local usings with global usings

* perf(user): add guid as pk for application user

* feat(update): create update user endpoint

* test(update): create integration tests for update endpoint

* misc: update .gitignore

* perf(user manager): use predefined methods instead of LINQ for finding by id

* feat(api): create delete endpoint

* style: add regions and update global usings

* test(delete): create integration tests for delete endpoint

* docs(swagger): add summaries for Identity CRUD endpoints

* style(binding): remove redundant bind from attribute for models Id

* perf(update); enable request fields to be nullable

In order to allow partial update for user profile (similar to patch), enable validation/mapping rules only when a certain request field is provided

* style: add global usings

* test(update): add integration test for partial update

* style: format code

* style: adjust namespace for jwt config

* feat(user): add support for fullname and bio fields

* test(user): update integration tests to support fullname/bio fields

* feat(image): add support for user profile image

* test(register): update integration tests to support profile image

* perf(picture): enable support for picture in login endpoint

Enable eager loading in db context for profile picture in order to be able to retrieve the image id for the download URL

* feat(build): add migrations for profile picture

* test(login): update login tests for picture

Replace register endpoint invocation with the user manager directly in order to mitigate the tight coupling between tests and the QAPI

* feat(picture): update the rest of endpoints to support profile picture

* test(picture): update the rest of tests to support profile picture

* feat(image): add get image endpoint

* test(image): add integration test for get image endpoint

* perf(image): create image repository

* style: format code

* perf: add argument null guards to ctors

* feat(logger): configure serilog

* misc: add Logs to .gitignore

* perf: add logging to endpoints

* fix(logger): replace bootstrap logger with default

Bug related to integration tests fails

* feat(update): add permission guard to endpoint

Allow users to edit only their own profile, otherwise throw unauthorized

* test: add integration test for self update permission

* perf(update): replace unauthorized with forbidden

* perf: use default identity role

* perf: set model fields as init-only

* feat: add seed data for roles and admin user

* test(get all): remove users already added by seeding

* perf(delete): restrict access to endpoint using roles from jwt

* test(delete): add test for non-admin user

* perf(image): enable profile image to be nullable

* feat(api): add support for refresh tokens

Add RefreshToken endpoint and pass access/refresh token pairs via HttpOnly cookies

* perf(update user): get user id exclusively from route

* docs: add sequence flow diagrams for different scenarios

* perf(refresh-token): reduce the no generated refresh tokens

Generate refresh tokens only for specific scenarios, not for every kind of request:
- valid refresh/access token pair provided
- refresh/access token pair not already used to generate a new access token
- refresh token not expired
- access token expired
- etc.

* build(docker): add dockerfile for quetzalcoatl microservice

* perf(refresh token): add trigger for deleting stale tokens

* perf(refresh token): replace int with timespan for token lifetimes

* perf(config): use IOptions

* feat: add health check endpoint

* build(docker): add docker-compose

* perf(docker): assure that db is started before the api

* Test merging strategy (#39)

* fix(quetzalcoatl): remove obsolete role enum (#41)

* fix(quetzalcoatl): remove redundant compose file (#44)

* fix(quetzalcoatl): remove obsolete role enum

* fix(quetzalcoatl): remove redundant compose file

* Quetzalcoatl auth/psql migration (#47)

* fix(quetzalcoatl): remove obsolete role enum

* fix(quetzalcoatl): remove redundant compose file

* fix(ci): use correct regex to extract version from tag
  • Loading branch information
WarriorsSami authored Oct 31, 2024
1 parent 4bcb482 commit ef5220f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/step-deploy-to-docker-hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
images: ${{ inputs.namespace }}/${{ inputs.repository }}
tags: |
type=match,pattern=(.*)-v(\d.\d.\d),group=1
type=match,pattern=(.*)/v(\d.\d.\d),group=1
- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/step-deploy-to-ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }}
tags: |
type=match,pattern=(.*)-v(\d.\d.\d),group=1
type=match,pattern=(.*)/v(\d.\d.\d),group=1
- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand Down

0 comments on commit ef5220f

Please sign in to comment.