-
Notifications
You must be signed in to change notification settings - Fork 0
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
TBCCT-158 Backend base data upload #156
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
2a3a4ff
to
fe70a91
Compare
@@ -260,6 +260,8 @@ jobs: | |||
backoffice: | |||
image: $ECR_REGISTRY/$ECR_REPOSITORY_ADMIN:$IMAGE_TAG | |||
restart: always | |||
environment: | |||
NODE_ENV: production |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to pass the env here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because if I want to work with a container locally for testing purposes, the variable was passed in directly like this pnpm --filter backoffice run start:prod
and the environment
property of a docker compose file service was not working, I could not pass NODE_ENV=development
.
This is just for comfort but we could fall back to the previous approach.
|
||
@Controller() | ||
@UseGuards(JwtAuthGuard, RolesGuard) | ||
@UseGuards(JwtCookieAuthGuard, RolesGuard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the point of this, but wouldn't this disable the functionality of uploading the file through a jwt-authenticated POST request? (with no cookies)
Could we have both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, the frontend does not save to the client the JWT it uses to send requests to the backend.
Andrés told me he saw in the nextjs documentation that you can customize the library's implementation at your own risk.
Therefore, in order to provide a full bidirectionaladminjs -> api
integration, the api generates the adminjs session cookie
and adminjs
can also authenticate an admin with a session cookie
.
@@ -214,7 +229,7 @@ const start = async () => { | |||
); | |||
|
|||
app.use(admin.options.rootPath, adminRouter); | |||
|
|||
admin.watch() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does like nodemon
but for adminjs.
…trategy and some refactors
…lable in the backend through some backoffice views
…ackoffice and update pnpm lock file
4515cad
to
f79761d
Compare
This pull request includes significant changes to the authentication module, backoffice service, and the addition of a new file ingestion feature. The most important changes include adding a new custom passport strategy, refactoring the backoffice service, and implementing a file ingestion page in the backoffice.
Authentication Module Updates:
passport-custom
dependency inapi/package.json
to support custom authentication strategies.BackofficeService
fromauth.module.ts
and updated its import path inauthentication.controller.ts
. [1] [2] [3]BackofficeSessionStrategy
and integrated it into theauthentication.module.ts
. [1] [2] [3] [4]JwtCookieAuthGuard
to handle JWT and backoffice session authentication.import.controller.ts
to useJwtCookieAuthGuard
instead ofJwtAuthGuard
. [1] [2]Backoffice Service Refactoring:
backoffice.service.ts
and added a new one with enhanced functionality, including cookie generation and session retrieval. [1] [2]backoffice.module.ts
to encapsulate the backoffice service and its dependencies.File Ingestion Feature:
backoffice/index.ts
to include the new file ingestion page and ensure it is properly loaded and watched. [1] [2] [3]Dependency and Configuration Updates:
styled-components
,react
, and related type definitions tobackoffice/package.json
andpnpm-lock.yaml
to support the new file ingestion feature. [1] [2] [3] [4] [5] [6]tsconfig.json
in the backoffice to include.tsx
files.