Remove Business Portal, add SSO configuration models (#506)
This commit is contained in:
parent
91c5393ae7
commit
bfa9a1e1bc
|
@ -6,7 +6,6 @@ import {
|
||||||
|
|
||||||
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
import { NotificationsService } from 'jslib-common/abstractions/notifications.service';
|
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
|
@ -20,7 +19,6 @@ export class EnvironmentComponent {
|
||||||
notificationsUrl: string;
|
notificationsUrl: string;
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
showCustom = false;
|
showCustom = false;
|
||||||
enterpriseUrl: string;
|
|
||||||
|
|
||||||
constructor(protected platformUtilsService: PlatformUtilsService, protected environmentService: EnvironmentService,
|
constructor(protected platformUtilsService: PlatformUtilsService, protected environmentService: EnvironmentService,
|
||||||
protected i18nService: I18nService) {
|
protected i18nService: I18nService) {
|
||||||
|
@ -33,7 +31,6 @@ export class EnvironmentComponent {
|
||||||
this.identityUrl = urls.identity || '';
|
this.identityUrl = urls.identity || '';
|
||||||
this.iconsUrl = urls.icons || '';
|
this.iconsUrl = urls.icons || '';
|
||||||
this.notificationsUrl = urls.notifications || '';
|
this.notificationsUrl = urls.notifications || '';
|
||||||
this.enterpriseUrl = urls.enterprise || '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
|
@ -44,7 +41,6 @@ export class EnvironmentComponent {
|
||||||
webVault: this.webVaultUrl,
|
webVault: this.webVaultUrl,
|
||||||
icons: this.iconsUrl,
|
icons: this.iconsUrl,
|
||||||
notifications: this.notificationsUrl,
|
notifications: this.notificationsUrl,
|
||||||
enterprise: this.enterpriseUrl,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// re-set urls since service can change them, ex: prefixing https://
|
// re-set urls since service can change them, ex: prefixing https://
|
||||||
|
@ -54,7 +50,6 @@ export class EnvironmentComponent {
|
||||||
this.webVaultUrl = resUrls.webVault;
|
this.webVaultUrl = resUrls.webVault;
|
||||||
this.iconsUrl = resUrls.icons;
|
this.iconsUrl = resUrls.icons;
|
||||||
this.notificationsUrl = resUrls.notifications;
|
this.notificationsUrl = resUrls.notifications;
|
||||||
this.enterpriseUrl = resUrls.enterprise;
|
|
||||||
|
|
||||||
this.platformUtilsService.showToast('success', null, this.i18nService.t('environmentSaved'));
|
this.platformUtilsService.showToast('success', null, this.i18nService.t('environmentSaved'));
|
||||||
this.saved();
|
this.saved();
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { PolicyType } from '../enums/policyType';
|
import { PolicyType } from '../enums/policyType';
|
||||||
|
|
||||||
import { EnvironmentUrls } from '../models/domain/environmentUrls';
|
|
||||||
import { AttachmentRequest } from '../models/request/attachmentRequest';
|
import { AttachmentRequest } from '../models/request/attachmentRequest';
|
||||||
|
|
||||||
import { BitPayInvoiceRequest } from '../models/request/bitPayInvoiceRequest';
|
import { BitPayInvoiceRequest } from '../models/request/bitPayInvoiceRequest';
|
||||||
|
@ -30,6 +29,7 @@ import { ImportDirectoryRequest } from '../models/request/importDirectoryRequest
|
||||||
import { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';
|
import { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';
|
||||||
import { KdfRequest } from '../models/request/kdfRequest';
|
import { KdfRequest } from '../models/request/kdfRequest';
|
||||||
import { KeysRequest } from '../models/request/keysRequest';
|
import { KeysRequest } from '../models/request/keysRequest';
|
||||||
|
import { OrganizationSsoRequest } from '../models/request/organization/organizationSsoRequest';
|
||||||
import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
|
import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
|
||||||
import { OrganizationImportRequest } from '../models/request/organizationImportRequest';
|
import { OrganizationImportRequest } from '../models/request/organizationImportRequest';
|
||||||
import { OrganizationKeysRequest } from '../models/request/organizationKeysRequest';
|
import { OrganizationKeysRequest } from '../models/request/organizationKeysRequest';
|
||||||
|
@ -115,6 +115,7 @@ import { IdentityCaptchaResponse } from '../models/response/identityCaptchaRespo
|
||||||
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
||||||
import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';
|
import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';
|
||||||
import { ListResponse } from '../models/response/listResponse';
|
import { ListResponse } from '../models/response/listResponse';
|
||||||
|
import { OrganizationSsoResponse } from '../models/response/organization/organizationSsoResponse';
|
||||||
import { OrganizationAutoEnrollStatusResponse } from '../models/response/organizationAutoEnrollStatusResponse';
|
import { OrganizationAutoEnrollStatusResponse } from '../models/response/organizationAutoEnrollStatusResponse';
|
||||||
import { OrganizationKeysResponse } from '../models/response/organizationKeysResponse';
|
import { OrganizationKeysResponse } from '../models/response/organizationKeysResponse';
|
||||||
import { OrganizationResponse } from '../models/response/organizationResponse';
|
import { OrganizationResponse } from '../models/response/organizationResponse';
|
||||||
|
@ -191,7 +192,6 @@ export abstract class ApiService {
|
||||||
postAccountRecoverDelete: (request: DeleteRecoverRequest) => Promise<any>;
|
postAccountRecoverDelete: (request: DeleteRecoverRequest) => Promise<any>;
|
||||||
postAccountRecoverDeleteToken: (request: VerifyDeleteRecoverRequest) => Promise<any>;
|
postAccountRecoverDeleteToken: (request: VerifyDeleteRecoverRequest) => Promise<any>;
|
||||||
postAccountKdf: (request: KdfRequest) => Promise<any>;
|
postAccountKdf: (request: KdfRequest) => Promise<any>;
|
||||||
getEnterprisePortalSignInToken: () => Promise<string>;
|
|
||||||
postUserApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
postUserApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
||||||
postUserRotateApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
postUserRotateApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
||||||
putUpdateTempPassword: (request: UpdateTempPasswordRequest) => Promise<any>;
|
putUpdateTempPassword: (request: UpdateTempPasswordRequest) => Promise<any>;
|
||||||
|
@ -373,6 +373,7 @@ export abstract class ApiService {
|
||||||
getOrganizationLicense: (id: string, installationId: string) => Promise<any>;
|
getOrganizationLicense: (id: string, installationId: string) => Promise<any>;
|
||||||
getOrganizationTaxInfo: (id: string) => Promise<TaxInfoResponse>;
|
getOrganizationTaxInfo: (id: string) => Promise<TaxInfoResponse>;
|
||||||
getOrganizationAutoEnrollStatus: (identifier: string) => Promise<OrganizationAutoEnrollStatusResponse>;
|
getOrganizationAutoEnrollStatus: (identifier: string) => Promise<OrganizationAutoEnrollStatusResponse>;
|
||||||
|
getOrganizationSso: (id: string) => Promise<OrganizationSsoResponse>;
|
||||||
postOrganization: (request: OrganizationCreateRequest) => Promise<OrganizationResponse>;
|
postOrganization: (request: OrganizationCreateRequest) => Promise<OrganizationResponse>;
|
||||||
putOrganization: (id: string, request: OrganizationUpdateRequest) => Promise<OrganizationResponse>;
|
putOrganization: (id: string, request: OrganizationUpdateRequest) => Promise<OrganizationResponse>;
|
||||||
putOrganizationTaxInfo: (id: string, request: OrganizationTaxInfoUpdateRequest) => Promise<any>;
|
putOrganizationTaxInfo: (id: string, request: OrganizationTaxInfoUpdateRequest) => Promise<any>;
|
||||||
|
@ -381,6 +382,7 @@ export abstract class ApiService {
|
||||||
postOrganizationLicenseUpdate: (id: string, data: FormData) => Promise<any>;
|
postOrganizationLicenseUpdate: (id: string, data: FormData) => Promise<any>;
|
||||||
postOrganizationApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
postOrganizationApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
||||||
postOrganizationRotateApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
postOrganizationRotateApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
||||||
|
postOrganizationSso: (id: string, request: OrganizationSsoRequest) => Promise<OrganizationSsoResponse>;
|
||||||
postOrganizationUpgrade: (id: string, request: OrganizationUpgradeRequest) => Promise<PaymentResponse>;
|
postOrganizationUpgrade: (id: string, request: OrganizationUpgradeRequest) => Promise<PaymentResponse>;
|
||||||
postOrganizationUpdateSubscription: (id: string, request: OrganizationSubscriptionUpdateRequest) => Promise<void>;
|
postOrganizationUpdateSubscription: (id: string, request: OrganizationSubscriptionUpdateRequest) => Promise<void>;
|
||||||
postOrganizationSeat: (id: string, request: SeatRequest) => Promise<PaymentResponse>;
|
postOrganizationSeat: (id: string, request: SeatRequest) => Promise<PaymentResponse>;
|
||||||
|
|
|
@ -8,7 +8,6 @@ export type Urls = {
|
||||||
icons?: string;
|
icons?: string;
|
||||||
notifications?: string;
|
notifications?: string;
|
||||||
events?: string;
|
events?: string;
|
||||||
enterprise?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PayPalConfig = {
|
export type PayPalConfig = {
|
||||||
|
@ -21,7 +20,6 @@ export abstract class EnvironmentService {
|
||||||
|
|
||||||
hasBaseUrl: () => boolean;
|
hasBaseUrl: () => boolean;
|
||||||
getNotificationsUrl: () => string;
|
getNotificationsUrl: () => string;
|
||||||
getEnterpriseUrl: () => string;
|
|
||||||
getWebVaultUrl: () => string;
|
getWebVaultUrl: () => string;
|
||||||
getSendUrl: () => string;
|
getSendUrl: () => string;
|
||||||
getIconsUrl: () => string;
|
getIconsUrl: () => string;
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
export enum Permissions {
|
export enum Permissions {
|
||||||
AccessBusinessPortal = 0,
|
AccessEventLogs,
|
||||||
AccessEventLogs = 1,
|
AccessImportExport,
|
||||||
AccessImportExport = 2,
|
AccessReports,
|
||||||
AccessReports = 3,
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Sep 29 2021: This permission has been split out to `createNewCollections`, `editAnyCollection`, and
|
* @deprecated Sep 29 2021: This permission has been split out to `createNewCollections`, `editAnyCollection`, and
|
||||||
* `deleteAnyCollection`. It exists here for backwards compatibility with Server versions <= 1.43.0
|
* `deleteAnyCollection`. It exists here for backwards compatibility with Server versions <= 1.43.0
|
||||||
*/
|
*/
|
||||||
ManageAllCollections = 4,
|
ManageAllCollections,
|
||||||
/**
|
/**
|
||||||
* @deprecated Sep 29 2021: This permission has been split out to `editAssignedCollections` and
|
* @deprecated Sep 29 2021: This permission has been split out to `editAssignedCollections` and
|
||||||
* `deleteAssignedCollections`. It exists here for backwards compatibility with Server versions <= 1.43.0
|
* `deleteAssignedCollections`. It exists here for backwards compatibility with Server versions <= 1.43.0
|
||||||
*/
|
*/
|
||||||
ManageAssignedCollections = 5,
|
ManageAssignedCollections,
|
||||||
ManageGroups = 6,
|
ManageGroups,
|
||||||
ManageOrganization = 7,
|
ManageOrganization ,
|
||||||
ManagePolicies = 8,
|
ManagePolicies,
|
||||||
ManageProvider = 9,
|
ManageProvider,
|
||||||
ManageUsers = 10,
|
ManageUsers,
|
||||||
ManageUsersPassword = 11,
|
ManageUsersPassword,
|
||||||
CreateNewCollections = 12,
|
CreateNewCollections,
|
||||||
EditAnyCollection = 13,
|
EditAnyCollection,
|
||||||
DeleteAnyCollection = 14,
|
DeleteAnyCollection,
|
||||||
EditAssignedCollections = 15,
|
EditAssignedCollections,
|
||||||
DeleteAssignedCollections = 16,
|
DeleteAssignedCollections,
|
||||||
|
ManageSso,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { BaseResponse } from '../response/baseResponse';
|
import { BaseResponse } from '../response/baseResponse';
|
||||||
|
|
||||||
export class PermissionsApi extends BaseResponse {
|
export class PermissionsApi extends BaseResponse {
|
||||||
accessBusinessPortal: boolean;
|
|
||||||
accessEventLogs: boolean;
|
accessEventLogs: boolean;
|
||||||
accessImportExport: boolean;
|
accessImportExport: boolean;
|
||||||
accessReports: boolean;
|
accessReports: boolean;
|
||||||
|
@ -32,7 +31,6 @@ export class PermissionsApi extends BaseResponse {
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
this.accessBusinessPortal = this.getResponseProperty('AccessBusinessPortal');
|
|
||||||
this.accessEventLogs = this.getResponseProperty('AccessEventLogs');
|
this.accessEventLogs = this.getResponseProperty('AccessEventLogs');
|
||||||
this.accessImportExport = this.getResponseProperty('AccessImportExport');
|
this.accessImportExport = this.getResponseProperty('AccessImportExport');
|
||||||
this.accessReports = this.getResponseProperty('AccessReports');
|
this.accessReports = this.getResponseProperty('AccessReports');
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
import { BaseResponse } from '../response/baseResponse';
|
||||||
|
|
||||||
|
enum SsoType {
|
||||||
|
OpenIdConnect = 1,
|
||||||
|
Saml2 = 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum OpenIdConnectRedirectBehavior {
|
||||||
|
RedirectGet = 0,
|
||||||
|
FormPost = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Saml2BindingType {
|
||||||
|
HttpRedirect = 1,
|
||||||
|
HttpPost = 2,
|
||||||
|
Artifact = 4,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Saml2NameIdFormat {
|
||||||
|
NotConfigured = 0,
|
||||||
|
Unspecified = 1,
|
||||||
|
EmailAddress = 2,
|
||||||
|
X509SubjectName = 3,
|
||||||
|
WindowsDomainQualifiedName = 4,
|
||||||
|
KerberosPrincipalName = 5,
|
||||||
|
EntityIdentifier = 6,
|
||||||
|
Persistent = 7,
|
||||||
|
Transient = 8,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Saml2SigningBehavior {
|
||||||
|
IfIdpWantAuthnRequestsSigned = 0,
|
||||||
|
Always = 1,
|
||||||
|
Never = 3,
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SsoConfigApi extends BaseResponse {
|
||||||
|
configType: SsoType;
|
||||||
|
|
||||||
|
// OpenId
|
||||||
|
authority: string;
|
||||||
|
clientId: string;
|
||||||
|
clientSecret: string;
|
||||||
|
metadataAddress: string;
|
||||||
|
redirectBehavior: OpenIdConnectRedirectBehavior;
|
||||||
|
getClaimsFromUserInfoEndpoint: boolean;
|
||||||
|
additionalScopes: string;
|
||||||
|
additionalUserIdClaimTypes: string;
|
||||||
|
additionalEmailClaimTypes: string;
|
||||||
|
additionalNameClaimTypes: string;
|
||||||
|
acrValues: string;
|
||||||
|
expectedReturnAcrValue: string;
|
||||||
|
|
||||||
|
// SAML
|
||||||
|
spNameIdFormat: Saml2NameIdFormat;
|
||||||
|
spOutboundSigningAlgorithm: string;
|
||||||
|
spSigningBehavior: Saml2SigningBehavior;
|
||||||
|
spMinIncomingSigningAlgorithm: boolean;
|
||||||
|
spWantAssertionsSigned: boolean;
|
||||||
|
spValidateCertificates: boolean;
|
||||||
|
|
||||||
|
idpEntityId: string;
|
||||||
|
idpBindingType: Saml2BindingType;
|
||||||
|
idpSingleSignOnServiceUrl: string;
|
||||||
|
idpSingleLogoutServiceUrl: string;
|
||||||
|
idpArtifactResolutionServiceUrl: string;
|
||||||
|
idpX509PublicCert: string;
|
||||||
|
idpOutboundSigningAlgorithm: string;
|
||||||
|
idpAllowUnsolicitedAuthnResponse: boolean;
|
||||||
|
idpDisableOutboundLogoutRequests: boolean;
|
||||||
|
idpWantAuthnRequestsSigned: boolean;
|
||||||
|
|
||||||
|
constructor(data: any = null) {
|
||||||
|
super(data);
|
||||||
|
if (data == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.configType = this.getResponseProperty('ConfigType');
|
||||||
|
|
||||||
|
this.authority = this.getResponseProperty('Authority');
|
||||||
|
this.clientId = this.getResponseProperty('ClientId');
|
||||||
|
this.clientSecret = this.getResponseProperty('ClientSecret');
|
||||||
|
this.metadataAddress = this.getResponseProperty('MetadataAddress');
|
||||||
|
this.redirectBehavior = this.getResponseProperty('RedirectBehavior');
|
||||||
|
this.getClaimsFromUserInfoEndpoint = this.getResponseProperty('GetClaimsFromUserInfoEndpoint');
|
||||||
|
this.additionalScopes = this.getResponseProperty('AdditionalScopes');
|
||||||
|
this.additionalUserIdClaimTypes = this.getResponseProperty('AdditionalUserIdClaimTypes');
|
||||||
|
this.additionalEmailClaimTypes = this.getResponseProperty('AdditionalEmailClaimTypes');
|
||||||
|
this.additionalNameClaimTypes = this.getResponseProperty('AdditionalNameClaimTypes');
|
||||||
|
this.acrValues = this.getResponseProperty('AcrValues');
|
||||||
|
this.expectedReturnAcrValue = this.getResponseProperty('ExpectedReturnAcrValue');
|
||||||
|
|
||||||
|
this.spNameIdFormat = this.getResponseProperty('SpNameIdFormat');
|
||||||
|
this.spOutboundSigningAlgorithm = this.getResponseProperty('SpOutboundSigningAlgorithm');
|
||||||
|
this.spSigningBehavior = this.getResponseProperty('SpSigningBehavior');
|
||||||
|
this.spMinIncomingSigningAlgorithm = this.getResponseProperty('SpMinIncomingSigningAlgorithm');
|
||||||
|
this.spWantAssertionsSigned = this.getResponseProperty('SpWantAssertionsSigned');
|
||||||
|
this.spValidateCertificates = this.getResponseProperty('SpValidateCertificates');
|
||||||
|
|
||||||
|
this.idpEntityId = this.getResponseProperty('IdpEntityId');
|
||||||
|
this.idpBindingType = this.getResponseProperty('IdpBindingType');
|
||||||
|
this.idpSingleSignOnServiceUrl = this.getResponseProperty('IdpSingleSignOnServiceUrl');
|
||||||
|
this.idpSingleLogoutServiceUrl = this.getResponseProperty('IdpSingleLogoutServiceUrl');
|
||||||
|
this.idpArtifactResolutionServiceUrl = this.getResponseProperty('IdpArtifactResolutionServiceUrl');
|
||||||
|
this.idpX509PublicCert = this.getResponseProperty('IdpX509PublicCert');
|
||||||
|
this.idpOutboundSigningAlgorithm = this.getResponseProperty('IdpOutboundSigningAlgorithm');
|
||||||
|
this.idpAllowUnsolicitedAuthnResponse = this.getResponseProperty('IdpAllowUnsolicitedAuthnResponse');
|
||||||
|
this.idpDisableOutboundLogoutRequests = this.getResponseProperty('IdpDisableOutboundLogoutRequests');
|
||||||
|
this.idpWantAuthnRequestsSigned = this.getResponseProperty('IdpWantAuthnRequestsSigned');
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,7 +17,6 @@ export class OrganizationData {
|
||||||
useTotp: boolean;
|
useTotp: boolean;
|
||||||
use2fa: boolean;
|
use2fa: boolean;
|
||||||
useApi: boolean;
|
useApi: boolean;
|
||||||
useBusinessPortal: boolean;
|
|
||||||
useSso: boolean;
|
useSso: boolean;
|
||||||
useResetPassword: boolean;
|
useResetPassword: boolean;
|
||||||
selfHost: boolean;
|
selfHost: boolean;
|
||||||
|
@ -48,7 +47,6 @@ export class OrganizationData {
|
||||||
this.useTotp = response.useTotp;
|
this.useTotp = response.useTotp;
|
||||||
this.use2fa = response.use2fa;
|
this.use2fa = response.use2fa;
|
||||||
this.useApi = response.useApi;
|
this.useApi = response.useApi;
|
||||||
this.useBusinessPortal = response.useBusinessPortal;
|
|
||||||
this.useSso = response.useSso;
|
this.useSso = response.useSso;
|
||||||
this.useResetPassword = response.useResetPassword;
|
this.useResetPassword = response.useResetPassword;
|
||||||
this.selfHost = response.selfHost;
|
this.selfHost = response.selfHost;
|
||||||
|
|
|
@ -18,7 +18,6 @@ export class Organization {
|
||||||
useTotp: boolean;
|
useTotp: boolean;
|
||||||
use2fa: boolean;
|
use2fa: boolean;
|
||||||
useApi: boolean;
|
useApi: boolean;
|
||||||
useBusinessPortal: boolean;
|
|
||||||
useSso: boolean;
|
useSso: boolean;
|
||||||
useResetPassword: boolean;
|
useResetPassword: boolean;
|
||||||
selfHost: boolean;
|
selfHost: boolean;
|
||||||
|
@ -53,7 +52,6 @@ export class Organization {
|
||||||
this.useTotp = obj.useTotp;
|
this.useTotp = obj.useTotp;
|
||||||
this.use2fa = obj.use2fa;
|
this.use2fa = obj.use2fa;
|
||||||
this.useApi = obj.useApi;
|
this.useApi = obj.useApi;
|
||||||
this.useBusinessPortal = obj.useBusinessPortal;
|
|
||||||
this.useSso = obj.useSso;
|
this.useSso = obj.useSso;
|
||||||
this.useResetPassword = obj.useResetPassword;
|
this.useResetPassword = obj.useResetPassword;
|
||||||
this.selfHost = obj.selfHost;
|
this.selfHost = obj.selfHost;
|
||||||
|
@ -92,10 +90,6 @@ export class Organization {
|
||||||
return this.type === OrganizationUserType.Owner || this.isProviderUser;
|
return this.type === OrganizationUserType.Owner || this.isProviderUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
get canAccessBusinessPortal() {
|
|
||||||
return this.isAdmin || this.permissions.accessBusinessPortal;
|
|
||||||
}
|
|
||||||
|
|
||||||
get canAccessEventLogs() {
|
get canAccessEventLogs() {
|
||||||
return this.isAdmin || this.permissions.accessEventLogs;
|
return this.isAdmin || this.permissions.accessEventLogs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { SsoConfigApi } from '../../api/ssoConfigApi';
|
||||||
|
|
||||||
|
export class OrganizationSsoRequest {
|
||||||
|
enabled: boolean = false;
|
||||||
|
data: SsoConfigApi;
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { SsoConfigApi } from '../../api/ssoConfigApi';
|
||||||
|
import { BaseResponse } from '../baseResponse';
|
||||||
|
|
||||||
|
export class OrganizationSsoResponse extends BaseResponse {
|
||||||
|
enabled: boolean;
|
||||||
|
data: SsoConfigApi;
|
||||||
|
urls: SsoUrls;
|
||||||
|
|
||||||
|
constructor(response: any) {
|
||||||
|
super(response);
|
||||||
|
this.enabled = this.getResponseProperty('Enabled');
|
||||||
|
this.data = new SsoConfigApi(this.getResponseProperty('Data'));
|
||||||
|
this.urls = this.getResponseProperty('Urls');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type SsoUrls = {
|
||||||
|
callbackPath: string;
|
||||||
|
signedOutCallbackPath: string;
|
||||||
|
spEntityId: string;
|
||||||
|
spMetadataUrl: string;
|
||||||
|
spAcsUrl: string;
|
||||||
|
};
|
|
@ -14,7 +14,6 @@ export class ProfileOrganizationResponse extends BaseResponse {
|
||||||
useTotp: boolean;
|
useTotp: boolean;
|
||||||
use2fa: boolean;
|
use2fa: boolean;
|
||||||
useApi: boolean;
|
useApi: boolean;
|
||||||
useBusinessPortal: boolean;
|
|
||||||
useSso: boolean;
|
useSso: boolean;
|
||||||
useResetPassword: boolean;
|
useResetPassword: boolean;
|
||||||
selfHost: boolean;
|
selfHost: boolean;
|
||||||
|
@ -46,7 +45,6 @@ export class ProfileOrganizationResponse extends BaseResponse {
|
||||||
this.useTotp = this.getResponseProperty('UseTotp');
|
this.useTotp = this.getResponseProperty('UseTotp');
|
||||||
this.use2fa = this.getResponseProperty('Use2fa');
|
this.use2fa = this.getResponseProperty('Use2fa');
|
||||||
this.useApi = this.getResponseProperty('UseApi');
|
this.useApi = this.getResponseProperty('UseApi');
|
||||||
this.useBusinessPortal = this.getResponseProperty('UseBusinessPortal');
|
|
||||||
this.useSso = this.getResponseProperty('UseSso');
|
this.useSso = this.getResponseProperty('UseSso');
|
||||||
this.useResetPassword = this.getResponseProperty('UseResetPassword');
|
this.useResetPassword = this.getResponseProperty('UseResetPassword');
|
||||||
this.selfHost = this.getResponseProperty('SelfHost');
|
this.selfHost = this.getResponseProperty('SelfHost');
|
||||||
|
|
|
@ -14,7 +14,6 @@ export class ProfileProviderOrganizationResponse extends BaseResponse {
|
||||||
useTotp: boolean;
|
useTotp: boolean;
|
||||||
use2fa: boolean;
|
use2fa: boolean;
|
||||||
useApi: boolean;
|
useApi: boolean;
|
||||||
useBusinessPortal: boolean;
|
|
||||||
useSso: boolean;
|
useSso: boolean;
|
||||||
useResetPassword: boolean;
|
useResetPassword: boolean;
|
||||||
selfHost: boolean;
|
selfHost: boolean;
|
||||||
|
@ -46,7 +45,6 @@ export class ProfileProviderOrganizationResponse extends BaseResponse {
|
||||||
this.useTotp = this.getResponseProperty('UseTotp');
|
this.useTotp = this.getResponseProperty('UseTotp');
|
||||||
this.use2fa = this.getResponseProperty('Use2fa');
|
this.use2fa = this.getResponseProperty('Use2fa');
|
||||||
this.useApi = this.getResponseProperty('UseApi');
|
this.useApi = this.getResponseProperty('UseApi');
|
||||||
this.useBusinessPortal = this.getResponseProperty('UseBusinessPortal');
|
|
||||||
this.useSso = this.getResponseProperty('UseSso');
|
this.useSso = this.getResponseProperty('UseSso');
|
||||||
this.useResetPassword = this.getResponseProperty('UseResetPassword');
|
this.useResetPassword = this.getResponseProperty('UseResetPassword');
|
||||||
this.selfHost = this.getResponseProperty('SelfHost');
|
this.selfHost = this.getResponseProperty('SelfHost');
|
||||||
|
|
|
@ -33,6 +33,7 @@ import { ImportDirectoryRequest } from '../models/request/importDirectoryRequest
|
||||||
import { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';
|
import { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';
|
||||||
import { KdfRequest } from '../models/request/kdfRequest';
|
import { KdfRequest } from '../models/request/kdfRequest';
|
||||||
import { KeysRequest } from '../models/request/keysRequest';
|
import { KeysRequest } from '../models/request/keysRequest';
|
||||||
|
import { OrganizationSsoRequest } from '../models/request/organization/organizationSsoRequest';
|
||||||
import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
|
import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
|
||||||
import { OrganizationImportRequest } from '../models/request/organizationImportRequest';
|
import { OrganizationImportRequest } from '../models/request/organizationImportRequest';
|
||||||
import { OrganizationKeysRequest } from '../models/request/organizationKeysRequest';
|
import { OrganizationKeysRequest } from '../models/request/organizationKeysRequest';
|
||||||
|
@ -117,9 +118,11 @@ import {
|
||||||
GroupDetailsResponse,
|
GroupDetailsResponse,
|
||||||
GroupResponse,
|
GroupResponse,
|
||||||
} from '../models/response/groupResponse';
|
} from '../models/response/groupResponse';
|
||||||
|
import { IdentityCaptchaResponse } from '../models/response/identityCaptchaResponse';
|
||||||
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
||||||
import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';
|
import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';
|
||||||
import { ListResponse } from '../models/response/listResponse';
|
import { ListResponse } from '../models/response/listResponse';
|
||||||
|
import { OrganizationSsoResponse } from '../models/response/organization/organizationSsoResponse';
|
||||||
import { OrganizationAutoEnrollStatusResponse } from '../models/response/organizationAutoEnrollStatusResponse';
|
import { OrganizationAutoEnrollStatusResponse } from '../models/response/organizationAutoEnrollStatusResponse';
|
||||||
import { OrganizationKeysResponse } from '../models/response/organizationKeysResponse';
|
import { OrganizationKeysResponse } from '../models/response/organizationKeysResponse';
|
||||||
import { OrganizationResponse } from '../models/response/organizationResponse';
|
import { OrganizationResponse } from '../models/response/organizationResponse';
|
||||||
|
@ -163,7 +166,6 @@ import { ChallengeResponse } from '../models/response/twoFactorWebAuthnResponse'
|
||||||
import { TwoFactorYubiKeyResponse } from '../models/response/twoFactorYubiKeyResponse';
|
import { TwoFactorYubiKeyResponse } from '../models/response/twoFactorYubiKeyResponse';
|
||||||
import { UserKeyResponse } from '../models/response/userKeyResponse';
|
import { UserKeyResponse } from '../models/response/userKeyResponse';
|
||||||
|
|
||||||
import { IdentityCaptchaResponse } from '../models/response/identityCaptchaResponse';
|
|
||||||
import { SendAccessView } from '../models/view/sendAccessView';
|
import { SendAccessView } from '../models/view/sendAccessView';
|
||||||
|
|
||||||
export class ApiService implements ApiServiceAbstraction {
|
export class ApiService implements ApiServiceAbstraction {
|
||||||
|
@ -370,11 +372,6 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
return this.send('POST', '/accounts/kdf', request, true, false);
|
return this.send('POST', '/accounts/kdf', request, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getEnterprisePortalSignInToken(): Promise<string> {
|
|
||||||
const r = await this.send('GET', '/accounts/enterprise-portal-signin-token', null, true, true);
|
|
||||||
return r as string;
|
|
||||||
}
|
|
||||||
|
|
||||||
async deleteSsoUser(organizationId: string): Promise<any> {
|
async deleteSsoUser(organizationId: string): Promise<any> {
|
||||||
return this.send('DELETE', '/accounts/sso/' + organizationId, null, true, false);
|
return this.send('DELETE', '/accounts/sso/' + organizationId, null, true, false);
|
||||||
}
|
}
|
||||||
|
@ -1151,6 +1148,11 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
return new TaxInfoResponse(r);
|
return new TaxInfoResponse(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getOrganizationSso(id: string): Promise<OrganizationSsoResponse> {
|
||||||
|
const r = await this.send('GET', '/organizations/' + id + '/sso', null, true, true);
|
||||||
|
return new OrganizationSsoResponse(r);
|
||||||
|
}
|
||||||
|
|
||||||
async postOrganization(request: OrganizationCreateRequest): Promise<OrganizationResponse> {
|
async postOrganization(request: OrganizationCreateRequest): Promise<OrganizationResponse> {
|
||||||
const r = await this.send('POST', '/organizations', request, true, true);
|
const r = await this.send('POST', '/organizations', request, true, true);
|
||||||
return new OrganizationResponse(r);
|
return new OrganizationResponse(r);
|
||||||
|
@ -1188,6 +1190,11 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
return new ApiKeyResponse(r);
|
return new ApiKeyResponse(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async postOrganizationSso(id: string, request: OrganizationSsoRequest): Promise<OrganizationSsoResponse> {
|
||||||
|
const r = await this.send('POST', '/organizations/' + id + '/sso', request, true, true);
|
||||||
|
return new OrganizationSsoResponse(r);
|
||||||
|
}
|
||||||
|
|
||||||
async postOrganizationUpgrade(id: string, request: OrganizationUpgradeRequest): Promise<PaymentResponse> {
|
async postOrganizationUpgrade(id: string, request: OrganizationUpgradeRequest): Promise<PaymentResponse> {
|
||||||
const r = await this.send('POST', '/organizations/' + id + '/upgrade', request, true, true);
|
const r = await this.send('POST', '/organizations/' + id + '/upgrade', request, true, true);
|
||||||
return new PaymentResponse(r);
|
return new PaymentResponse(r);
|
||||||
|
|
|
@ -19,7 +19,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
||||||
private iconsUrl: string;
|
private iconsUrl: string;
|
||||||
private notificationsUrl: string;
|
private notificationsUrl: string;
|
||||||
private eventsUrl: string;
|
private eventsUrl: string;
|
||||||
private enterpriseUrl: string;
|
|
||||||
|
|
||||||
constructor(private storageService: StorageService) {}
|
constructor(private storageService: StorageService) {}
|
||||||
|
|
||||||
|
@ -39,18 +38,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
||||||
return 'https://notifications.bitwarden.com';
|
return 'https://notifications.bitwarden.com';
|
||||||
}
|
}
|
||||||
|
|
||||||
getEnterpriseUrl() {
|
|
||||||
if (this.enterpriseUrl != null) {
|
|
||||||
return this.enterpriseUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.baseUrl != null) {
|
|
||||||
return this.baseUrl + '/portal';
|
|
||||||
}
|
|
||||||
|
|
||||||
return 'https://portal.bitwarden.com';
|
|
||||||
}
|
|
||||||
|
|
||||||
getWebVaultUrl() {
|
getWebVaultUrl() {
|
||||||
if (this.webVaultUrl != null) {
|
if (this.webVaultUrl != null) {
|
||||||
return this.webVaultUrl;
|
return this.webVaultUrl;
|
||||||
|
@ -126,7 +113,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
||||||
notifications: null,
|
notifications: null,
|
||||||
events: null,
|
events: null,
|
||||||
webVault: null,
|
webVault: null,
|
||||||
enterprise: null,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const envUrls = new EnvironmentUrls();
|
const envUrls = new EnvironmentUrls();
|
||||||
|
@ -142,7 +128,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
||||||
this.iconsUrl = urls.icons;
|
this.iconsUrl = urls.icons;
|
||||||
this.notificationsUrl = urls.notifications;
|
this.notificationsUrl = urls.notifications;
|
||||||
this.eventsUrl = envUrls.events = urls.events;
|
this.eventsUrl = envUrls.events = urls.events;
|
||||||
this.enterpriseUrl = urls.enterprise;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async setUrls(urls: Urls, saveSettings: boolean = true): Promise<any> {
|
async setUrls(urls: Urls, saveSettings: boolean = true): Promise<any> {
|
||||||
|
@ -153,7 +138,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
||||||
urls.icons = this.formatUrl(urls.icons);
|
urls.icons = this.formatUrl(urls.icons);
|
||||||
urls.notifications = this.formatUrl(urls.notifications);
|
urls.notifications = this.formatUrl(urls.notifications);
|
||||||
urls.events = this.formatUrl(urls.events);
|
urls.events = this.formatUrl(urls.events);
|
||||||
urls.enterprise = this.formatUrl(urls.enterprise);
|
|
||||||
|
|
||||||
if (saveSettings) {
|
if (saveSettings) {
|
||||||
await this.storageService.save(ConstantsService.environmentUrlsKey, {
|
await this.storageService.save(ConstantsService.environmentUrlsKey, {
|
||||||
|
@ -164,7 +148,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
||||||
icons: urls.icons,
|
icons: urls.icons,
|
||||||
notifications: urls.notifications,
|
notifications: urls.notifications,
|
||||||
events: urls.events,
|
events: urls.events,
|
||||||
enterprise: urls.enterprise,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +158,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
||||||
this.iconsUrl = urls.icons;
|
this.iconsUrl = urls.icons;
|
||||||
this.notificationsUrl = urls.notifications;
|
this.notificationsUrl = urls.notifications;
|
||||||
this.eventsUrl = urls.events;
|
this.eventsUrl = urls.events;
|
||||||
this.enterpriseUrl = urls.enterprise;
|
|
||||||
|
|
||||||
this.urlsSubject.next(urls);
|
this.urlsSubject.next(urls);
|
||||||
|
|
||||||
|
@ -191,7 +173,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
||||||
icons: this.iconsUrl,
|
icons: this.iconsUrl,
|
||||||
notifications: this.notificationsUrl,
|
notifications: this.notificationsUrl,
|
||||||
events: this.eventsUrl,
|
events: this.eventsUrl,
|
||||||
enterprise: this.enterpriseUrl,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue