mirror of
https://github.com/bitwarden/web
synced 2025-12-16 08:13:22 +00:00
Compare commits
36 Commits
PS-589-add
...
2022.05.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec80782d8f | ||
|
|
3acee89646 | ||
|
|
589faf3608 | ||
|
|
639cc461ae | ||
|
|
4562920d30 | ||
|
|
c6f4e4de64 | ||
|
|
f323963a4e | ||
|
|
f6c8b6d8cb | ||
|
|
11f34be18e | ||
|
|
647e9555d0 | ||
|
|
ad7b6e6388 | ||
|
|
718ca197b5 | ||
|
|
338d593cd1 | ||
|
|
aa29a07678 | ||
|
|
0722522801 | ||
|
|
5731c6449b | ||
|
|
eaf083be44 | ||
|
|
8435c85c3c | ||
|
|
3d1c2dad74 | ||
|
|
2f632f7096 | ||
|
|
9b63c81b56 | ||
|
|
34cb463e94 | ||
|
|
7bbe3d7b28 | ||
|
|
0564b52f1f | ||
|
|
cb1f08d74b | ||
|
|
f3bf972d26 | ||
|
|
02256aad87 | ||
|
|
466e0c8c35 | ||
|
|
0543e76432 | ||
|
|
34527160fc | ||
|
|
f590fe5435 | ||
|
|
0f64c16c18 | ||
|
|
1632a24b1e | ||
|
|
0691af1dcd | ||
|
|
3e59617fb1 | ||
|
|
268b16ca98 |
23
.github/workflows/release.yml
vendored
23
.github/workflows/release.yml
vendored
@@ -19,8 +19,8 @@ jobs:
|
|||||||
name: Setup
|
name: Setup
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
outputs:
|
outputs:
|
||||||
release_version: ${{ steps.version.outputs.package }}
|
release_version: ${{ steps.version.outputs.version }}
|
||||||
tag_version: ${{ steps.version.outputs.tag }}
|
tag_version: ${{ steps.version.outputs.version }}
|
||||||
branch_name: ${{ steps.branch.outputs.branch_name }}
|
branch_name: ${{ steps.branch.outputs.branch_name }}
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
@@ -38,20 +38,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Release Version
|
- name: Check Release Version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
uses: bitwarden/gh-actions/release-version-check@ea9fab01d76940267b4147cc1c4542431246b9f6
|
||||||
version=$( jq -r ".version" package.json)
|
with:
|
||||||
previous_release_tag_version=$(
|
release-type: ${{ github.event.inputs.release_type }}
|
||||||
curl -sL https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r ".tag_name"
|
project-type: ts
|
||||||
)
|
file: package.json
|
||||||
|
|
||||||
if [ "v$version" == "$previous_release_tag_version" ] && \
|
|
||||||
[ "${{ github.event.inputs.release_type }}" == "Initial Release" ]; then
|
|
||||||
echo "[!] Already released v$version. Please bump version to continue"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "::set-output name=package::$version"
|
|
||||||
echo "::set-output name=tag::v$version"
|
|
||||||
|
|
||||||
- name: Get branch name
|
- name: Get branch name
|
||||||
id: branch
|
id: branch
|
||||||
|
|||||||
2
jslib
2
jslib
Submodule jslib updated: 52cc640537...1cc4bed671
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@bitwarden/web-vault",
|
"name": "@bitwarden/web-vault",
|
||||||
"version": "2.28.1",
|
"version": "2022.05.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@bitwarden/web-vault",
|
"name": "@bitwarden/web-vault",
|
||||||
"version": "2.28.1",
|
"version": "2022.05.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bitwarden/web-vault",
|
"name": "@bitwarden/web-vault",
|
||||||
"version": "2.28.1",
|
"version": "2022.05.0",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/bitwarden/web",
|
"repository": "https://github.com/bitwarden/web",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
<div [ngClass]="{ 'col-5': layout, 'col-12': !layout }">
|
<div [ngClass]="{ 'col-5': layout, 'col-12': !layout }">
|
||||||
<div class="row justify-content-md-center mt-5">
|
<div class="row justify-content-md-center mt-5">
|
||||||
<div [ngClass]="{ 'col-5': !layout, 'col-12': layout }">
|
<div [ngClass]="{ 'col-5': !layout, 'col-12': layout }">
|
||||||
<h1 class="lead text-center mb-4" *ngIf="!layout">{{ "createAccount" | i18n }}</h1>
|
<p class="lead text-center mb-4" *ngIf="!layout">{{ "createAccount" | i18n }}</p>
|
||||||
<div class="card d-block">
|
<div class="card d-block">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<app-callout
|
<app-callout
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="container footer text-muted">
|
<div class="container footer text-muted">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">© {{ year }} Bitwarden Inc.</div>
|
<div class="col">© {{ year }}, Bitwarden Inc.</div>
|
||||||
<div class="col text-center"></div>
|
<div class="col text-center"></div>
|
||||||
<div class="col text-right">
|
<div class="col text-right">
|
||||||
{{ "versionNumber" | i18n: version }}
|
{{ "versionNumber" | i18n: version }}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
<div class="container my-5 text-muted text-center">
|
<div class="container my-5 text-muted text-center">
|
||||||
© {{ year }} Bitwarden Inc. <br />
|
© {{ year }}, Bitwarden Inc. <br />
|
||||||
{{ "versionNumber" | i18n: version }}
|
{{ "versionNumber" | i18n: version }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import { BulkStatusComponent as OrgBulkStatusComponent } from "../organizations/
|
|||||||
import { CollectionAddEditComponent as OrgCollectionAddEditComponent } from "../organizations/manage/collection-add-edit.component";
|
import { CollectionAddEditComponent as OrgCollectionAddEditComponent } from "../organizations/manage/collection-add-edit.component";
|
||||||
import { CollectionsComponent as OrgManageCollectionsComponent } from "../organizations/manage/collections.component";
|
import { CollectionsComponent as OrgManageCollectionsComponent } from "../organizations/manage/collections.component";
|
||||||
import { EntityEventsComponent as OrgEntityEventsComponent } from "../organizations/manage/entity-events.component";
|
import { EntityEventsComponent as OrgEntityEventsComponent } from "../organizations/manage/entity-events.component";
|
||||||
|
import { EntityUsersComponent as OrgEntityUsersComponent } from "../organizations/manage/entity-users.component";
|
||||||
import { EventsComponent as OrgEventsComponent } from "../organizations/manage/events.component";
|
import { EventsComponent as OrgEventsComponent } from "../organizations/manage/events.component";
|
||||||
import { GroupAddEditComponent as OrgGroupAddEditComponent } from "../organizations/manage/group-add-edit.component";
|
import { GroupAddEditComponent as OrgGroupAddEditComponent } from "../organizations/manage/group-add-edit.component";
|
||||||
import { GroupsComponent as OrgGroupsComponent } from "../organizations/manage/groups.component";
|
import { GroupsComponent as OrgGroupsComponent } from "../organizations/manage/groups.component";
|
||||||
@@ -242,6 +243,7 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga
|
|||||||
OrgCollectionAddEditComponent,
|
OrgCollectionAddEditComponent,
|
||||||
OrgCollectionsComponent,
|
OrgCollectionsComponent,
|
||||||
OrgEntityEventsComponent,
|
OrgEntityEventsComponent,
|
||||||
|
OrgEntityUsersComponent,
|
||||||
OrgEventsComponent,
|
OrgEventsComponent,
|
||||||
OrgExportComponent,
|
OrgExportComponent,
|
||||||
OrgExposedPasswordsReportComponent,
|
OrgExposedPasswordsReportComponent,
|
||||||
@@ -401,6 +403,7 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga
|
|||||||
OrgCollectionAddEditComponent,
|
OrgCollectionAddEditComponent,
|
||||||
OrgCollectionsComponent,
|
OrgCollectionsComponent,
|
||||||
OrgEntityEventsComponent,
|
OrgEntityEventsComponent,
|
||||||
|
OrgEntityUsersComponent,
|
||||||
OrgEventsComponent,
|
OrgEventsComponent,
|
||||||
OrgExportComponent,
|
OrgExportComponent,
|
||||||
OrgExposedPasswordsReportComponent,
|
OrgExposedPasswordsReportComponent,
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
import { ScrollingModule } from "@angular/cdk/scrolling";
|
|
||||||
import { NgModule } from "@angular/core";
|
|
||||||
|
|
||||||
import { SharedModule } from "../../shared.module";
|
|
||||||
|
|
||||||
import { EntityUsersComponent } from "./entity-users.component";
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [SharedModule, ScrollingModule],
|
|
||||||
declarations: [EntityUsersComponent],
|
|
||||||
exports: [EntityUsersComponent],
|
|
||||||
})
|
|
||||||
export class OrganizationManageModule {}
|
|
||||||
@@ -25,7 +25,17 @@ export class VaultFilterComponent extends BaseVaultFilterComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
searchTextChanged() {
|
searchTextChanged() {
|
||||||
this.onSearchTextChanged.emit(this.searchText.normalize("NFD").replace(/[\u0300-\u036f]/g, ""));
|
this.onSearchTextChanged.emit(this.searchText);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This method exists because the vault component gets its data mixed up during the initial sync on first login. It looks for data before the sync is complete.
|
||||||
|
// It should be removed as soon as doing so makes sense.
|
||||||
|
async reloadOrganizations() {
|
||||||
|
this.organizations = await this.vaultFilterService.buildOrganizations();
|
||||||
|
this.activePersonalOwnershipPolicy =
|
||||||
|
await this.vaultFilterService.checkForPersonalOwnershipPolicy();
|
||||||
|
this.activeSingleOrganizationPolicy =
|
||||||
|
await this.vaultFilterService.checkForSingleOrganizationPolicy();
|
||||||
}
|
}
|
||||||
|
|
||||||
async initCollections() {
|
async initCollections() {
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
|
|||||||
updateKeyModalRef: ViewContainerRef;
|
updateKeyModalRef: ViewContainerRef;
|
||||||
|
|
||||||
favorites = false;
|
favorites = false;
|
||||||
|
type: CipherType = null;
|
||||||
folderId: string = null;
|
folderId: string = null;
|
||||||
collectionId: string = null;
|
collectionId: string = null;
|
||||||
organizationId: string = null;
|
organizationId: string = null;
|
||||||
@@ -326,7 +327,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
async addCipher() {
|
async addCipher() {
|
||||||
const component = await this.editCipher(null);
|
const component = await this.editCipher(null);
|
||||||
component.type = this.activeFilter.cipherType;
|
component.type = this.type;
|
||||||
component.folderId = this.folderId === "none" ? null : this.folderId;
|
component.folderId = this.folderId === "none" ? null : this.folderId;
|
||||||
if (this.activeFilter.selectedCollectionId != null) {
|
if (this.activeFilter.selectedCollectionId != null) {
|
||||||
const collection = this.filterComponent.collections.fullList.filter(
|
const collection = this.filterComponent.collections.fullList.filter(
|
||||||
@@ -398,7 +399,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
|
|||||||
if (queryParams == null) {
|
if (queryParams == null) {
|
||||||
queryParams = {
|
queryParams = {
|
||||||
favorites: this.favorites ? true : null,
|
favorites: this.favorites ? true : null,
|
||||||
type: this.activeFilter.cipherType,
|
type: this.type,
|
||||||
folderId: this.folderId,
|
folderId: this.folderId,
|
||||||
collectionId: this.collectionId,
|
collectionId: this.collectionId,
|
||||||
deleted: this.deleted ? true : null,
|
deleted: this.deleted ? true : null,
|
||||||
|
|||||||
@@ -20,9 +20,8 @@ import {
|
|||||||
import { ListResponse } from "jslib-common/models/response/listResponse";
|
import { ListResponse } from "jslib-common/models/response/listResponse";
|
||||||
import { CollectionView } from "jslib-common/models/view/collectionView";
|
import { CollectionView } from "jslib-common/models/view/collectionView";
|
||||||
|
|
||||||
import { EntityUsersComponent } from "../../modules/organizations/manage/entity-users.component";
|
|
||||||
|
|
||||||
import { CollectionAddEditComponent } from "./collection-add-edit.component";
|
import { CollectionAddEditComponent } from "./collection-add-edit.component";
|
||||||
|
import { EntityUsersComponent } from "./entity-users.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-org-manage-collections",
|
selector: "app-org-manage-collections",
|
||||||
|
|||||||
@@ -29,52 +29,52 @@
|
|||||||
></i>
|
></i>
|
||||||
<span class="sr-only">{{ "loading" | i18n }}</span>
|
<span class="sr-only">{{ "loading" | i18n }}</span>
|
||||||
</div>
|
</div>
|
||||||
<cdk-virtual-scroll-viewport
|
<div
|
||||||
itemSize="46"
|
class="modal-body"
|
||||||
minBufferPx="600"
|
*ngIf="
|
||||||
maxBufferPx="1200"
|
!loading && users && (users | search: searchText:'name':'email':'id') as searchedUsers
|
||||||
[style]="scrollViewportStyle"
|
"
|
||||||
>
|
>
|
||||||
<div class="modal-body" *ngIf="!loading && users && searchedUsers">
|
<div class="d-flex">
|
||||||
<div class="d-flex">
|
<div class="mr-3">
|
||||||
<div class="mr-3">
|
<label class="sr-only" for="search">{{ "search" | i18n }}</label>
|
||||||
<label class="sr-only" for="search">{{ "search" | i18n }}</label>
|
<input
|
||||||
<input
|
type="search"
|
||||||
type="search"
|
class="form-control form-control-sm"
|
||||||
class="form-control form-control-sm"
|
id="search"
|
||||||
id="search"
|
placeholder="{{ 'search' | i18n }}"
|
||||||
placeholder="{{ 'search' | i18n }}"
|
name="SearchText"
|
||||||
name="SearchText"
|
[(ngModel)]="searchText"
|
||||||
[(ngModel)]="searchText"
|
/>
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="btn-group btn-group-sm" role="group">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-outline-secondary"
|
|
||||||
[ngClass]="{ active: !showSelected }"
|
|
||||||
(click)="filterSelected(false)"
|
|
||||||
>
|
|
||||||
{{ "all" | i18n }}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-outline-secondary"
|
|
||||||
[ngClass]="{ active: showSelected }"
|
|
||||||
(click)="filterSelected(true)"
|
|
||||||
>
|
|
||||||
{{ "selected" | i18n }}
|
|
||||||
<span class="badge badge-pill badge-info" *ngIf="selectedCount">{{
|
|
||||||
selectedCount
|
|
||||||
}}</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<ng-container *ngIf="!searchedUsers.length">
|
<div class="btn-group btn-group-sm" role="group">
|
||||||
<hr />
|
<button
|
||||||
{{ "noUsersInList" | i18n }}
|
type="button"
|
||||||
</ng-container>
|
class="btn btn-outline-secondary"
|
||||||
<table class="table table-hover table-list mb-0" [hidden]="!searchedUsers.length">
|
[ngClass]="{ active: !showSelected }"
|
||||||
|
(click)="filterSelected(false)"
|
||||||
|
>
|
||||||
|
{{ "all" | i18n }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-outline-secondary"
|
||||||
|
[ngClass]="{ active: showSelected }"
|
||||||
|
(click)="filterSelected(true)"
|
||||||
|
>
|
||||||
|
{{ "selected" | i18n }}
|
||||||
|
<span class="badge badge-pill badge-info" *ngIf="selectedCount">{{
|
||||||
|
selectedCount
|
||||||
|
}}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ng-container *ngIf="!searchedUsers.length">
|
||||||
|
<hr />
|
||||||
|
{{ "noUsersInList" | i18n }}
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="searchedUsers.length">
|
||||||
|
<table class="table table-hover table-list mb-0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *cdkVirtualFor="let u of searchedUsers" class="">
|
<tr *ngFor="let u of searchedUsers">
|
||||||
<td class="table-list-checkbox" (click)="check(u)">
|
<td class="table-list-checkbox" (click)="check(u)">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -164,8 +164,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</ng-container>
|
||||||
</cdk-virtual-scroll-viewport>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
|
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
|
||||||
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
|
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
||||||
|
|
||||||
import { SearchPipe } from "jslib-angular/pipes/search.pipe";
|
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
@@ -14,7 +13,6 @@ import { OrganizationUserUserDetailsResponse } from "jslib-common/models/respons
|
|||||||
@Component({
|
@Component({
|
||||||
selector: "app-entity-users",
|
selector: "app-entity-users",
|
||||||
templateUrl: "entity-users.component.html",
|
templateUrl: "entity-users.component.html",
|
||||||
providers: [SearchPipe],
|
|
||||||
})
|
})
|
||||||
export class EntityUsersComponent implements OnInit {
|
export class EntityUsersComponent implements OnInit {
|
||||||
@Input() entity: "group" | "collection";
|
@Input() entity: "group" | "collection";
|
||||||
@@ -35,7 +33,6 @@ export class EntityUsersComponent implements OnInit {
|
|||||||
private allUsers: OrganizationUserUserDetailsResponse[] = [];
|
private allUsers: OrganizationUserUserDetailsResponse[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private search: SearchPipe,
|
|
||||||
private apiService: ApiService,
|
private apiService: ApiService,
|
||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private platformUtilsService: PlatformUtilsService,
|
private platformUtilsService: PlatformUtilsService,
|
||||||
@@ -55,14 +52,6 @@ export class EntityUsersComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get searchedUsers() {
|
|
||||||
return this.search.transform(this.users, this.searchText, "name", "email", "id");
|
|
||||||
}
|
|
||||||
|
|
||||||
get scrollViewportStyle() {
|
|
||||||
return `min-height: 120px; height: ${120 + this.searchedUsers.length * 46}px`;
|
|
||||||
}
|
|
||||||
|
|
||||||
async loadUsers() {
|
async loadUsers() {
|
||||||
const users = await this.apiService.getOrganizationUsers(this.organizationId);
|
const users = await this.apiService.getOrganizationUsers(this.organizationId);
|
||||||
this.allUsers = users.data.map((r) => r).sort(Utils.getSortFunction(this.i18nService, "email"));
|
this.allUsers = users.data.map((r) => r).sort(Utils.getSortFunction(this.i18nService, "email"));
|
||||||
@@ -12,8 +12,7 @@ import { SearchService } from "jslib-common/abstractions/search.service";
|
|||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
import { GroupResponse } from "jslib-common/models/response/groupResponse";
|
import { GroupResponse } from "jslib-common/models/response/groupResponse";
|
||||||
|
|
||||||
import { EntityUsersComponent } from "../../modules/organizations/manage/entity-users.component";
|
import { EntityUsersComponent } from "./entity-users.component";
|
||||||
|
|
||||||
import { GroupAddEditComponent } from "./group-add-edit.component";
|
import { GroupAddEditComponent } from "./group-add-edit.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -3,10 +3,7 @@ import { ActivatedRoute } from "@angular/router";
|
|||||||
|
|
||||||
import { ModalService } from "jslib-angular/services/modal.service";
|
import { ModalService } from "jslib-angular/services/modal.service";
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
|
||||||
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
|
||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
||||||
@@ -25,21 +22,9 @@ export class TwoFactorSetupComponent extends BaseTwoFactorSetupComponent {
|
|||||||
messagingService: MessagingService,
|
messagingService: MessagingService,
|
||||||
policyService: PolicyService,
|
policyService: PolicyService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
stateService: StateService,
|
stateService: StateService
|
||||||
platformUtilsService: PlatformUtilsService,
|
|
||||||
i18nService: I18nService,
|
|
||||||
logService: LogService
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(apiService, modalService, messagingService, policyService, stateService);
|
||||||
apiService,
|
|
||||||
modalService,
|
|
||||||
messagingService,
|
|
||||||
policyService,
|
|
||||||
stateService,
|
|
||||||
platformUtilsService,
|
|
||||||
i18nService,
|
|
||||||
logService
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { NgModule } from "@angular/core";
|
import { NgModule } from "@angular/core";
|
||||||
|
|
||||||
import { LooseComponentsModule } from "./modules/loose-components.module";
|
import { LooseComponentsModule } from "./modules/loose-components.module";
|
||||||
import { OrganizationManageModule } from "./modules/organizations/manage/organization-manage.module";
|
|
||||||
import { PipesModule } from "./modules/pipes/pipes.module";
|
import { PipesModule } from "./modules/pipes/pipes.module";
|
||||||
import { SharedModule } from "./modules/shared.module";
|
import { SharedModule } from "./modules/shared.module";
|
||||||
import { VaultFilterModule } from "./modules/vault-filter/vault-filter.module";
|
import { VaultFilterModule } from "./modules/vault-filter/vault-filter.module";
|
||||||
@@ -14,7 +13,6 @@ import { OrganizationBadgeModule } from "./modules/vault/modules/organization-ba
|
|||||||
VaultFilterModule,
|
VaultFilterModule,
|
||||||
OrganizationBadgeModule,
|
OrganizationBadgeModule,
|
||||||
PipesModule,
|
PipesModule,
|
||||||
OrganizationManageModule,
|
|
||||||
],
|
],
|
||||||
exports: [LooseComponentsModule, VaultFilterModule, OrganizationBadgeModule, PipesModule],
|
exports: [LooseComponentsModule, VaultFilterModule, OrganizationBadgeModule, PipesModule],
|
||||||
bootstrap: [],
|
bootstrap: [],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<form #form (ngSubmit)="load()" [appApiAction]="formPromise" class="container" ngNativeValidate>
|
<form #form (ngSubmit)="load()" [appApiAction]="formPromise" class="container" ngNativeValidate>
|
||||||
<div class="row justify-content-center mt-5">
|
<div class="row justify-content-center mt-5">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h1 class="lead text-center mb-4">Bitwarden Send</h1>
|
<p class="lead text-center mb-4">Bitwarden Send</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 text-center" *ngIf="creatorIdentifier != null">
|
<div class="col-12 text-center" *ngIf="creatorIdentifier != null">
|
||||||
<p>{{ "sendCreatorIdentifier" | i18n: creatorIdentifier }}</p>
|
<p>{{ "sendCreatorIdentifier" | i18n: creatorIdentifier }}</p>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { Component } from "@angular/core";
|
|||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { OrganizationConnectionType } from "jslib-common/enums/organizationConnectionType";
|
import { OrganizationConnectionType } from "jslib-common/enums/organizationConnectionType";
|
||||||
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
import { BillingSyncConfigApi } from "jslib-common/models/api/billingSyncConfigApi";
|
import { BillingSyncConfigApi } from "jslib-common/models/api/billingSyncConfigApi";
|
||||||
import { BillingSyncConfigRequest } from "jslib-common/models/request/billingSyncConfigRequest";
|
import { BillingSyncConfigRequest } from "jslib-common/models/request/billingSyncConfigRequest";
|
||||||
import { OrganizationConnectionRequest } from "jslib-common/models/request/organizationConnectionRequest";
|
import { OrganizationConnectionRequest } from "jslib-common/models/request/organizationConnectionRequest";
|
||||||
|
|||||||
@@ -73,14 +73,10 @@ export class TaxInfoComponent {
|
|||||||
this.logService.error(e);
|
this.logService.error(e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
const taxInfo = await this.apiService.getTaxInfo();
|
||||||
const taxInfo = await this.apiService.getTaxInfo();
|
if (taxInfo) {
|
||||||
if (taxInfo) {
|
this.taxInfo.postalCode = taxInfo.postalCode;
|
||||||
this.taxInfo.postalCode = taxInfo.postalCode;
|
this.taxInfo.country = taxInfo.country || "US";
|
||||||
this.taxInfo.country = taxInfo.country || "US";
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.logService.error(e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.pristine = Object.assign({}, this.taxInfo);
|
this.pristine = Object.assign({}, this.taxInfo);
|
||||||
@@ -90,16 +86,9 @@ export class TaxInfoComponent {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
const taxRates = await this.apiService.getTaxRates();
|
||||||
const taxRates = await this.apiService.getTaxRates();
|
this.taxRates = taxRates.data;
|
||||||
if (taxRates) {
|
this.loading = false;
|
||||||
this.taxRates = taxRates.data;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.logService.error(e);
|
|
||||||
} finally {
|
|
||||||
this.loading = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get taxRate() {
|
get taxRate() {
|
||||||
|
|||||||
@@ -55,40 +55,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<form *ngIf="!loading" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-12">
|
|
||||||
<h2 class="mt-5 spaced-header">
|
|
||||||
{{ "deviceVerification" | i18n }}
|
|
||||||
</h2>
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="form-check">
|
|
||||||
<input
|
|
||||||
class="form-check-input"
|
|
||||||
type="checkbox"
|
|
||||||
id="enableDeviceVerification"
|
|
||||||
name="enableDeviceVerification"
|
|
||||||
disabled="{{ !isDeviceVerificationSectionEnabled }}"
|
|
||||||
[(ngModel)]="enableDeviceVerification"
|
|
||||||
/>
|
|
||||||
<label class="form-check-label" for="enableDeviceVerification">
|
|
||||||
{{ "enableDeviceVerification" | i18n }}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<small class="form-text text-muted">{{ "deviceVerificationDesc" | i18n }}</small>
|
|
||||||
</div>
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
class="btn btn-primary btn-submit"
|
|
||||||
[disabled]="form.loading"
|
|
||||||
*ngIf="isDeviceVerificationSectionEnabled"
|
|
||||||
>
|
|
||||||
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
|
|
||||||
<span>{{ "save" | i18n }}</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<ng-template #authenticatorTemplate></ng-template>
|
<ng-template #authenticatorTemplate></ng-template>
|
||||||
<ng-template #recoveryTemplate></ng-template>
|
<ng-template #recoveryTemplate></ng-template>
|
||||||
|
|||||||
@@ -3,15 +3,11 @@ import { Component, OnInit, Type, ViewChild, ViewContainerRef } from "@angular/c
|
|||||||
import { ModalRef } from "jslib-angular/components/modal/modal.ref";
|
import { ModalRef } from "jslib-angular/components/modal/modal.ref";
|
||||||
import { ModalService } from "jslib-angular/services/modal.service";
|
import { ModalService } from "jslib-angular/services/modal.service";
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
|
||||||
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
|
||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { PolicyType } from "jslib-common/enums/policyType";
|
import { PolicyType } from "jslib-common/enums/policyType";
|
||||||
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
||||||
import { DeviceVerificationRequest } from "jslib-common/models/request/DeviceVerificationRequest";
|
|
||||||
import { TwoFactorProviders } from "jslib-common/services/twoFactor.service";
|
import { TwoFactorProviders } from "jslib-common/services/twoFactor.service";
|
||||||
|
|
||||||
import { TwoFactorAuthenticatorComponent } from "./two-factor-authenticator.component";
|
import { TwoFactorAuthenticatorComponent } from "./two-factor-authenticator.component";
|
||||||
@@ -43,32 +39,18 @@ export class TwoFactorSetupComponent implements OnInit {
|
|||||||
canAccessPremium: boolean;
|
canAccessPremium: boolean;
|
||||||
showPolicyWarning = false;
|
showPolicyWarning = false;
|
||||||
loading = true;
|
loading = true;
|
||||||
enableDeviceVerification: boolean;
|
|
||||||
isDeviceVerificationSectionEnabled: boolean;
|
|
||||||
modal: ModalRef;
|
modal: ModalRef;
|
||||||
formPromise: Promise<any>;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected apiService: ApiService,
|
protected apiService: ApiService,
|
||||||
protected modalService: ModalService,
|
protected modalService: ModalService,
|
||||||
protected messagingService: MessagingService,
|
protected messagingService: MessagingService,
|
||||||
protected policyService: PolicyService,
|
protected policyService: PolicyService,
|
||||||
private stateService: StateService,
|
private stateService: StateService
|
||||||
private platformUtilsService: PlatformUtilsService,
|
|
||||||
private i18nService: I18nService,
|
|
||||||
private logService: LogService
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.canAccessPremium = await this.stateService.getCanAccessPremium();
|
this.canAccessPremium = await this.stateService.getCanAccessPremium();
|
||||||
try {
|
|
||||||
const deviceVerificationSettings = await this.apiService.getDeviceVerificationSettings();
|
|
||||||
this.isDeviceVerificationSectionEnabled =
|
|
||||||
deviceVerificationSettings.isDeviceVerificationSectionEnabled;
|
|
||||||
this.enableDeviceVerification = deviceVerificationSettings.unknownDeviceVerificationEnabled;
|
|
||||||
} catch (e) {
|
|
||||||
this.logService.error(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const key in TwoFactorProviders) {
|
for (const key in TwoFactorProviders) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
@@ -204,37 +186,4 @@ export class TwoFactorSetupComponent implements OnInit {
|
|||||||
this.showPolicyWarning = false;
|
this.showPolicyWarning = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
|
||||||
try {
|
|
||||||
if (this.enableDeviceVerification) {
|
|
||||||
const email = await this.stateService.getEmail();
|
|
||||||
const confirmed = await this.platformUtilsService.showDialog(
|
|
||||||
this.i18nService.t(
|
|
||||||
"areYouSureYouWantToEnableDeviceVerificationTheVerificationCodeEmailsWillArriveAtX",
|
|
||||||
email
|
|
||||||
),
|
|
||||||
this.i18nService.t("deviceVerification"),
|
|
||||||
this.i18nService.t("yes"),
|
|
||||||
this.i18nService.t("no"),
|
|
||||||
"warning"
|
|
||||||
);
|
|
||||||
if (!confirmed) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.formPromise = this.apiService.putDeviceVerificationSettings(
|
|
||||||
new DeviceVerificationRequest(this.enableDeviceVerification)
|
|
||||||
);
|
|
||||||
await this.formPromise;
|
|
||||||
this.platformUtilsService.showToast(
|
|
||||||
"success",
|
|
||||||
null,
|
|
||||||
this.i18nService.t("updatedDeviceVerification")
|
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
this.logService.error(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4674,8 +4674,8 @@
|
|||||||
"removeSponsorshipSuccess": {
|
"removeSponsorshipSuccess": {
|
||||||
"message": "Sponsorship Removed"
|
"message": "Sponsorship Removed"
|
||||||
},
|
},
|
||||||
"ssoKeyConnectorUnavailable": {
|
"ssoKeyConnectorError": {
|
||||||
"message": "Unable to reach the Key Connector, try again later."
|
"message": "Key Connector error: make sure Key Connector is available and working correctly."
|
||||||
},
|
},
|
||||||
"keyConnectorUrl": {
|
"keyConnectorUrl": {
|
||||||
"message": "Key Connector URL"
|
"message": "Key Connector URL"
|
||||||
@@ -5069,26 +5069,5 @@
|
|||||||
},
|
},
|
||||||
"apiAccessToken": {
|
"apiAccessToken": {
|
||||||
"message": "API Access Token"
|
"message": "API Access Token"
|
||||||
},
|
|
||||||
"deviceVerification": {
|
|
||||||
"message": "Device Verification"
|
|
||||||
},
|
|
||||||
"enableDeviceVerification": {
|
|
||||||
"message": "Enable Device Verification"
|
|
||||||
},
|
|
||||||
"deviceVerificationDesc": {
|
|
||||||
"message": "When enabled, verification codes are sent to your email address when logging in from an unrecognized device"
|
|
||||||
},
|
|
||||||
"updatedDeviceVerification": {
|
|
||||||
"message": "Updated Device Verification"
|
|
||||||
},
|
|
||||||
"areYouSureYouWantToEnableDeviceVerificationTheVerificationCodeEmailsWillArriveAtX": {
|
|
||||||
"message": "Are you sure you want to enable Device Verification? The verification code emails will arrive at: $EMAIL$",
|
|
||||||
"placeholders": {
|
|
||||||
"email": {
|
|
||||||
"content": "$1",
|
|
||||||
"example": "My Email"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,60 +204,8 @@ const devServer =
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
key: "Content-Security-Policy",
|
key: "Content-Security-Policy",
|
||||||
value: `
|
value:
|
||||||
default-src 'self';
|
"default-src 'self'; script-src 'self' 'sha256-ryoU+5+IUZTuUyTElqkrQGBJXr1brEv6r2CA62WUw8w=' https://js.stripe.com https://js.braintreegateway.com https://www.paypalobjects.com; style-src 'self' https://assets.braintreegateway.com https://*.paypal.com 'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=' 'sha256-JVRXyYPueLWdwGwY9m/7u4QlZ1xeQdqUj2t8OVIzZE4='; img-src 'self' data: https://icons.bitwarden.net https://*.paypal.com https://www.paypalobjects.com https://q.stripe.com https://haveibeenpwned.com https://www.gravatar.com; child-src 'self' https://js.stripe.com https://assets.braintreegateway.com https://*.paypal.com https://*.duosecurity.com; frame-src 'self' https://js.stripe.com https://assets.braintreegateway.com https://*.paypal.com https://*.duosecurity.com; connect-src 'self' wss://notifications.bitwarden.com https://notifications.bitwarden.com https://cdn.bitwarden.net https://api.pwnedpasswords.com https://2fa.directory/api/v3/totp.json https://api.stripe.com https://www.paypal.com https://api.braintreegateway.com https://client-analytics.braintreegateway.com https://*.braintree-api.com https://*.blob.core.windows.net https://app.simplelogin.io/api/alias/random/new https://app.anonaddy.com/api/v1/aliases; object-src 'self' blob:;",
|
||||||
script-src
|
|
||||||
'self'
|
|
||||||
'sha256-ryoU+5+IUZTuUyTElqkrQGBJXr1brEv6r2CA62WUw8w='
|
|
||||||
https://js.stripe.com
|
|
||||||
https://js.braintreegateway.com
|
|
||||||
https://www.paypalobjects.com;
|
|
||||||
style-src
|
|
||||||
'self'
|
|
||||||
https://assets.braintreegateway.com
|
|
||||||
https://*.paypal.com
|
|
||||||
'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='
|
|
||||||
'sha256-JVRXyYPueLWdwGwY9m/7u4QlZ1xeQdqUj2t8OVIzZE4=';
|
|
||||||
'sha256-0xHKHIT3+e2Gknxsm/cpErSprhL+o254L/y5bljg74U='
|
|
||||||
img-src
|
|
||||||
'self'
|
|
||||||
data:
|
|
||||||
https://icons.bitwarden.net
|
|
||||||
https://*.paypal.com
|
|
||||||
https://www.paypalobjects.com
|
|
||||||
https://q.stripe.com
|
|
||||||
https://haveibeenpwned.com
|
|
||||||
https://www.gravatar.com;
|
|
||||||
child-src
|
|
||||||
'self'
|
|
||||||
https://js.stripe.com
|
|
||||||
https://assets.braintreegateway.com
|
|
||||||
https://*.paypal.com
|
|
||||||
https://*.duosecurity.com;
|
|
||||||
frame-src
|
|
||||||
'self'
|
|
||||||
https://js.stripe.com
|
|
||||||
https://assets.braintreegateway.com
|
|
||||||
https://*.paypal.com
|
|
||||||
https://*.duosecurity.com;
|
|
||||||
connect-src
|
|
||||||
'self'
|
|
||||||
wss://notifications.bitwarden.com
|
|
||||||
https://notifications.bitwarden.com
|
|
||||||
https://cdn.bitwarden.net
|
|
||||||
https://api.pwnedpasswords.com
|
|
||||||
https://2fa.directory/api/v3/totp.json
|
|
||||||
https://api.stripe.com
|
|
||||||
https://www.paypal.com
|
|
||||||
https://api.braintreegateway.com
|
|
||||||
https://client-analytics.braintreegateway.com
|
|
||||||
https://*.braintree-api.com
|
|
||||||
https://*.blob.core.windows.net
|
|
||||||
https://app.simplelogin.io/api/alias/random/new
|
|
||||||
https://app.anonaddy.com/api/v1/aliases;
|
|
||||||
object-src
|
|
||||||
'self'
|
|
||||||
blob:;`,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user