Skip to content

Fix signin regex validation#1850

Merged
joanreyero merged 2 commits intomainfrom
bugfix/complience-fixes
Nov 19, 2023
Merged

Fix signin regex validation#1850
joanreyero merged 2 commits intomainfrom
bugfix/complience-fixes

Conversation

@gaspergrom
Copy link
Copy Markdown
Contributor

@gaspergrom gaspergrom commented Nov 16, 2023

Changes proposed ✍️

What

🤖[deprecated] Generated by Copilot at 9b4bcb6

This pull request enhances the security, usability, and performance of the user, tenant, and report features in the backend and frontend. It adds password validation, permission checks, and a new tenantFindName endpoint. It also fixes a typo and improves the error messages for signing in and signing up. It affects the files backend/src/database/repositories/userRepository.ts, backend/src/security/permissions.ts, backend/src/api/tenant/*, backend/src/services/auth/authService.ts, backend/src/i18n/en.ts, frontend/src/modules/auth/pages/*, frontend/src/modules/layout/components/menu/workspace/menu-workspace-popover.vue, frontend/src/modules/layout/config/links/*, frontend/src/modules/report/pages/report-view-page-public.vue, frontend/src/modules/tenant/tenant-service.js, frontend/src/modules/user/user-model.js, and frontend/src/i18n/en.js.

🤖[deprecated] Generated by Copilot at 9b4bcb6

We are the tenants of the public eye
We show our names but we don't reveal our secrets
We face the regex of the password hell
We fight for our permissions in the settings

Why

How

🤖[deprecated] Generated by Copilot at 9b4bcb6

  • Add a new endpoint to the tenant API that returns the tenant name and id by its id for public reports (link, link)
  • Add a new method to the TenantService class that makes a GET request to the new endpoint (link)
  • Modify the report-view-page-public component to use the new method instead of fetching the whole tenant data (link)
  • Add a regex validation to the password before creating or updating a user in the AuthService class (link)
  • Add a new translation key for the 'Password is invalid' error message in the backend/src/i18n/en.ts and frontend/src/i18n/en.js modules (link, link)
  • Add a conditional rendering to the signin-page and signup-page components to display the error message if the password is invalid (link, link)
  • Modify the user-model module to separate the password field for signing up and changing the password from the passwordSignin field for signing in (link)
  • Modify the signin-page component to use the passwordSignin field instead of the password field for validation (link)
  • Add a new module for the SettingsPermissions class that checks the user's permissions for settings (link, link, link, link)
  • Modify the menu-workspace-popover, api-keys, plans-billing, and users-permissions modules to use the SettingsPermissions class to conditionally render or display the links and options for settings (link, link, link, link, link, link)
  • Modify the userRead and userAutocomplete permissions in the Permissions class to only allow the admin role to access them (link, link)
  • Add a PermissionChecker to the tenantFind module to validate the user's permission to read members of the tenant (link)
  • Delete sensitive fields from the user record before returning it in the userRepository module (link)
  • Fix a typo in the validation message '{path} is invalid' in the frontend/src/i18n/en.js module (link)
  • Add a blank line to the userRepository module for readability (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screenshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

Joan Reyero and others added 2 commits November 16, 2023 18:06
Co-authored-by: Gasper Grom <gasper.grom@gmail.com>
Co-authored-by: Joana Maia <joana@crowd.dev>
(cherry picked from commit 08bf721)
@gaspergrom gaspergrom added the Bug Created by Linear-GitHub Sync label Nov 16, 2023
@gaspergrom gaspergrom self-assigned this Nov 16, 2023
@joanreyero joanreyero merged commit 6ae836e into main Nov 19, 2023
@joanreyero joanreyero deleted the bugfix/complience-fixes branch November 19, 2023 22:18
sausage-todd pushed a commit that referenced this pull request Dec 7, 2023
Co-authored-by: Joan Reyero <joan@crowd.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants