mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
EC-265 - SCIM configuration page in org admin (#3065)
* EC-265 - Initial stubs for SCIM config UI * EC-265 - Scim config screen and plumbing * EC-265 - Scim config component works! Needs cleanup * EC-265 - Finalize scim config screen * EC-265 - Remove scim url from storage and env urls * EC-265 - Refactor to use new component library * EC-265 - Angular warnings on disabled attr resolved * EC-265 - Continued transition to new components * EC-265 - Page loading spinner pattern * EC-265 - final SCIM configuration form changes * scim cleanup * use scim urls * suggested changes * feedback fixes * remove return * Move scimUrl logic to EnvironmentService * Refactor scim url handling Co-authored-by: Kyle Spearrin <kyle.spearrin@gmail.com> Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
This commit is contained in:
@@ -25,6 +25,7 @@ export class PermissionsApi extends BaseResponse {
|
||||
managePolicies: boolean;
|
||||
manageUsers: boolean;
|
||||
manageResetPassword: boolean;
|
||||
manageScim: boolean;
|
||||
|
||||
constructor(data: any = null) {
|
||||
super(data);
|
||||
@@ -51,5 +52,6 @@ export class PermissionsApi extends BaseResponse {
|
||||
this.managePolicies = this.getResponseProperty("ManagePolicies");
|
||||
this.manageUsers = this.getResponseProperty("ManageUsers");
|
||||
this.manageResetPassword = this.getResponseProperty("ManageResetPassword");
|
||||
this.manageScim = this.getResponseProperty("ManageScim");
|
||||
}
|
||||
}
|
||||
|
||||
17
libs/common/src/models/api/scimConfigApi.ts
Normal file
17
libs/common/src/models/api/scimConfigApi.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ScimProviderType } from "@bitwarden/common/enums/scimProviderType";
|
||||
|
||||
import { BaseResponse } from "../response/baseResponse";
|
||||
|
||||
export class ScimConfigApi extends BaseResponse {
|
||||
enabled: boolean;
|
||||
scimProvider: ScimProviderType;
|
||||
|
||||
constructor(data: any) {
|
||||
super(data);
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
this.enabled = this.getResponseProperty("Enabled");
|
||||
this.scimProvider = this.getResponseProperty("ScimProvider");
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ export class OrganizationData {
|
||||
useApi: boolean;
|
||||
useSso: boolean;
|
||||
useKeyConnector: boolean;
|
||||
useScim: boolean;
|
||||
useResetPassword: boolean;
|
||||
selfHost: boolean;
|
||||
usersGetPremium: boolean;
|
||||
@@ -58,6 +59,7 @@ export class OrganizationData {
|
||||
this.useApi = response.useApi;
|
||||
this.useSso = response.useSso;
|
||||
this.useKeyConnector = response.useKeyConnector;
|
||||
this.useScim = response.useScim;
|
||||
this.useResetPassword = response.useResetPassword;
|
||||
this.selfHost = response.selfHost;
|
||||
this.usersGetPremium = response.usersGetPremium;
|
||||
|
||||
@@ -20,6 +20,7 @@ export class Organization {
|
||||
useApi: boolean;
|
||||
useSso: boolean;
|
||||
useKeyConnector: boolean;
|
||||
useScim: boolean;
|
||||
useResetPassword: boolean;
|
||||
selfHost: boolean;
|
||||
usersGetPremium: boolean;
|
||||
@@ -63,6 +64,7 @@ export class Organization {
|
||||
this.useApi = obj.useApi;
|
||||
this.useSso = obj.useSso;
|
||||
this.useKeyConnector = obj.useKeyConnector;
|
||||
this.useScim = obj.useScim;
|
||||
this.useResetPassword = obj.useResetPassword;
|
||||
this.selfHost = obj.selfHost;
|
||||
this.usersGetPremium = obj.usersGetPremium;
|
||||
@@ -173,6 +175,10 @@ export class Organization {
|
||||
return this.isAdmin || this.permissions.manageSso;
|
||||
}
|
||||
|
||||
get canManageScim() {
|
||||
return this.isAdmin || this.permissions.manageScim;
|
||||
}
|
||||
|
||||
get canManagePolicies() {
|
||||
return this.isAdmin || this.permissions.managePolicies;
|
||||
}
|
||||
@@ -207,6 +213,7 @@ export class Organization {
|
||||
(permissions.includes(Permissions.ManageUsers) && this.canManageUsers) ||
|
||||
(permissions.includes(Permissions.ManageUsersPassword) && this.canManageUsersPassword) ||
|
||||
(permissions.includes(Permissions.ManageSso) && this.canManageSso) ||
|
||||
(permissions.includes(Permissions.ManageScim) && this.canManageScim) ||
|
||||
(permissions.includes(Permissions.ManageBilling) && this.canManageBilling);
|
||||
|
||||
return specifiedPermissions && (this.enabled || this.isOwner);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { OrganizationConnectionType } from "../../enums/organizationConnectionType";
|
||||
|
||||
import { BillingSyncConfigRequest } from "./billingSyncConfigRequest";
|
||||
import { ScimConfigRequest } from "./scimConfigRequest";
|
||||
|
||||
/**API request config types for OrganizationConnectionRequest */
|
||||
export type OrganizationConnectionRequestConfigs = BillingSyncConfigRequest;
|
||||
export type OrganizationConnectionRequestConfigs = BillingSyncConfigRequest | ScimConfigRequest;
|
||||
|
||||
export class OrganizationConnectionRequest {
|
||||
constructor(
|
||||
|
||||
5
libs/common/src/models/request/scimConfigRequest.ts
Normal file
5
libs/common/src/models/request/scimConfigRequest.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ScimProviderType } from "@bitwarden/common/enums/scimProviderType";
|
||||
|
||||
export class ScimConfigRequest {
|
||||
constructor(private enabled: boolean, private scimProvider: ScimProviderType = null) {}
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
import { OrganizationConnectionType } from "../../enums/organizationConnectionType";
|
||||
import { BillingSyncConfigApi } from "../api/billingSyncConfigApi";
|
||||
import { ScimConfigApi } from "../api/scimConfigApi";
|
||||
|
||||
import { BaseResponse } from "./baseResponse";
|
||||
|
||||
/**API response config types for OrganizationConnectionResponse */
|
||||
export type OrganizationConnectionConfigApis = BillingSyncConfigApi;
|
||||
export type OrganizationConnectionConfigApis = BillingSyncConfigApi | ScimConfigApi;
|
||||
|
||||
export class OrganizationConnectionResponse<
|
||||
TConfig extends OrganizationConnectionConfigApis
|
||||
|
||||
@@ -17,6 +17,7 @@ export class ProfileOrganizationResponse extends BaseResponse {
|
||||
useApi: boolean;
|
||||
useSso: boolean;
|
||||
useKeyConnector: boolean;
|
||||
useScim: boolean;
|
||||
useResetPassword: boolean;
|
||||
selfHost: boolean;
|
||||
usersGetPremium: boolean;
|
||||
@@ -57,6 +58,7 @@ export class ProfileOrganizationResponse extends BaseResponse {
|
||||
this.useApi = this.getResponseProperty("UseApi");
|
||||
this.useSso = this.getResponseProperty("UseSso");
|
||||
this.useKeyConnector = this.getResponseProperty("UseKeyConnector") ?? false;
|
||||
this.useScim = this.getResponseProperty("UseScim") ?? false;
|
||||
this.useResetPassword = this.getResponseProperty("UseResetPassword");
|
||||
this.selfHost = this.getResponseProperty("SelfHost");
|
||||
this.usersGetPremium = this.getResponseProperty("UsersGetPremium");
|
||||
|
||||
Reference in New Issue
Block a user