Skip to content

feat: implementation of csrf, csp and secure cookies#194

Merged
qamarq merged 7 commits intomainfrom
feat/security
Feb 11, 2025
Merged

feat: implementation of csrf, csp and secure cookies#194
qamarq merged 7 commits intomainfrom
feat/security

Conversation

@qamarq
Copy link
Member

@qamarq qamarq commented Feb 11, 2025

This pull request includes several changes to the backend and frontend configurations, primarily focusing on adding security features and updating dependencies. The most important changes include the addition of the AdonisJS Shield package for enhanced security, modifications to the CORS configuration, and updates to the package-lock.json file to reflect new dependencies.

Backend Configuration Changes:

  • Added AdonisJS Shield package to enhance security by configuring CSP, CSRF, and other security policies. (backend/adonisrc.ts, backend/config/shield.ts, backend/package-lock.json, backend/package.json, backend/start/kernel.ts) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

  • Updated CORS configuration to dynamically set the allowed origins based on environment variables. (backend/config/cors.ts) [1] [2]

Frontend Configuration Changes:

  • Added sameSite: "strict" attribute to cookies for enhanced security. (frontend/src/app/api/callback/route.ts, frontend/src/app/api/login/route.ts) [1] [2]

  • Modified the logout function to use a custom fetchToAdonis method and delete additional cookies. (frontend/src/actions/logout.ts) [1] [2]

  • Included nonce in the analytics script tag for enhanced security. (frontend/src/app/layout.tsx) [1] [2] [3]

Other Changes:

  • Updated robots.txt to disallow crawling of certain paths. (frontend/public/robots.txt)

  • Minor syntax changes to remove semicolons in import statements. (backend/adonisrc.ts, backend/start/kernel.ts) [1] [2] [3] [4] [5]

@qamarq qamarq marked this pull request as ready for review February 11, 2025 19:52
@qamarq qamarq requested a review from Rei-x February 11, 2025 19:52
@Rei-x
Copy link
Member

Rei-x commented Feb 11, 2025

todo: zdjęcia usosa

@qamarq qamarq merged commit c5362a3 into main Feb 11, 2025
2 checks passed
@qamarq qamarq deleted the feat/security branch February 11, 2025 23:29
}: {
url: string;
method: RequestInit["method"];
body?: string | null;
Copy link
Member

Choose a reason for hiding this comment

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

tutaj mogłeś dać dowolny obiekt i potem w środku robić JSON.stringify, fajnie by działało myślę @qamarq

Copy link
Member Author

Choose a reason for hiding this comment

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

Wsm niegłupie

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