Skip to content
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

Simplelogin alias generation only generate random words instead the domain name #13024

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

albertboyd5
Copy link
Contributor

@albertboyd5 albertboyd5 commented Jan 23, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-16171

📔 Objective

This PR addresses the issue where the Simplelogin alias generator creates random words instead of including the current website's domain name. The new implementation ensures that aliases are generated based on the active website domain and updates the Simplelogin alias note appropriately.

The alias should be generated in the format [email protected], where website is derived from the current browser tab's domain.
The alias note in Simplelogin should include:
Website: www.website.com. Generated by Bitwarden.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@albertboyd5 albertboyd5 requested review from a team as code owners January 23, 2025 04:10
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Details3dc5f04e-20f1-4666-b3fb-f72e873c882b

New Issues (10)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Client_Privacy_Violation /apps/browser/src/vault/popup/components/vault-v2/attachments/open-attachments/open-attachments.component.ts: 50
detailsMethod at line 50 of /apps/browser/src/vault/popup/components/vault-v2/attachments/open-attachments/open-attachments.component.ts sends user infor...
Attack Vector
MEDIUM Client_Privacy_Violation /libs/angular/src/admin-console/components/collections.component.ts: 36
detailsMethod at line 36 of /libs/angular/src/admin-console/components/collections.component.ts sends user information outside the application. This may ...
Attack Vector
MEDIUM Client_Privacy_Violation /libs/angular/src/vault/components/add-edit.component.ts: 119
detailsMethod at line 119 of /libs/angular/src/vault/components/add-edit.component.ts sends user information outside the application. This may constitute...
Attack Vector
MEDIUM Client_Privacy_Violation /libs/angular/src/vault/components/add-edit.component.ts: 286
detailsMethod load at line 286 of /libs/angular/src/vault/components/add-edit.component.ts sends user information outside the application. This may consti...
Attack Vector
MEDIUM Client_Privacy_Violation /apps/browser/src/vault/popup/components/vault-v2/attachments/open-attachments/open-attachments.component.ts: 50
detailsMethod OpenAttachmentsComponent at line 50 of /apps/browser/src/vault/popup/components/vault-v2/attachments/open-attachments/open-attachments.compo...
Attack Vector
MEDIUM Client_Privacy_Violation /libs/angular/src/vault/components/add-edit.component.ts: 780
detailsMethod loadAddEditCipherInfo at line 780 of /libs/angular/src/vault/components/add-edit.component.ts sends user information outside the application...
Attack Vector
MEDIUM Client_Privacy_Violation /libs/angular/src/vault/components/add-edit.component.ts: 70
detailsMethod at line 70 of /libs/angular/src/vault/components/add-edit.component.ts sends user information outside the application. This may constitute ...
Attack Vector
MEDIUM Client_Privacy_Violation /libs/angular/src/vault/components/add-edit.component.ts: 776
detailsMethod loadAddEditCipherInfo at line 776 of /libs/angular/src/vault/components/add-edit.component.ts sends user information outside the application...
Attack Vector
MEDIUM Client_Privacy_Violation /libs/angular/src/vault/components/add-edit.component.ts: 281
detailsMethod load at line 281 of /libs/angular/src/vault/components/add-edit.component.ts sends user information outside the application. This may consti...
Attack Vector
MEDIUM Client_Privacy_Violation /libs/angular/src/vault/components/add-edit.component.ts: 278
detailsMethod load at line 278 of /libs/angular/src/vault/components/add-edit.component.ts sends user information outside the application. This may consti...
Attack Vector

@albertboyd5 albertboyd5 changed the title Fix lint issue Simplelogin alias generation only generate random words instead the domain name Jan 23, 2025
@audreyality
Copy link
Member

⛏️ Please include a video demonstrating the new functionality.

Copy link
Member

Choose a reason for hiding this comment

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

📝 This change also needs to be applied to credential-generator.component.ts.

Copy link
Member

@audreyality audreyality Jan 23, 2025

Choose a reason for hiding this comment

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

🤔 Was this change requested by the vault team? The solution analysis indicates the website should be passed using an attribute on the component, not a new service.

If the vault team did ask for this service to be created, then it should be integrated within their component, not the shared tools component.

@@ -66,6 +67,7 @@ export class UsernameGeneratorComponent implements OnInit, OnDestroy {
private accountService: AccountService,
private zone: NgZone,
private formBuilder: FormBuilder,
private cipherFormUriService: CipherFormUriService,
Copy link
Member

Choose a reason for hiding this comment

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

❌ This couples the username generator to the vault. At present, the vault is the only consumer, but it's not the only one. Rewrite this to use an attribute.

Comment on lines +3 to +4
// eslint-disable-next-line import/no-restricted-paths
import { Injectable } from "@angular/core";
Copy link
Member

Choose a reason for hiding this comment

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

❌ The lint is correct. @bitwarden/common may not depend upon angular dependencies. Services implemented in common should be manually configured using the JsLibServiceModule.

Comment on lines +1 to +2
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
Copy link
Member

Choose a reason for hiding this comment

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

⚠️ New services should follow strict type safety.

@audreyality audreyality marked this pull request as draft January 23, 2025 15:45
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.

Simplelogin alias generation only generate random words instead the domain name
2 participants