mirror of
https://github.com/bitwarden/web
synced 2025-12-14 15:23:14 +00:00
Compare commits
10 Commits
feature/cm
...
license-do
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db22f5dc92 | ||
|
|
bb8e982767 | ||
|
|
caad11c571 | ||
|
|
b73449159d | ||
|
|
bf48434d0f | ||
|
|
b6d2d5bf71 | ||
|
|
dfd62c7c3a | ||
|
|
41d3bd8cf2 | ||
|
|
3292d119fe | ||
|
|
b8de92435b |
4
.github/workflows/version-bump.yml
vendored
4
.github/workflows/version-bump.yml
vendored
@@ -27,13 +27,13 @@ jobs:
|
|||||||
ref: version_bump_${{ github.event.inputs.version_number }}
|
ref: version_bump_${{ github.event.inputs.version_number }}
|
||||||
|
|
||||||
- name: Bump Version - package.json
|
- name: Bump Version - package.json
|
||||||
uses: bitwarden/gh-actions/version-bump@0c263b3963211ccaf5804313c3b3a0bcc52d4b19
|
uses: bitwarden/gh-actions/version-bump@03ad9a873c39cdc95dd8d77dbbda67f84db43945
|
||||||
with:
|
with:
|
||||||
version: ${{ github.event.inputs.version_number }}
|
version: ${{ github.event.inputs.version_number }}
|
||||||
file_path: "./package.json"
|
file_path: "./package.json"
|
||||||
|
|
||||||
- name: Bump Version - package-lock.json
|
- name: Bump Version - package-lock.json
|
||||||
uses: bitwarden/gh-actions/version-bump@0c263b3963211ccaf5804313c3b3a0bcc52d4b19
|
uses: bitwarden/gh-actions/version-bump@03ad9a873c39cdc95dd8d77dbbda67f84db43945
|
||||||
with:
|
with:
|
||||||
version: ${{ github.event.inputs.version_number }}
|
version: ${{ github.event.inputs.version_number }}
|
||||||
file_path: "./package-lock.json"
|
file_path: "./package-lock.json"
|
||||||
|
|||||||
2
jslib
2
jslib
Submodule jslib updated: 462a4d7c56...54c6a4b3c3
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "bitwarden-web",
|
"name": "@bitwarden/web-vault",
|
||||||
"version": "2.25.1",
|
"version": "2.25.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "bitwarden-web",
|
"name": "@bitwarden/web-vault",
|
||||||
"version": "2.25.1",
|
"version": "2.25.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bitwarden-web",
|
"name": "@bitwarden/web-vault",
|
||||||
"version": "2.25.1",
|
"version": "2.25.1",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/bitwarden/web",
|
"repository": "https://github.com/bitwarden/web",
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import { OrganizationService } from "jslib-common/abstractions/organization.serv
|
|||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
|
||||||
import { PlanType } from "jslib-common/enums/planType";
|
import { PlanType } from "jslib-common/enums/planType";
|
||||||
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
import { ProductType } from "jslib-common/enums/productType";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-org-subscription",
|
selector: "app-org-subscription",
|
||||||
@@ -27,6 +29,7 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
adjustStorageAdd = true;
|
adjustStorageAdd = true;
|
||||||
showAdjustStorage = false;
|
showAdjustStorage = false;
|
||||||
showUpdateLicense = false;
|
showUpdateLicense = false;
|
||||||
|
canDownloadLicense = false;
|
||||||
showDownloadLicense = false;
|
showDownloadLicense = false;
|
||||||
showChangePlan = false;
|
showChangePlan = false;
|
||||||
sub: OrganizationSubscriptionResponse;
|
sub: OrganizationSubscriptionResponse;
|
||||||
@@ -42,6 +45,7 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
private apiService: ApiService,
|
private apiService: ApiService,
|
||||||
private platformUtilsService: PlatformUtilsService,
|
private platformUtilsService: PlatformUtilsService,
|
||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
|
private stateService: StateService,
|
||||||
private messagingService: MessagingService,
|
private messagingService: MessagingService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private organizationService: OrganizationService,
|
private organizationService: OrganizationService,
|
||||||
@@ -66,6 +70,13 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.userOrg = await this.organizationService.get(this.organizationId);
|
this.userOrg = await this.organizationService.get(this.organizationId);
|
||||||
this.sub = await this.apiService.getOrganizationSubscription(this.organizationId);
|
this.sub = await this.apiService.getOrganizationSubscription(this.organizationId);
|
||||||
|
|
||||||
|
const orgs = await this.stateService.getOrganizations();
|
||||||
|
const isAllowedOrgType = Object.values(orgs).some(org => org.planProductType === (ProductType.Enterprise | ProductType.Families));
|
||||||
|
const canDownload = (this.sub.planType !== PlanType.Free && this.subscription == null) ||
|
||||||
|
(this.subscription != null && !this.subscription.cancelled);
|
||||||
|
this.canDownloadLicense = canDownload && isAllowedOrgType;
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,14 +215,22 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get subscriptionMarkedForCancel() {
|
get subscriptionMarkedForCancel() {
|
||||||
return (
|
return (
|
||||||
this.subscription != null && !this.subscription.cancelled && this.subscription.cancelAtEndDate
|
this.subscription != null && !this.subscription.cancelled && this.subscription.cancelAtEndDate
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get subscription() {
|
get subscription() {
|
||||||
return this.sub != null ? this.sub.subscription : null;
|
const now = new Date();
|
||||||
|
const fiveDays = now.setDate(now.getDate() + 5);
|
||||||
|
if(this.sub === null) return null;
|
||||||
|
if(this.sub.subscription == null) {
|
||||||
|
this.sub.subscription = ({ cancelled: true, cancelAtEndDate: (fiveDays as any)} as any);
|
||||||
|
this.sub.subscription.items = new Array({sponsoredSubscriptionItem: false} as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.sub.subscription;
|
||||||
}
|
}
|
||||||
|
|
||||||
get nextInvoice() {
|
get nextInvoice() {
|
||||||
@@ -257,13 +276,6 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
return this.sub.subscription?.items.some((i) => i.sponsoredSubscriptionItem);
|
return this.sub.subscription?.items.some((i) => i.sponsoredSubscriptionItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
get canDownloadLicense() {
|
|
||||||
return (
|
|
||||||
(this.sub.planType !== PlanType.Free && this.subscription == null) ||
|
|
||||||
(this.subscription != null && !this.subscription.cancelled)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
get subscriptionDesc() {
|
get subscriptionDesc() {
|
||||||
if (this.sub.planType === PlanType.Free) {
|
if (this.sub.planType === PlanType.Free) {
|
||||||
return this.i18nService.t("subscriptionFreePlan", this.sub.seats.toString());
|
return this.i18nService.t("subscriptionFreePlan", this.sub.seats.toString());
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { ToastrModule } from "ngx-toastr";
|
|||||||
import { BroadcasterMessagingService } from "../../services/broadcasterMessaging.service";
|
import { BroadcasterMessagingService } from "../../services/broadcasterMessaging.service";
|
||||||
import { HtmlStorageService } from "../../services/htmlStorage.service";
|
import { HtmlStorageService } from "../../services/htmlStorage.service";
|
||||||
import { I18nService } from "../../services/i18n.service";
|
import { I18nService } from "../../services/i18n.service";
|
||||||
import { KeyConnectorService } from "../../services/keyConnector.service";
|
|
||||||
import { MemoryStorageService } from "../../services/memoryStorage.service";
|
import { MemoryStorageService } from "../../services/memoryStorage.service";
|
||||||
import { PasswordRepromptService } from "../../services/passwordReprompt.service";
|
import { PasswordRepromptService } from "../../services/passwordReprompt.service";
|
||||||
import { StateService } from "../../services/state.service";
|
import { StateService } from "../../services/state.service";
|
||||||
@@ -41,7 +40,6 @@ import { EventService as EventLoggingServiceAbstraction } from "jslib-common/abs
|
|||||||
import { FolderService as FolderServiceAbstraction } from "jslib-common/abstractions/folder.service";
|
import { FolderService as FolderServiceAbstraction } from "jslib-common/abstractions/folder.service";
|
||||||
import { I18nService as I18nServiceAbstraction } from "jslib-common/abstractions/i18n.service";
|
import { I18nService as I18nServiceAbstraction } from "jslib-common/abstractions/i18n.service";
|
||||||
import { ImportService as ImportServiceAbstraction } from "jslib-common/abstractions/import.service";
|
import { ImportService as ImportServiceAbstraction } from "jslib-common/abstractions/import.service";
|
||||||
import { KeyConnectorService as KeyConnectorServiceAbstraction } from "jslib-common/abstractions/keyConnector.service";
|
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { MessagingService as MessagingServiceAbstraction } from "jslib-common/abstractions/messaging.service";
|
import { MessagingService as MessagingServiceAbstraction } from "jslib-common/abstractions/messaging.service";
|
||||||
import { NotificationsService as NotificationsServiceAbstraction } from "jslib-common/abstractions/notifications.service";
|
import { NotificationsService as NotificationsServiceAbstraction } from "jslib-common/abstractions/notifications.service";
|
||||||
@@ -54,6 +52,10 @@ import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-com
|
|||||||
|
|
||||||
import { ThemeType } from "jslib-common/enums/themeType";
|
import { ThemeType } from "jslib-common/enums/themeType";
|
||||||
|
|
||||||
|
import { AccountFactory } from "jslib-common/models/domain/account";
|
||||||
|
|
||||||
|
import { Account } from "../../models/account";
|
||||||
|
|
||||||
export function initFactory(
|
export function initFactory(
|
||||||
window: Window,
|
window: Window,
|
||||||
storageService: StorageServiceAbstraction,
|
storageService: StorageServiceAbstraction,
|
||||||
@@ -180,7 +182,19 @@ export function initFactory(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
provide: StateServiceAbstraction,
|
provide: StateServiceAbstraction,
|
||||||
useClass: StateService,
|
useFactory: (
|
||||||
|
storageService: StorageServiceAbstraction,
|
||||||
|
secureStorageService: StorageServiceAbstraction,
|
||||||
|
logService: LogService,
|
||||||
|
stateMigrationService: StateMigrationServiceAbstraction
|
||||||
|
) =>
|
||||||
|
new StateService(
|
||||||
|
storageService,
|
||||||
|
secureStorageService,
|
||||||
|
logService,
|
||||||
|
stateMigrationService,
|
||||||
|
new AccountFactory(Account)
|
||||||
|
),
|
||||||
deps: [
|
deps: [
|
||||||
StorageServiceAbstraction,
|
StorageServiceAbstraction,
|
||||||
"SECURE_STORAGE",
|
"SECURE_STORAGE",
|
||||||
@@ -192,10 +206,6 @@ export function initFactory(
|
|||||||
provide: PasswordRepromptServiceAbstraction,
|
provide: PasswordRepromptServiceAbstraction,
|
||||||
useClass: PasswordRepromptService,
|
useClass: PasswordRepromptService,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
provide: KeyConnectorServiceAbstraction,
|
|
||||||
useClass: KeyConnectorService,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class ServicesModule {}
|
export class ServicesModule {}
|
||||||
|
|||||||
@@ -587,6 +587,7 @@
|
|||||||
id="idEmail"
|
id="idEmail"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text"
|
type="text"
|
||||||
|
inputmode="email"
|
||||||
name="Identity.Email"
|
name="Identity.Email"
|
||||||
[(ngModel)]="cipher.identity.email"
|
[(ngModel)]="cipher.identity.email"
|
||||||
appInputVerbatim
|
appInputVerbatim
|
||||||
@@ -599,6 +600,7 @@
|
|||||||
id="idPhone"
|
id="idPhone"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text"
|
type="text"
|
||||||
|
inputmode="tel"
|
||||||
name="Identity.Phone"
|
name="Identity.Phone"
|
||||||
[(ngModel)]="cipher.identity.phone"
|
[(ngModel)]="cipher.identity.phone"
|
||||||
[disabled]="cipher.isDeleted || viewOnly"
|
[disabled]="cipher.isDeleted || viewOnly"
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta
|
|
||||||
name="viewport"
|
|
||||||
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
|
|
||||||
/>
|
|
||||||
<title>Bitwarden CME Connector</title>
|
|
||||||
</head>
|
|
||||||
<body></body>
|
|
||||||
</html>
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
import { KeyConnectorUserKeyResponse } from "jslib-common/models/response/keyConnectorUserKeyResponse";
|
|
||||||
import { b64Decode, getQsParam } from "./common";
|
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
|
||||||
init();
|
|
||||||
});
|
|
||||||
|
|
||||||
let parentUrl: string = null;
|
|
||||||
let parentOrigin: string = null;
|
|
||||||
let sentSuccess = false;
|
|
||||||
|
|
||||||
async function init() {
|
|
||||||
await start();
|
|
||||||
onMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function start() {
|
|
||||||
sentSuccess = false;
|
|
||||||
|
|
||||||
const data = getQsParam("data");
|
|
||||||
if (!data) {
|
|
||||||
error("No data.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
parentUrl = getQsParam("parent");
|
|
||||||
if (!parentUrl) {
|
|
||||||
error("No parent.");
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
parentUrl = decodeURIComponent(parentUrl);
|
|
||||||
parentOrigin = new URL(parentUrl).origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
let decodedData: any;
|
|
||||||
try {
|
|
||||||
decodedData = JSON.parse(b64Decode(data));
|
|
||||||
} catch (e) {
|
|
||||||
error("Cannot parse data.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const keyConnectorUrl = new URL(decodedData.url);
|
|
||||||
const bearerAccessToken = decodedData.token;
|
|
||||||
const operation = decodedData.operation;
|
|
||||||
const key = decodedData.key;
|
|
||||||
|
|
||||||
if (keyConnectorUrl.hostname === "vault.bitwarden.com") {
|
|
||||||
error("Invalid hostname.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (operation === "get") {
|
|
||||||
const getRequest = new Request(keyConnectorUrl.href + "user-keys", {
|
|
||||||
cache: "no-store",
|
|
||||||
method: "GET",
|
|
||||||
headers: new Headers({
|
|
||||||
Accept: "application/json",
|
|
||||||
Authorization: "Bearer " + bearerAccessToken,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
getRequest.headers.set("Cache-Control", "no-store");
|
|
||||||
getRequest.headers.set("Pragma", "no-cache");
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(getRequest);
|
|
||||||
if (response.status !== 200) {
|
|
||||||
throw new Error();
|
|
||||||
}
|
|
||||||
success(new KeyConnectorUserKeyResponse(await response.json()));
|
|
||||||
} catch {
|
|
||||||
error("Error getting key");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else if (operation === "post") {
|
|
||||||
const postRequest = new Request(keyConnectorUrl.href + "user-keys", {
|
|
||||||
cache: "no-store",
|
|
||||||
method: "POST",
|
|
||||||
headers: new Headers({
|
|
||||||
Accept: "application/json",
|
|
||||||
Authorization: "Bearer " + bearerAccessToken,
|
|
||||||
"Content-Type": "application/json; charset=utf-8",
|
|
||||||
}),
|
|
||||||
body: JSON.stringify({ key: key }),
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(postRequest);
|
|
||||||
if (response.status !== 200) {
|
|
||||||
throw new Error();
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
error("Error posting key");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
success(null);
|
|
||||||
} else {
|
|
||||||
// TODO: put operation
|
|
||||||
error("Unsupported operation.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onMessage() {
|
|
||||||
window.addEventListener(
|
|
||||||
"message",
|
|
||||||
(event) => {
|
|
||||||
if (!event.origin || event.origin === "" || event.origin !== parentOrigin) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.data === "start") {
|
|
||||||
start();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
false
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function error(message: string) {
|
|
||||||
parent.postMessage("error|" + message, parentUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
function success(response: KeyConnectorUserKeyResponse) {
|
|
||||||
if (sentSuccess) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
parent.postMessage(
|
|
||||||
"success|" + (response != null && response.key != null ? response.key : ""),
|
|
||||||
parentUrl
|
|
||||||
);
|
|
||||||
sentSuccess = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function info(message: string | object) {
|
|
||||||
parent.postMessage("info|" + JSON.stringify(message), parentUrl);
|
|
||||||
}
|
|
||||||
@@ -3445,7 +3445,7 @@
|
|||||||
"message": "Αποσύνδεση SSO"
|
"message": "Αποσύνδεση SSO"
|
||||||
},
|
},
|
||||||
"unlinkSsoConfirmation": {
|
"unlinkSsoConfirmation": {
|
||||||
"message": "Are you sure you want to unlink SSO for this organization?"
|
"message": "Είστε βέβαιοι ότι θέλετε να αποσυνδέσετε το SSO για αυτόν τον οργανισμό;"
|
||||||
},
|
},
|
||||||
"linkSso": {
|
"linkSso": {
|
||||||
"message": "Σύνδεσμος SSO"
|
"message": "Σύνδεσμος SSO"
|
||||||
|
|||||||
@@ -3164,7 +3164,7 @@
|
|||||||
"description": "A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing."
|
"description": "A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing."
|
||||||
},
|
},
|
||||||
"dontAskFingerprintAgain": {
|
"dontAskFingerprintAgain": {
|
||||||
"message": "Don't ask to verify fingerprint phrase again",
|
"message": "Never prompt to verify fingerprint phrases for invited users (Not recommended)",
|
||||||
"description": "A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing."
|
"description": "A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing."
|
||||||
},
|
},
|
||||||
"free": {
|
"free": {
|
||||||
|
|||||||
@@ -2078,7 +2078,7 @@
|
|||||||
"message": "Samodzielnie hostowane środowisko (opcjonalnie)"
|
"message": "Samodzielnie hostowane środowisko (opcjonalnie)"
|
||||||
},
|
},
|
||||||
"usersGetPremium": {
|
"usersGetPremium": {
|
||||||
"message": "Użytkownicy uzyskują dostęp do funkcji Premium"
|
"message": "Użytkownicy uzyskują dostęp do kont Premium"
|
||||||
},
|
},
|
||||||
"controlAccessWithGroups": {
|
"controlAccessWithGroups": {
|
||||||
"message": "Kontroluj dostęp z użyciem grup użytkowników"
|
"message": "Kontroluj dostęp z użyciem grup użytkowników"
|
||||||
@@ -4504,7 +4504,7 @@
|
|||||||
"message": "Plan Bitwarden Families zawiera"
|
"message": "Plan Bitwarden Families zawiera"
|
||||||
},
|
},
|
||||||
"sponsoredFamiliesPremiumAccess": {
|
"sponsoredFamiliesPremiumAccess": {
|
||||||
"message": "Dostęp premium dla maksymalnie 6 użytkowników"
|
"message": "Konto Premium dla maksymalnie 6 użytkowników"
|
||||||
},
|
},
|
||||||
"sponsoredFamiliesSharedCollections": {
|
"sponsoredFamiliesSharedCollections": {
|
||||||
"message": "Udostępnione kolekcje dla sekretów rodziny"
|
"message": "Udostępnione kolekcje dla sekretów rodziny"
|
||||||
@@ -4597,7 +4597,7 @@
|
|||||||
"message": "Utworzono sponsorowanie"
|
"message": "Utworzono sponsorowanie"
|
||||||
},
|
},
|
||||||
"revoke": {
|
"revoke": {
|
||||||
"message": "Odwołaj"
|
"message": "Unieważnij"
|
||||||
},
|
},
|
||||||
"emailSent": {
|
"emailSent": {
|
||||||
"message": "Wiadomość została wysłana"
|
"message": "Wiadomość została wysłana"
|
||||||
|
|||||||
@@ -30,12 +30,6 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cme_iframe {
|
|
||||||
border: none;
|
|
||||||
height: 0;
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-group-2fa {
|
.list-group-2fa {
|
||||||
.logo-2fa {
|
.logo-2fa {
|
||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
|
|||||||
@@ -1,105 +0,0 @@
|
|||||||
import { Injectable } from "@angular/core";
|
|
||||||
|
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
|
||||||
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
|
||||||
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
|
|
||||||
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
|
||||||
import { OrganizationService } from "jslib-common/abstractions/organization.service";
|
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
|
||||||
import { TokenService } from "jslib-common/abstractions/token.service";
|
|
||||||
|
|
||||||
import { CMEIFrame } from "jslib-common/misc/cme_iframe";
|
|
||||||
import { KeyConnectorUserKeyRequest } from "jslib-common/models/request/keyConnectorUserKeyRequest";
|
|
||||||
import { KeyConnectorUserKeyResponse } from "jslib-common/models/response/keyConnectorUserKeyResponse";
|
|
||||||
|
|
||||||
import { KeyConnectorService as BaseKeyConnectorService } from "jslib-common/services/keyConnector.service";
|
|
||||||
|
|
||||||
@Injectable()
|
|
||||||
export class KeyConnectorService extends BaseKeyConnectorService {
|
|
||||||
constructor(
|
|
||||||
stateService: StateService,
|
|
||||||
cryptoFunctionService: CryptoFunctionService,
|
|
||||||
cryptoService: CryptoService,
|
|
||||||
apiService: ApiService,
|
|
||||||
tokenService: TokenService,
|
|
||||||
logService: LogService,
|
|
||||||
organizationService: OrganizationService,
|
|
||||||
private environmentService: EnvironmentService,
|
|
||||||
private platformUtilsService: PlatformUtilsService
|
|
||||||
) {
|
|
||||||
super(
|
|
||||||
stateService,
|
|
||||||
cryptoFunctionService,
|
|
||||||
cryptoService,
|
|
||||||
apiService,
|
|
||||||
tokenService,
|
|
||||||
logService,
|
|
||||||
organizationService
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async getUserKeyFromKeyConnector(url: string): Promise<KeyConnectorUserKeyResponse> {
|
|
||||||
if (this.platformUtilsService.isSelfHost()) {
|
|
||||||
return super.getUserKeyFromKeyConnector(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
const frame = this.createIframe();
|
|
||||||
frame.frame.initGet(await this.apiService.getActiveBearerToken(), url);
|
|
||||||
|
|
||||||
return frame.promise.then((key: string) => new KeyConnectorUserKeyResponse({ Key: key }));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async postUserKeyToKeyConnector(
|
|
||||||
url: string,
|
|
||||||
request: KeyConnectorUserKeyRequest
|
|
||||||
): Promise<void> {
|
|
||||||
if (this.platformUtilsService.isSelfHost()) {
|
|
||||||
return super.postUserKeyToKeyConnector(url, request);
|
|
||||||
}
|
|
||||||
|
|
||||||
const frame = this.createIframe();
|
|
||||||
frame.frame.initPost(await this.apiService.getActiveBearerToken(), url, request.key);
|
|
||||||
|
|
||||||
// tslint:disable-next-line
|
|
||||||
return frame.promise.then(() => {});
|
|
||||||
}
|
|
||||||
|
|
||||||
private createIframe(): { frame: CMEIFrame; promise: Promise<string> } {
|
|
||||||
const el = this.createIframeElement();
|
|
||||||
|
|
||||||
const webVaultUrl = this.environmentService.getWebVaultUrl();
|
|
||||||
|
|
||||||
let iframe: CMEIFrame;
|
|
||||||
|
|
||||||
const promise: Promise<string> = new Promise(async (resolve) => {
|
|
||||||
iframe = new CMEIFrame(
|
|
||||||
window,
|
|
||||||
webVaultUrl,
|
|
||||||
resolve,
|
|
||||||
(error: string) => {
|
|
||||||
this.platformUtilsService.showToast("error", null, error);
|
|
||||||
},
|
|
||||||
(info: string) => {
|
|
||||||
this.logService.info(info);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
promise.finally(() => el.remove());
|
|
||||||
|
|
||||||
return {
|
|
||||||
frame: iframe,
|
|
||||||
promise: promise,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private createIframeElement() {
|
|
||||||
const el = document.createElement("iframe");
|
|
||||||
el.id = "cme_iframe";
|
|
||||||
document.body.appendChild(el);
|
|
||||||
|
|
||||||
return el;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
"extends": "./jslib/shared/tsconfig",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"moduleResolution": "node",
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"module": "commonjs",
|
|
||||||
"target": "es2015",
|
|
||||||
"lib": ["es5", "es6", "dom"],
|
|
||||||
"sourceMap": true,
|
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"tldjs": ["jslib/common/src/misc/tldjs.noop"],
|
"tldjs": ["jslib/common/src/misc/tldjs.noop"],
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const moduleRules = [
|
|||||||
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
|
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
|
||||||
exclude: /loading(|-white).svg/,
|
exclude: /loading(|-white).svg/,
|
||||||
generator: {
|
generator: {
|
||||||
filename: "fonts/[name].[ext]",
|
filename: "fonts/[name][ext]",
|
||||||
},
|
},
|
||||||
type: "asset/resource",
|
type: "asset/resource",
|
||||||
},
|
},
|
||||||
@@ -39,7 +39,7 @@ const moduleRules = [
|
|||||||
test: /\.(jpe?g|png|gif|svg|webp|avif)$/i,
|
test: /\.(jpe?g|png|gif|svg|webp|avif)$/i,
|
||||||
exclude: /.*(fontawesome-webfont)\.svg/,
|
exclude: /.*(fontawesome-webfont)\.svg/,
|
||||||
generator: {
|
generator: {
|
||||||
filename: "images/[name].[ext]",
|
filename: "images/[name][ext]",
|
||||||
},
|
},
|
||||||
type: "asset/resource",
|
type: "asset/resource",
|
||||||
},
|
},
|
||||||
@@ -112,11 +112,6 @@ const plugins = [
|
|||||||
filename: "captcha-mobile-connector.html",
|
filename: "captcha-mobile-connector.html",
|
||||||
chunks: ["connectors/captcha"],
|
chunks: ["connectors/captcha"],
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
template: "./src/connectors/cme.html",
|
|
||||||
filename: "cme-connector.html",
|
|
||||||
chunks: ["connectors/cme"],
|
|
||||||
}),
|
|
||||||
new CopyWebpackPlugin({
|
new CopyWebpackPlugin({
|
||||||
patterns: [
|
patterns: [
|
||||||
{ from: "./src/.nojekyll" },
|
{ from: "./src/.nojekyll" },
|
||||||
@@ -226,7 +221,6 @@ const webpackConfig = {
|
|||||||
"connectors/duo": "./src/connectors/duo.ts",
|
"connectors/duo": "./src/connectors/duo.ts",
|
||||||
"connectors/sso": "./src/connectors/sso.ts",
|
"connectors/sso": "./src/connectors/sso.ts",
|
||||||
"connectors/captcha": "./src/connectors/captcha.ts",
|
"connectors/captcha": "./src/connectors/captcha.ts",
|
||||||
"connectors/cme": "./src/connectors/cme.ts",
|
|
||||||
theme_head: "./src/theme.js",
|
theme_head: "./src/theme.js",
|
||||||
},
|
},
|
||||||
externals: {
|
externals: {
|
||||||
|
|||||||
Reference in New Issue
Block a user