Browse Source

[SM-240] Add max length limit on SM strings (#5823)

* Add max length limit on SM strings

* remove HTML attributes

* remove from project
pull/5996/head
Thomas Avery 2 years ago committed by GitHub
parent
commit
eca060d7e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      bitwarden_license/bit-web/src/app/secrets-manager/projects/dialog/project-dialog.component.html
  2. 2
      bitwarden_license/bit-web/src/app/secrets-manager/projects/dialog/project-dialog.component.ts
  3. 2
      bitwarden_license/bit-web/src/app/secrets-manager/secrets/dialog/secret-dialog.component.html
  4. 8
      bitwarden_license/bit-web/src/app/secrets-manager/secrets/dialog/secret-dialog.component.ts
  5. 2
      bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/dialog/service-account-dialog.component.html
  6. 2
      bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/dialog/service-account-dialog.component.ts

2
bitwarden_license/bit-web/src/app/secrets-manager/projects/dialog/project-dialog.component.html

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
</div>
<bit-form-field *ngIf="!loading">
<bit-label>{{ "projectName" | i18n }}</bit-label>
<input appAutofocus formControlName="name" maxlength="1000" bitInput />
<input appAutofocus formControlName="name" bitInput />
</bit-form-field>
</span>
<ng-container bitDialogFooter>

2
bitwarden_license/bit-web/src/app/secrets-manager/projects/dialog/project-dialog.component.ts

@ -27,7 +27,7 @@ export interface ProjectOperation { @@ -27,7 +27,7 @@ export interface ProjectOperation {
export class ProjectDialogComponent implements OnInit {
protected formGroup = new FormGroup({
name: new FormControl("", {
validators: [Validators.required, BitValidators.trimValidator],
validators: [Validators.required, Validators.maxLength(500), BitValidators.trimValidator],
updateOn: "submit",
}),
});

2
bitwarden_license/bit-web/src/app/secrets-manager/secrets/dialog/secret-dialog.component.html

@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
<bit-form-field *ngIf="addNewProject == true">
<bit-label>{{ "projectName" | i18n }}</bit-label>
<input formControlName="newProjectName" maxlength="1000" bitInput />
<input formControlName="newProjectName" bitInput />
</bit-form-field>
</div>
<ng-container bitDialogFooter>

8
bitwarden_license/bit-web/src/app/secrets-manager/secrets/dialog/secret-dialog.component.ts

@ -38,17 +38,17 @@ export interface SecretOperation { @@ -38,17 +38,17 @@ export interface SecretOperation {
export class SecretDialogComponent implements OnInit {
protected formGroup = new FormGroup({
name: new FormControl("", {
validators: [Validators.required, BitValidators.trimValidator],
validators: [Validators.required, Validators.maxLength(500), BitValidators.trimValidator],
updateOn: "submit",
}),
value: new FormControl("", [Validators.required]),
value: new FormControl("", [Validators.required, Validators.maxLength(3500)]),
notes: new FormControl("", {
validators: [BitValidators.trimValidator],
validators: [Validators.maxLength(7000), BitValidators.trimValidator],
updateOn: "submit",
}),
project: new FormControl("", [Validators.required]),
newProjectName: new FormControl("", {
validators: [BitValidators.trimValidator],
validators: [Validators.maxLength(500), BitValidators.trimValidator],
updateOn: "submit",
}),
});

2
bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/dialog/service-account-dialog.component.html

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
<div *ngIf="!loading">
<bit-form-field>
<bit-label>{{ "serviceAccountName" | i18n }}</bit-label>
<input appAutofocus formControlName="name" maxlength="1000" bitInput />
<input appAutofocus formControlName="name" bitInput />
</bit-form-field>
</div>
</div>

2
bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/dialog/service-account-dialog.component.ts

@ -27,7 +27,7 @@ export class ServiceAccountDialogComponent { @@ -27,7 +27,7 @@ export class ServiceAccountDialogComponent {
protected formGroup = new FormGroup(
{
name: new FormControl("", {
validators: [Validators.required, BitValidators.trimValidator],
validators: [Validators.required, Validators.maxLength(500), BitValidators.trimValidator],
updateOn: "submit",
}),
},

Loading…
Cancel
Save