mirror of
https://github.com/bitwarden/web
synced 2025-12-06 00:03:28 +00:00
Compare commits
2 Commits
mono-repo
...
feat/expan
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ec8b61efc | ||
|
|
d7a4d3f538 |
@@ -19,8 +19,8 @@ jobs:
|
||||
name: Setup
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
release_version: ${{ steps.version.outputs.version }}
|
||||
tag_version: ${{ steps.version.outputs.version }}
|
||||
release_version: ${{ steps.version.outputs.package }}
|
||||
tag_version: ${{ steps.version.outputs.tag }}
|
||||
branch_name: ${{ steps.branch.outputs.branch_name }}
|
||||
steps:
|
||||
- name: Branch check
|
||||
@@ -38,11 +38,20 @@ jobs:
|
||||
|
||||
- name: Check Release Version
|
||||
id: version
|
||||
uses: bitwarden/gh-actions/release-version-check@ea9fab01d76940267b4147cc1c4542431246b9f6
|
||||
with:
|
||||
release-type: ${{ github.event.inputs.release_type }}
|
||||
project-type: ts
|
||||
file: package.json
|
||||
run: |
|
||||
version=$( jq -r ".version" package.json)
|
||||
previous_release_tag_version=$(
|
||||
curl -sL https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r ".tag_name"
|
||||
)
|
||||
|
||||
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
|
||||
id: branch
|
||||
0
apps/web/.gitignore → .gitignore
vendored
0
apps/web/.gitignore → .gitignore
vendored
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -0,0 +1,4 @@
|
||||
[submodule "jslib"]
|
||||
path = jslib
|
||||
url = https://github.com/bitwarden/jslib.git
|
||||
branch = master
|
||||
|
||||
0
apps/web/.husky/pre-commit → .husky/pre-commit
Normal file → Executable file
0
apps/web/.husky/pre-commit → .husky/pre-commit
Normal file → Executable file
@@ -2,7 +2,7 @@
|
||||
build
|
||||
dist
|
||||
|
||||
#jslib
|
||||
jslib
|
||||
|
||||
# External libraries / auto synced locales
|
||||
src/locales
|
||||
@@ -1,59 +0,0 @@
|
||||
<div
|
||||
class="modal fade"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="enrollMasterPasswordResetTitle"
|
||||
>
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<form
|
||||
class="modal-content"
|
||||
#form
|
||||
(ngSubmit)="submit()"
|
||||
[appApiAction]="formPromise"
|
||||
ngNativeValidate
|
||||
>
|
||||
<div class="modal-header">
|
||||
<h2 class="modal-title" id="enrollMasterPasswordResetTitle">
|
||||
{{ (isEnrolled ? "withdrawPasswordReset" : "enrollPasswordReset") | i18n }}
|
||||
</h2>
|
||||
<button
|
||||
type="button"
|
||||
class="close"
|
||||
data-dismiss="modal"
|
||||
appA11yTitle="{{ 'close' | i18n }}"
|
||||
>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<app-callout type="warning" *ngIf="!isEnrolled">
|
||||
{{ "resetPasswordEnrollmentWarning" | i18n }}
|
||||
</app-callout>
|
||||
<app-user-verification [(ngModel)]="verification" name="secret"> </app-user-verification>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button bitButton buttonType="primary" type="submit" [disabled]="form.loading">
|
||||
<i
|
||||
class="bwi bwi-spinner bwi-spin"
|
||||
title="{{ 'loading' | i18n }}"
|
||||
*ngIf="form.loading"
|
||||
></i>
|
||||
<span>
|
||||
{{ "submit" | i18n }}
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
bitButton
|
||||
buttonType="secondary"
|
||||
type="button"
|
||||
data-dismiss="modal"
|
||||
appA11yTitle="{{ 'close' | i18n }}"
|
||||
>
|
||||
<span>
|
||||
{{ "cancel" | i18n }}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,97 +0,0 @@
|
||||
import { Component } from "@angular/core";
|
||||
|
||||
import { ModalRef } from "jslib-angular/components/modal/modal.ref";
|
||||
import { ModalConfig } from "jslib-angular/services/modal.service";
|
||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||
import { LogService } from "jslib-common/abstractions/log.service";
|
||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||
import { SyncService } from "jslib-common/abstractions/sync.service";
|
||||
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
||||
import { Utils } from "jslib-common/misc/utils";
|
||||
import { Organization } from "jslib-common/models/domain/organization";
|
||||
import { OrganizationUserResetPasswordEnrollmentRequest } from "jslib-common/models/request/organizationUserResetPasswordEnrollmentRequest";
|
||||
import { Verification } from "jslib-common/types/verification";
|
||||
|
||||
@Component({
|
||||
selector: "app-enroll-master-password-reset",
|
||||
templateUrl: "enroll-master-password-reset.component.html",
|
||||
})
|
||||
export class EnrollMasterPasswordReset {
|
||||
organization: Organization;
|
||||
|
||||
verification: Verification;
|
||||
formPromise: Promise<any>;
|
||||
|
||||
constructor(
|
||||
private userVerificationService: UserVerificationService,
|
||||
private apiService: ApiService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: I18nService,
|
||||
private cryptoService: CryptoService,
|
||||
private syncService: SyncService,
|
||||
private logService: LogService,
|
||||
private modalRef: ModalRef,
|
||||
config: ModalConfig
|
||||
) {
|
||||
this.organization = config.data.organization;
|
||||
}
|
||||
|
||||
async submit() {
|
||||
let toastStringRef = "withdrawPasswordResetSuccess";
|
||||
|
||||
this.formPromise = this.userVerificationService
|
||||
.buildRequest(this.verification, OrganizationUserResetPasswordEnrollmentRequest)
|
||||
.then(async (request) => {
|
||||
// Set variables
|
||||
let keyString: string = null;
|
||||
|
||||
// Enrolling
|
||||
if (!this.organization.resetPasswordEnrolled) {
|
||||
// Retrieve Public Key
|
||||
const orgKeys = await this.apiService.getOrganizationKeys(this.organization.id);
|
||||
if (orgKeys == null) {
|
||||
throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));
|
||||
}
|
||||
|
||||
const publicKey = Utils.fromB64ToArray(orgKeys.publicKey);
|
||||
|
||||
// RSA Encrypt user's encKey.key with organization public key
|
||||
const encKey = await this.cryptoService.getEncKey();
|
||||
const encryptedKey = await this.cryptoService.rsaEncrypt(encKey.key, publicKey.buffer);
|
||||
keyString = encryptedKey.encryptedString;
|
||||
toastStringRef = "enrollPasswordResetSuccess";
|
||||
|
||||
// Create request and execute enrollment
|
||||
request.resetPasswordKey = keyString;
|
||||
await this.apiService.putOrganizationUserResetPasswordEnrollment(
|
||||
this.organization.id,
|
||||
this.organization.userId,
|
||||
request
|
||||
);
|
||||
} else {
|
||||
// Withdrawal
|
||||
request.resetPasswordKey = keyString;
|
||||
await this.apiService.putOrganizationUserResetPasswordEnrollment(
|
||||
this.organization.id,
|
||||
this.organization.userId,
|
||||
request
|
||||
);
|
||||
}
|
||||
|
||||
await this.syncService.fullSync(true);
|
||||
});
|
||||
try {
|
||||
await this.formPromise;
|
||||
this.platformUtilsService.showToast("success", null, this.i18nService.t(toastStringRef));
|
||||
this.modalRef.close();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
get isEnrolled(): boolean {
|
||||
return this.organization.resetPasswordEnrolled;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { ScrollingModule } from "@angular/cdk/scrolling";
|
||||
import { NgModule } from "@angular/core";
|
||||
|
||||
import { LooseComponentsModule } from "../../loose-components.module";
|
||||
import { SharedModule } from "../../shared.module";
|
||||
|
||||
import { EnrollMasterPasswordReset } from "./enroll-master-password-reset.component";
|
||||
|
||||
@NgModule({
|
||||
imports: [SharedModule, ScrollingModule, LooseComponentsModule],
|
||||
declarations: [EnrollMasterPasswordReset],
|
||||
exports: [EnrollMasterPasswordReset],
|
||||
})
|
||||
export class OrganizationUserModule {}
|
||||
@@ -1,3 +0,0 @@
|
||||
import { VaultFilterService as BaseVaultFilterService } from "jslib-angular/modules/vault-filter/vault-filter.service";
|
||||
|
||||
export class VaultFilterService extends BaseVaultFilterService {}
|
||||
@@ -22,16 +22,14 @@ const routes: Routes = [
|
||||
component: ManageComponent,
|
||||
canActivate: [PermissionsGuard],
|
||||
data: {
|
||||
permissions: NavigationPermissionsService.getPermissions("manage"),
|
||||
permissions: NavigationPermissionsService.getPermissions("manage").concat(
|
||||
Permissions.ManageSso
|
||||
),
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "sso",
|
||||
component: SsoComponent,
|
||||
canActivate: [PermissionsGuard],
|
||||
data: {
|
||||
permissions: [Permissions.ManageSso],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -15,4 +15,3 @@ files:
|
||||
en-GB: en_GB
|
||||
en-IN: en_IN
|
||||
sr-CY: sr_CY
|
||||
sr-CS: sr_CS
|
||||
1
jslib
Submodule
1
jslib
Submodule
Submodule jslib added at 65584c6496
4
apps/web/package-lock.json → package-lock.json
generated
4
apps/web/package-lock.json → package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@bitwarden/web-vault",
|
||||
"version": "2022.05.0",
|
||||
"version": "2.28.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@bitwarden/web-vault",
|
||||
"version": "2022.05.0",
|
||||
"version": "2.28.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@bitwarden/web-vault",
|
||||
"version": "2022.05.0",
|
||||
"version": "2.28.1",
|
||||
"license": "GPL-3.0",
|
||||
"repository": "https://github.com/bitwarden/web",
|
||||
"scripts": {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user