From 3eb2d06074ea1901521c7b7dcb557fa9b3899dec Mon Sep 17 00:00:00 2001 From: Louis Bompart Date: Tue, 17 Aug 2021 16:01:20 -0400 Subject: [PATCH] revert(ui): add better message when user doesn't have permission (#436) This reverts commit 2f2f986fe11554c554e45bb44d8b5745d9d9fc79. Co-authored-by: Yassine CDX-541 --- packages/cli/package-lock.json | 69 --- .../@coveord+platform-client+24.1.0.patch | 452 ------------------ .../src/commands/ui/create/angular.spec.ts | 35 +- .../cli/src/commands/ui/create/angular.ts | 4 +- .../cli/src/commands/ui/create/react.spec.ts | 36 +- packages/cli/src/commands/ui/create/react.ts | 4 +- .../cli/src/commands/ui/create/vue.spec.ts | 40 +- packages/cli/src/commands/ui/create/vue.ts | 4 +- .../preconditions/apiKeyPrivilege.spec.ts | 84 ---- .../preconditions/apiKeyPrivilege.ts | 89 ---- .../src/lib/decorators/preconditions/index.ts | 1 - 11 files changed, 19 insertions(+), 799 deletions(-) delete mode 100644 packages/cli/patches/@coveord+platform-client+24.1.0.patch delete mode 100644 packages/cli/src/lib/decorators/preconditions/apiKeyPrivilege.spec.ts delete mode 100644 packages/cli/src/lib/decorators/preconditions/apiKeyPrivilege.ts diff --git a/packages/cli/package-lock.json b/packages/cli/package-lock.json index 9a6f0be981..f2cbd5250e 100644 --- a/packages/cli/package-lock.json +++ b/packages/cli/package-lock.json @@ -105,25 +105,6 @@ } } }, - "@angular/cdk": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-12.2.1.tgz", - "integrity": "sha512-UOzuDXcfaJlBd+o7EJb6CZ3my1AmU7XHriC/hFT6bFianhVK/I/0gcOwxyMx8VAplEip8msLczX0IlZSJ1GCCg==", - "dev": true, - "requires": { - "parse5": "^5.0.0", - "tslib": "^2.2.0" - }, - "dependencies": { - "parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", - "dev": true, - "optional": true - } - } - }, "@angular/cli": { "version": "12.1.1", "resolved": "http://localhost:4873/@angular%2fcli/-/cli-12.1.1.tgz", @@ -3612,32 +3593,11 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "@coveo/angular": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@coveo/angular/-/angular-1.13.0.tgz", - "integrity": "sha512-f8V8b1Nus1kqip336P2WYFZQqV/9Mtd2LyoJvUZTLa7CclbUGz/42PCNZkBMF3zdkFY8fHrW4h2bbNov+8C8VQ==", - "dev": true, - "requires": { - "@angular-devkit/core": "^12.1.1", - "@angular-devkit/schematics": "^12.1.1", - "@angular/cdk": "^12.1.1", - "@angular/cli": "^12.1.1", - "@coveo/search-token-server": "^1.13.0", - "@schematics/angular": "^12.1.1", - "typescript": "^4.3.5" - } - }, "@coveo/bueno": { "version": "0.32.3", "resolved": "https://registry.npmjs.org/@coveo/bueno/-/bueno-0.32.3.tgz", "integrity": "sha512-MMHuH2zFU5OTIos7f1zNg2cPkTOVtM/Mzy1OmrgGuqT7eVnxyijdv5BtbPB573b4Xn4c588hvuXPKneNPaQAjg==" }, - "@coveo/cra-template": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@coveo/cra-template/-/cra-template-1.13.0.tgz", - "integrity": "sha512-0XrPj0CtZGh3eskAiLOHprAJMbOd8O6i68twBm3zHNUqyU8uQw8BNhSS2l34O3wsvUWSIiWAeiN8dlGvMQLCPQ==", - "dev": true - }, "@coveo/push-api-client": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@coveo/push-api-client/-/push-api-client-1.1.2.tgz", @@ -3672,29 +3632,6 @@ } } }, - "@coveo/search-token-server": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@coveo/search-token-server/-/search-token-server-1.13.0.tgz", - "integrity": "sha512-BR6alMiSJ++YdAuwh8+sV9gScggvGTP0Vp4j6wuqx1CGIcgU4P10U+/9qhikp4Df1Z0orX0YEjFoBd+HImoq0Q==", - "dev": true, - "requires": { - "@coveord/platform-client": "^24.1.0", - "@types/express": "^4.17.11", - "abortcontroller-polyfill": "^1.7.1", - "cors": "^2.8.5", - "dotenv": "^10.0.0", - "express": "^4.17.1", - "isomorphic-fetch": "^3.0.0", - "ts-node": "^10.0.0", - "typescript": "^4.1.5" - } - }, - "@coveo/vue-cli-plugin-typescript": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@coveo/vue-cli-plugin-typescript/-/vue-cli-plugin-typescript-1.13.0.tgz", - "integrity": "sha512-15bgiGT04mxGfP7NjZDtOOdYDAv90rzN6WLtaIhcq4sHL2Q7fTxprbp7zISkg9mBWOVMJ9EuHPY9pWi4H+Enjw==", - "dev": true - }, "@coveord/platform-client": { "version": "24.1.0", "resolved": "https://registry.npmjs.org/@coveord/platform-client/-/platform-client-24.1.0.tgz", @@ -8754,12 +8691,6 @@ } } }, - "dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", - "dev": true - }, "download": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/download/-/download-7.1.0.tgz", diff --git a/packages/cli/patches/@coveord+platform-client+24.1.0.patch b/packages/cli/patches/@coveord+platform-client+24.1.0.patch deleted file mode 100644 index fe01204bfe..0000000000 --- a/packages/cli/patches/@coveord+platform-client+24.1.0.patch +++ /dev/null @@ -1,452 +0,0 @@ -diff --git a/node_modules/@coveord/platform-client/.DS_Store b/node_modules/@coveord/platform-client/.DS_Store -new file mode 100644 -index 0000000..1599ef4 -Binary files /dev/null and b/node_modules/@coveord/platform-client/.DS_Store differ -diff --git a/node_modules/@coveord/platform-client/dist/.DS_Store b/node_modules/@coveord/platform-client/dist/.DS_Store -new file mode 100644 -index 0000000..1c80207 -Binary files /dev/null and b/node_modules/@coveord/platform-client/dist/.DS_Store differ -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/BaseInterfaces.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/BaseInterfaces.d.ts -index a218c51..bf0341f 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/BaseInterfaces.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/BaseInterfaces.d.ts -@@ -10,9 +10,25 @@ export interface IdAndDisplayNameModel { - displayName?: string; - } - export interface PrivilegeModel { -- owner: string; -- targetDomain: string; -+ /** -+ * The owner of the privilege. -+ * See [Valid Privilege owner, targetDomain, and type Combinations](https://docs.coveo.com/en/159/). -+ */ -+ owner?: string; -+ /** -+ * The target domain of the privilege. -+ * See [Valid Privilege owner, targetDomain, and type Combinations](https://docs.coveo.com/en/159/). -+ */ -+ targetDomain?: string; -+ /** -+ * The `displayName` of the source targeted by the privilege. -+ * Note: The wildcard character (`*`) will include all sources. -+ */ - targetId?: string; -+ /** -+ * The type of the privilege. -+ * See [Valid Privilege owner, targetDomain, and type Combinations](https://docs.coveo.com/en/159/). -+ */ - type?: string; - } - export interface GranularResource { -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/GlobalGroups/GlobalGroupInterfaces.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/GlobalGroups/GlobalGroupInterfaces.d.ts -index 0ab99ed..2e590fd 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/GlobalGroups/GlobalGroupInterfaces.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/GlobalGroups/GlobalGroupInterfaces.d.ts -@@ -10,7 +10,10 @@ export interface GlobalGroupModel { - temporaryPrivilegeConfigurations: TemporaryPrivilegeConfigurationModel[]; - } - export interface GlobalPrivilegeModel extends PrivilegeModel { -- level: string; -+ /** -+ * The access level of the global privileges. -+ */ -+ level?: string; - } - export interface TemporaryPrivilegeConfigurationModel { - approbationType: 'AUTO_APPROVED' | 'DENIED'; -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Conditions/Condition.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Conditions/Condition.d.ts -index 2dfd150..f7b4d93 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Conditions/Condition.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Conditions/Condition.d.ts -@@ -1,9 +1,9 @@ -+import { PageModel } from '../../BaseInterfaces'; - import Resource from '../../Resource'; --import { StatementModelList } from '../Statements'; - import { ConditionModel, ListConditionsOptions, NewConditionModel } from './ConditionInterfaces'; - export default class Condition extends Resource { - static baseUrl: string; -- list(options?: ListConditionsOptions): Promise; -+ list(options?: ListConditionsOptions): Promise>; - create(conditionModel: NewConditionModel): Promise; - delete(conditionId: string): Promise>; - get(conditionId: string): Promise; -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/MLAssociations/MLAssociations.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/MLAssociations/MLAssociations.d.ts -index 1cfcf0a..e574cfd 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/MLAssociations/MLAssociations.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/MLAssociations/MLAssociations.d.ts -@@ -1,8 +1,9 @@ -+import { PageModel } from '../../BaseInterfaces'; - import Resource from '../../Resource'; --import { AssociatedPipelinesData, AssociationsListModel, CreateAssociation, EditAssociation, ListAssociationsParams, MLAssociationModel } from './MLAssociationsInterfaces'; -+import { AssociatedPipelinesData, CreateAssociation, EditAssociation, ListAssociationsParams, MLAssociationModel } from './MLAssociationsInterfaces'; - export default class MLAssociations extends Resource { - static getBaseUrl: (pipelineId: string) => string; -- list(pipelineId: string, options?: ListAssociationsParams): Promise; -+ list(pipelineId: string, options?: ListAssociationsParams): Promise>; - associate(pipelineId: string, options: CreateAssociation): Promise>; - getAssociation(pipelineId: string, associationId: string): Promise; - disassociate(pipelineId: string, associationId: string): Promise>; -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/MLAssociations/MLAssociationsInterfaces.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/MLAssociations/MLAssociationsInterfaces.d.ts -index 5ff48bc..91241ae 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/MLAssociations/MLAssociationsInterfaces.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/MLAssociations/MLAssociationsInterfaces.d.ts -@@ -1,4 +1,7 @@ - import { ModelTypes } from '../../Enums'; -+/** -+ * @deprecated - Use `PageModel` instead. -+ */ - export interface AssociationsListModel { - rules: MLAssociationModel[]; - totalEntries: number; -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Statements/Statements.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Statements/Statements.d.ts -index b5e2f5b..8b82bbd 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Statements/Statements.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Statements/Statements.d.ts -@@ -1,15 +1,16 @@ -+import { PageModel } from '../../BaseInterfaces'; - import Resource from '../../Resource'; --import { CopyStatementModel, CreateStatementModel, ExportStatementParams, ListStatementParams, MoveStatementModel, StatementModel, StatementModelList } from './StatementsInterfaces'; -+import { CopyStatementModel, CreateStatementModel, ExportStatementParams, ListStatementParams, MoveStatementModel, StatementModel } from './StatementsInterfaces'; - export default class Statements extends Resource { - static getBaseUrl: (pipelineId: string) => string; - static getStatementUrl: (pipelineId: string, statementId: string) => string; -- list(pipelineId: string, options?: ListStatementParams): Promise; -+ list(pipelineId: string, options?: ListStatementParams): Promise>; - exportCSV(pipelineId: string, options?: ExportStatementParams): Promise; - importCSV(pipelineId: string, csvFile: File | string, options?: ExportStatementParams): Promise>; - create(pipelineId: string, model: CreateStatementModel): Promise; - update(pipelineId: string, statementId: string, model: CreateStatementModel): Promise; -- copy(pipelineId: string, model: CopyStatementModel): Promise; -+ copy(pipelineId: string, model: CopyStatementModel): Promise>; - get(pipelineId: string, statementId: string): Promise; -- move(pipelineId: string, statementId: string, model: MoveStatementModel): Promise; -+ move(pipelineId: string, statementId: string, model: MoveStatementModel): Promise>; - delete(pipelineId: string, statementId: string): Promise>; - } -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Statements/StatementsInterfaces.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Statements/StatementsInterfaces.d.ts -index cd2a109..bba8b52 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Statements/StatementsInterfaces.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/Pipelines/Statements/StatementsInterfaces.d.ts -@@ -30,6 +30,9 @@ export interface CopyStatementModel { - statementIds: string[]; - destinationPipelineId: string; - } -+/** -+ * @deprecated - Use `PageModel` instead. -+ */ - export interface StatementModelList { - statements: StatementModel[]; - totalEntries: number; -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/PlatformResources.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/PlatformResources.d.ts -index a424809..cc7bce0 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/PlatformResources.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/PlatformResources.d.ts -@@ -23,6 +23,7 @@ import ModifierTemplates from './ModifierTemplates/ModifierTemplates'; - import Notifications from './Notification/notification'; - import Organization from './Organizations/Organization'; - import Pipelines from './Pipelines/Pipelines'; -+import PrivilegeEvaluator from './PrivilegeEvaluator/PrivilegeEvaluator'; - import PushApi from './PushApi/PushApi'; - import ResourceSnapshots from './ResourceSnapshots/ResourceSnapshots'; - import Saml from './Saml/Saml'; -@@ -74,6 +75,7 @@ declare class PlatformResources { - ua: UsageAnalytics; - user: User; - notification: Notifications; -+ privilegeEvaluator: PrivilegeEvaluator; - registerAll(): void; - } - export default PlatformResources; -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/PrivilegeEvaluator/PrivilegeEvaluator.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/PrivilegeEvaluator/PrivilegeEvaluator.d.ts -new file mode 100644 -index 0000000..4a09b96 ---- /dev/null -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/PrivilegeEvaluator/PrivilegeEvaluator.d.ts -@@ -0,0 +1,12 @@ -+import Ressource from '../Resource'; -+import { PrivilegeEvaluatorModel } from './PrivilegeEvaluatorInterfaces'; -+export default class PrivilegeEvaluator extends Ressource { -+ static baseUrl: string; -+ /** -+ * Evaluates a specific privilege request -+ * -+ * @param {RestTokenParams} tokenParams -+ * @returns -+ */ -+ evaluate(privilegeEvaluatorParams: PrivilegeEvaluatorModel): Promise; -+} -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.d.ts -new file mode 100644 -index 0000000..00fdf69 ---- /dev/null -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.d.ts -@@ -0,0 +1,29 @@ -+import { GlobalPrivilegeModel } from '../GlobalGroups'; -+export interface PrivilegeEvaluatorModel { -+ /** -+ * Whether the request has been approved. -+ */ -+ approved?: boolean; -+ /** -+ * A privilege request evaluation report. -+ */ -+ evaluationReport?: PrivilegeRequestEvaluationReportModel; -+ /** -+ * The unique identifier of the organization in which the target privilege applies. -+ */ -+ organizationId?: string; -+ /** -+ * The unique identifier of the organization in which the target privilege applies. -+ */ -+ requestedPrivilege: GlobalPrivilegeModel; -+} -+export declare enum PrivilegeRequestEvaluationReportModel { -+ operationForbiddenForAnonymousAuthentication = "OPERATION_FORBIDDEN_FOR_ANONYMOUS_AUTHENTICATION", -+ operationForbiddenForAuthenticationBoundToDifferentOrganization = "OPERATION_FORBIDDEN_FOR_AUTHENTICATION_BOUND_TO_DIFFERENT_ORGANIZATION", -+ operationForbiddenForOrganization = "OPERATION_FORBIDDEN_FOR_ORGANIZATION", -+ operationForbiddenForOrganizationInReadOnly = "OPERATION_FORBIDDEN_FOR_ORGANIZATION_IN_READ_ONLY", -+ operationForbiddenFromRequestLocation = "OPERATION_FORBIDDEN_FROM_REQUEST_LOCATION", -+ operationForbiddenInvalidPrivilegeRequest = "OPERATION_FORBIDDEN_INVALID_PRIVILEGE_REQUEST", -+ operationGranted = "OPERATION_GRANTED", -+ operationNotAllowed = "OPERATION_NOT_ALLOWED" -+} -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/PrivilegeEvaluator/index.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/PrivilegeEvaluator/index.d.ts -new file mode 100644 -index 0000000..916cf16 ---- /dev/null -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/PrivilegeEvaluator/index.d.ts -@@ -0,0 +1,2 @@ -+export * from './PrivilegeEvaluator'; -+export * from './PrivilegeEvaluatorInterfaces'; -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/SchemaService/SchemaServiceInterfaces.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/SchemaService/SchemaServiceInterfaces.d.ts -index 5d703dd..db8a089 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/SchemaService/SchemaServiceInterfaces.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/SchemaService/SchemaServiceInterfaces.d.ts -@@ -76,13 +76,17 @@ export interface GetEntitiesQueryParams extends SchemaServiceQueryParams { - offset?: number; - /** - * The number of entities to fetch -- * (user for server-side pagination) -+ * (used for server-side pagination) - */ - limit?: number; - /** - * A query to fetch matching entity names and ids - */ - query?: string; -+ /** -+ * IDs of the entities to retrieve, as a comma-separated list -+ */ -+ entityIds?: string; - } - export interface GetEntityQueryParams extends SchemaServiceQueryParams { - /** -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/Sources/SourcesInterfaces.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/Sources/SourcesInterfaces.d.ts -index 419ed21..20a6296 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/Sources/SourcesInterfaces.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/Sources/SourcesInterfaces.d.ts -@@ -5,6 +5,7 @@ import { MappingModel } from './SourcesMappings'; - export interface SourceModel extends GranularResource { - configurationError?: ConfigurationError; - crawlingModuleId?: string; -+ pendingCrawlingModuleId?: string; - customParameters?: Record; - id?: string; - information?: SourceInformation; -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/UsageAnalytics/Read/Dimensions/DimensionsInterfaces.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/UsageAnalytics/Read/Dimensions/DimensionsInterfaces.d.ts -index db1bc00..b273c3d 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/UsageAnalytics/Read/Dimensions/DimensionsInterfaces.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/UsageAnalytics/Read/Dimensions/DimensionsInterfaces.d.ts -@@ -42,8 +42,18 @@ export interface CustomDimensionSuggestionModel { - values?: string[]; - } - export interface CustomDimensionModel { -+ /** -+ * The type of the dimension. -+ */ - type: DimensionType; -+ /** -+ * The display name of the dimension. Should be human readable. -+ */ - displayName: string; -+ /** -+ * Strings that correspond to the path that must be followed to fetch the desired value of the dimension in the custom_datas map. -+ */ -+ path?: string[]; - } - export interface ListDimensionsParams { - org?: string; -diff --git a/node_modules/@coveord/platform-client/dist/definitions/resources/index.d.ts b/node_modules/@coveord/platform-client/dist/definitions/resources/index.d.ts -index 138d248..6569a40 100644 ---- a/node_modules/@coveord/platform-client/dist/definitions/resources/index.d.ts -+++ b/node_modules/@coveord/platform-client/dist/definitions/resources/index.d.ts -@@ -35,3 +35,4 @@ export * from './Notification'; - export * from './Connectivity'; - export * from './SearchInterfaces'; - export * from './ModifierTemplates'; -+export * from './PrivilegeEvaluator'; -diff --git a/node_modules/@coveord/platform-client/dist/resources/Pipelines/Conditions/Condition.js.map b/node_modules/@coveord/platform-client/dist/resources/Pipelines/Conditions/Condition.js.map -index 03dbdd7..f477c56 100644 ---- a/node_modules/@coveord/platform-client/dist/resources/Pipelines/Conditions/Condition.js.map -+++ b/node_modules/@coveord/platform-client/dist/resources/Pipelines/Conditions/Condition.js.map -@@ -1 +1 @@ --{"version":3,"file":"Condition.js","sourceRoot":"","sources":["../../../../src/resources/Pipelines/Conditions/Condition.ts"],"names":[],"mappings":";;;AAAA,oEAAsC;AAItC;IAAuC,qCAAQ;IAA/C;;IAkCA,CAAC;IA/BG,wBAAI,GAAJ,UAAK,OAAmC;QAAnC,wBAAA,EAAA,YAAmC;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,qBAAG,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,IAAK,OAAO,EAAE,CAC5G,CAAC;IACN,CAAC;IAED,0BAAM,GAAN,UAAO,cAAiC;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAChB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,EAC5E,cAAc,CACjB,CAAC;IACN,CAAC;IAED,0BAAM,GAAN,UAAO,WAAmB;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAClB,IAAI,CAAC,SAAS,CAAI,SAAS,CAAC,OAAO,SAAI,WAAa,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,CACnG,CAAC;IACN,CAAC;IAED,uBAAG,GAAH,UAAI,WAAmB;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAI,SAAS,CAAC,OAAO,SAAI,WAAa,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,CACnG,CAAC;IACN,CAAC;IAED,0BAAM,GAAN,UAAO,WAAmB,EAAE,cAAkD;QAC1E,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAI,SAAS,CAAC,OAAO,SAAI,WAAa,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,EAChG,cAAc,CACjB,CAAC;IACN,CAAC;IAhCM,iBAAO,GAAG,4CAA4C,CAAC;IAiClE,gBAAC;CAAA,AAlCD,CAAuC,kBAAQ,GAkC9C;kBAlCoB,SAAS"} -\ No newline at end of file -+{"version":3,"file":"Condition.js","sourceRoot":"","sources":["../../../../src/resources/Pipelines/Conditions/Condition.ts"],"names":[],"mappings":";;;AACA,oEAAsC;AAGtC;IAAuC,qCAAQ;IAA/C;;IAkCA,CAAC;IA/BG,wBAAI,GAAJ,UAAK,OAAmC;QAAnC,wBAAA,EAAA,YAAmC;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,qBAAG,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,IAAK,OAAO,EAAE,CAC5G,CAAC;IACN,CAAC;IAED,0BAAM,GAAN,UAAO,cAAiC;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAChB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,EAC5E,cAAc,CACjB,CAAC;IACN,CAAC;IAED,0BAAM,GAAN,UAAO,WAAmB;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAClB,IAAI,CAAC,SAAS,CAAI,SAAS,CAAC,OAAO,SAAI,WAAa,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,CACnG,CAAC;IACN,CAAC;IAED,uBAAG,GAAH,UAAI,WAAmB;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAI,SAAS,CAAC,OAAO,SAAI,WAAa,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,CACnG,CAAC;IACN,CAAC;IAED,0BAAM,GAAN,UAAO,WAAmB,EAAE,cAAkD;QAC1E,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAI,SAAS,CAAC,OAAO,SAAI,WAAa,EAAE,EAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAC,CAAC,EAChG,cAAc,CACjB,CAAC;IACN,CAAC;IAhCM,iBAAO,GAAG,4CAA4C,CAAC;IAiClE,gBAAC;CAAA,AAlCD,CAAuC,kBAAQ,GAkC9C;kBAlCoB,SAAS"} -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/Pipelines/MLAssociations/MLAssociations.js.map b/node_modules/@coveord/platform-client/dist/resources/Pipelines/MLAssociations/MLAssociations.js.map -index afcb0c6..2f282b9 100644 ---- a/node_modules/@coveord/platform-client/dist/resources/Pipelines/MLAssociations/MLAssociations.js.map -+++ b/node_modules/@coveord/platform-client/dist/resources/Pipelines/MLAssociations/MLAssociations.js.map -@@ -1 +1 @@ --{"version":3,"file":"MLAssociations.js","sourceRoot":"","sources":["../../../../src/resources/Pipelines/MLAssociations/MLAssociations.ts"],"names":[],"mappings":";;;AAAA,oEAAsC;AAUtC;IAA4C,0CAAQ;IAApD;;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AAC,GAAG,CAAC,cAAc;SAC1C,CAAC,EACF,OAAO,CACV,CAAC;IACN,CAAC;IAED,uCAAc,GAAd,UAAe,UAAkB,EAAE,aAAqB,EAAE,QAAgB;QACtE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAI,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,SAAI,aAAa,cAAW,EAAE;YACjF,QAAQ,UAAA;YACR,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc;SAC1C,CAAC,EACF,EAAE,CACL,CAAC;IACN,CAAC;IAED,+CAAsB,GAAtB;QACI,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,uDAAuD,EAAE;YACpE,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc;SAC1C,CAAC,CACL,CAAC;IACN,CAAC;IAxDM,yBAAU,GAAG,UAAC,UAAkB,IAAK,OAAA,qCAAmC,UAAU,2BAAwB,EAArE,CAAqE,CAAC;IAyDtH,qBAAC;CAAA,AA1DD,CAA4C,kBAAQ,GA0DnD;kBA1DoB,cAAc"} -\ No newline at end of file -+{"version":3,"file":"MLAssociations.js","sourceRoot":"","sources":["../../../../src/resources/Pipelines/MLAssociations/MLAssociations.ts"],"names":[],"mappings":";;;AACA,oEAAsC;AAStC;IAA4C,0CAAQ;IAApD;;IA0DA,CAAC;IAvDG,6BAAI,GAAJ,UAAK,UAAkB,EAAE,OAAgC;QACrD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,qBAAG,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,IAAK,OAAO,EAAE,CAC/G,CAAC;IACN,CAAC;IAED,kCAAS,GAAT,UAAU,UAAkB,EAAE,OAA0B;QACpD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAChB,IAAI,CAAC,SA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C;IAED,+CAAsB,GAAtB;QACI,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,uDAAuD,EAAE;YACpE,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc;SAC1C,CAAC,CACL,CAAC;IACN,CAAC;IAxDM,yBAAU,GAAG,UAAC,UAAkB,IAAK,OAAA,qCAAmC,UAAU,2BAAwB,EAArE,CAAqE,CAAC;IAyDtH,qBAAC;CAAA,AA1DD,CAA4C,kBAAQ,GA0DnD;kBA1DoB,cAAc"} -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/Pipelines/Statements/Statements.js.map b/node_modules/@coveord/platform-client/dist/resources/Pipelines/Statements/Statements.js.map -index 61776a4..e141374 100644 ---- a/node_modules/@coveord/platform-client/dist/resources/Pipelines/Statements/Statements.js.map -+++ b/node_modules/@coveord/platform-client/dist/resources/Pipelines/Statements/Statements.js.map -@@ -1 +1 @@ --{"version":3,"file":"Statements.js","sourceRoot":"","sources":["../../../../src/resources/Pipelines/Statements/Statements.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,oEAAsC;AAWtC;IAAwC,sCAAQ;IAAhD;;IAkFA,CAAC;IA7EG,yBAAI,GAAJ,UAAK,UAAkB,EAAE,OAA6B;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,qBAAG,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,IAAK,OAAO,EAAE,CAC3G,CAAC;IACN,CAAC;IAED,8BAAS,GAAT,UAAU,UAAkB,EAAE,OAA+B;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CACnB,IAAI,CAAC,SAAS,CAAI,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,YAAS,qBACxD,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,IACpC,OAAO,EACZ,C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EACF,KAAK,CACR,CAAC;IACN,CAAC;IAED,2BAAM,GAAN,UAAO,UAAkB,EAAE,WAAmB;QAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAClB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE;YAChE,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc;SAC1C,CAAC,CACL,CAAC;IACN,CAAC;IAhFM,qBAAU,GAAG,UAAC,UAAkB,IAAK,OAAA,qCAAmC,UAAU,gBAAa,EAA1D,CAA0D,CAAC;IAChG,0BAAe,GAAG,UAAC,UAAkB,EAAE,WAAmB;QAC7D,OAAG,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,SAAI,WAAa;IAArD,CAAqD,CAAC;IA+E9D,iBAAC;CAAA,AAlFD,CAAwC,kBAAQ,GAkF/C;kBAlFoB,UAAU"} -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/PlatformResources.js b/node_modules/@coveord/platform-client/dist/resources/PlatformResources.js -index 341c003..3e8e7c3 100644 ---- a/node_modules/@coveord/platform-client/dist/resources/PlatformResources.js -+++ b/node_modules/@coveord/platform-client/dist/resources/PlatformResources.js -@@ -25,6 +25,7 @@ var ModifierTemplates_1 = tslib_1.__importDefault(require("./ModifierTemplates/M - var notification_1 = tslib_1.__importDefault(require("./Notification/notification")); - var Organization_1 = tslib_1.__importDefault(require("./Organizations/Organization")); - var Pipelines_1 = tslib_1.__importDefault(require("./Pipelines/Pipelines")); -+var PrivilegeEvaluator_1 = tslib_1.__importDefault(require("./PrivilegeEvaluator/PrivilegeEvaluator")); - var PushApi_1 = tslib_1.__importDefault(require("./PushApi/PushApi")); - var ResourceSnapshots_1 = tslib_1.__importDefault(require("./ResourceSnapshots/ResourceSnapshots")); - var Saml_1 = tslib_1.__importDefault(require("./Saml/Saml")); -@@ -74,6 +75,7 @@ var resourcesMap = [ - { key: 'ua', resource: UsageAnalytics_1.default }, - { key: 'user', resource: User_1.default }, - { key: 'notification', resource: notification_1.default }, -+ { key: 'privilegeEvaluator', resource: PrivilegeEvaluator_1.default }, - ]; - var PlatformResources = /** @class */ (function () { - function PlatformResources() { -diff --git a/node_modules/@coveord/platform-client/dist/resources/PlatformResources.js.map b/node_modules/@coveord/platform-client/dist/resources/PlatformResources.js.map -index 7a93197..9d51240 100644 ---- a/node_modules/@coveord/platform-client/dist/resources/PlatformResources.js.map -+++ b/node_modules/@coveord/platform-client/dist/resources/PlatformResources.js.map -@@ -1 +1 @@ --{"version":3,"file":"PlatformResources.js","sourceRoot":"","sources":["../../src/resources/PlatformResources.ts"],"names":[],"mappings":";;;AACA,sEAAuC;AACvC,0DAA4B;AAC5B,kGAAoE;AACpE,uEAAyC;AACzC,iGAAmE;AACnE,uEAAyC;AACzC,qFAAuD;AACvD,2FAA6D;AAC7D,+EAAiD;AACjD,mEAAoC;AACpC,mEAAqC;AACrC,mFAAqD;AACrD,mEAAoC;AACpC,sEAAsC;AACtC,6GAA+E;AAC/E,sEAAwC;AACxC,mEAAqC;AACrC,gEAAkC;AAClC,6DAA+B;AAC/B,8FAAgE;AAChE,oGAAsE;AACtE,qFAAwD;AACxD,sFAAwD;AACxD,4EAA8C;AAC9C,sEAAwC;AAExC,oGAAsE;AACtE,6DAA+B;AAC/B,wFAA0D;AAC1D,mEAAqC;AACrC,iGAAmE;AACnE,kFAAoD;AACpD,uGAAyE;AACzE,wFAA0D;AAC1D,sEAAwC;AACxC,2FAA6D;AAC7D,8DAAgC;AAEhC,IAAM,YAAY,GAAoD;IAClE,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAM,EAAC;IACjC,EAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAG,EAAC;IAC3B,EAAC,GAAG,EAAE,kBAAkB,EAAE,QAAQ,EAAE,0BAAgB,EAAC;IACrD,EAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAO,EAAC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GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAW,EAAC;IAC3C,EAAC,GAAG,EAAE,oBAAoB,EAAE,QAAQ,EAAE,4BAAkB,EAAC;IACzD,EAAC,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,uBAAa,EAAC;IAC/C,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAO,EAAC;IAClC,EAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,wBAAc,EAAC;IACrC,EAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAI,EAAC;IAC7B,EAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAa,EAAC;IAC9C,EAAC,GAAG,EAAE,oBAAoB,EAAE,QAAQ,EAAE,4BAAkB,EAAC;CAC5D,CAAC;AAEF;IAAA;IA+CA,CAAC;IALG,uCAAW,GAAX;QAAA,iBAIC;QAHG,YAAY,CAAC,OAAO,CAAC,UAAC,EAAe;gBAAd,GAAG,SAAA,EAAE,QAAQ,cAAA;YAChC,KAAI,CAAC,GAAG,CAAC,GAAG,IAAI,QAAQ,CAAC,KAAI,CAAC,GAAG,EAAE,KAAI,CAAC,aAAa,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACP,CAAC;IACL,wBAAC;AAAD,CAAC,AA/CD,IA+CC;AAED,kBAAe,iBAAiB,CAAC"} -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluator.js b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluator.js -new file mode 100644 -index 0000000..7f7c9bf ---- /dev/null -+++ b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluator.js -@@ -0,0 +1,23 @@ -+"use strict"; -+Object.defineProperty(exports, "__esModule", { value: true }); -+var tslib_1 = require("tslib"); -+var Resource_1 = tslib_1.__importDefault(require("../Resource")); -+var PrivilegeEvaluator = /** @class */ (function (_super) { -+ tslib_1.__extends(PrivilegeEvaluator, _super); -+ function PrivilegeEvaluator() { -+ return _super !== null && _super.apply(this, arguments) || this; -+ } -+ /** -+ * Evaluates a specific privilege request -+ * -+ * @param {RestTokenParams} tokenParams -+ * @returns -+ */ -+ PrivilegeEvaluator.prototype.evaluate = function (privilegeEvaluatorParams) { -+ return this.api.post("" + PrivilegeEvaluator.baseUrl, privilegeEvaluatorParams); -+ }; -+ PrivilegeEvaluator.baseUrl = "/rest/privilege/evaluate"; -+ return PrivilegeEvaluator; -+}(Resource_1.default)); -+exports.default = PrivilegeEvaluator; -+//# sourceMappingURL=PrivilegeEvaluator.js.map -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluator.js.map b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluator.js.map -new file mode 100644 -index 0000000..f9ce9ec ---- /dev/null -+++ b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluator.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"PrivilegeEvaluator.js","sourceRoot":"","sources":["../../../src/resources/PrivilegeEvaluator/PrivilegeEvaluator.ts"],"names":[],"mappings":";;;AACA,iEAAoC;AAGpC;IAAgD,8CAAS;IAAzD;;IAYA,CAAC;IATG;;;;;OAKG;IACH,qCAAQ,GAAR,UAAS,wBAAiD;QACtD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAA0B,KAAG,kBAAkB,CAAC,OAAS,EAAE,wBAAwB,CAAC,CAAC;IAC7G,CAAC;IAVM,0BAAO,GAAG,0BAA0B,CAAC;IAWhD,yBAAC;CAAA,AAZD,CAAgD,kBAAS,GAYxD;kBAZoB,kBAAkB"} -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.js b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.js -new file mode 100644 -index 0000000..81425df ---- /dev/null -+++ b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.js -@@ -0,0 +1,15 @@ -+"use strict"; -+Object.defineProperty(exports, "__esModule", { value: true }); -+exports.PrivilegeRequestEvaluationReportModel = void 0; -+var PrivilegeRequestEvaluationReportModel; -+(function (PrivilegeRequestEvaluationReportModel) { -+ PrivilegeRequestEvaluationReportModel["operationForbiddenForAnonymousAuthentication"] = "OPERATION_FORBIDDEN_FOR_ANONYMOUS_AUTHENTICATION"; -+ PrivilegeRequestEvaluationReportModel["operationForbiddenForAuthenticationBoundToDifferentOrganization"] = "OPERATION_FORBIDDEN_FOR_AUTHENTICATION_BOUND_TO_DIFFERENT_ORGANIZATION"; -+ PrivilegeRequestEvaluationReportModel["operationForbiddenForOrganization"] = "OPERATION_FORBIDDEN_FOR_ORGANIZATION"; -+ PrivilegeRequestEvaluationReportModel["operationForbiddenForOrganizationInReadOnly"] = "OPERATION_FORBIDDEN_FOR_ORGANIZATION_IN_READ_ONLY"; -+ PrivilegeRequestEvaluationReportModel["operationForbiddenFromRequestLocation"] = "OPERATION_FORBIDDEN_FROM_REQUEST_LOCATION"; -+ PrivilegeRequestEvaluationReportModel["operationForbiddenInvalidPrivilegeRequest"] = "OPERATION_FORBIDDEN_INVALID_PRIVILEGE_REQUEST"; -+ PrivilegeRequestEvaluationReportModel["operationGranted"] = "OPERATION_GRANTED"; -+ PrivilegeRequestEvaluationReportModel["operationNotAllowed"] = "OPERATION_NOT_ALLOWED"; -+})(PrivilegeRequestEvaluationReportModel = exports.PrivilegeRequestEvaluationReportModel || (exports.PrivilegeRequestEvaluationReportModel = {})); -+//# sourceMappingURL=PrivilegeEvaluatorInterfaces.js.map -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.js.map b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.js.map -new file mode 100644 -index 0000000..9718b57 ---- /dev/null -+++ b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"PrivilegeEvaluatorInterfaces.js","sourceRoot":"","sources":["../../../src/resources/PrivilegeEvaluator/PrivilegeEvaluatorInterfaces.ts"],"names":[],"mappings":";;;AAqBA,IAAY,qCASX;AATD,WAAY,qCAAqC;IAC7C,0IAAiG,CAAA;IACjG,mLAA0I,CAAA;IAC1I,mHAA0E,CAAA;IAC1E,0IAAiG,CAAA;IACjG,4HAAmF,CAAA;IACnF,oIAA2F,CAAA;IAC3F,+EAAsC,CAAA;IACtC,sFAA6C,CAAA;AACjD,CAAC,EATW,qCAAqC,GAArC,6CAAqC,KAArC,6CAAqC,QAShD"} -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/index.js b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/index.js -new file mode 100644 -index 0000000..a0f898a ---- /dev/null -+++ b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/index.js -@@ -0,0 +1,6 @@ -+"use strict"; -+Object.defineProperty(exports, "__esModule", { value: true }); -+var tslib_1 = require("tslib"); -+tslib_1.__exportStar(require("./PrivilegeEvaluator"), exports); -+tslib_1.__exportStar(require("./PrivilegeEvaluatorInterfaces"), exports); -+//# sourceMappingURL=index.js.map -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/index.js.map b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/index.js.map -new file mode 100644 -index 0000000..e14a3b5 ---- /dev/null -+++ b/node_modules/@coveord/platform-client/dist/resources/PrivilegeEvaluator/index.js.map -@@ -0,0 +1 @@ -+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/PrivilegeEvaluator/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,yEAA+C"} -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/index.js b/node_modules/@coveord/platform-client/dist/resources/index.js -index dbe870c..e1cb406 100644 ---- a/node_modules/@coveord/platform-client/dist/resources/index.js -+++ b/node_modules/@coveord/platform-client/dist/resources/index.js -@@ -38,4 +38,5 @@ tslib_1.__exportStar(require("./Notification"), exports); - tslib_1.__exportStar(require("./Connectivity"), exports); - tslib_1.__exportStar(require("./SearchInterfaces"), exports); - tslib_1.__exportStar(require("./ModifierTemplates"), exports); -+tslib_1.__exportStar(require("./PrivilegeEvaluator"), exports); - //# sourceMappingURL=index.js.map -\ No newline at end of file -diff --git a/node_modules/@coveord/platform-client/dist/resources/index.js.map b/node_modules/@coveord/platform-client/dist/resources/index.js.map -index 8685e76..183d8dd 100644 ---- a/node_modules/@coveord/platform-client/dist/resources/index.js.map -+++ b/node_modules/@coveord/platform-client/dist/resources/index.js.map -@@ -1 +1 @@ --{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,gDAAsB;AACtB,2DAAiC;AACjC,8DAAoC;AACpC,qDAA2B;AAC3B,qDAA2B;AAC3B,kDAAwB;AACxB,mDAAyB;AACzB,yDAA+B;AAC/B,mDAAyB;AACzB,oDAA0B;AAC1B,iEAAuC;AACvC,oDAA0B;AAC1B,iDAAuB;AACvB,4DAAkC;AAClC,0DAAgC;AAChC,8DAAoC;AACpC,sDAA4B;AAC5B,oDAA0B;AAC1B,2DAAiC;AACjC,iDAAuB;AACvB,mDAAyB;AACzB,oDAA0B;AAC1B,uDAA6B;AAC7B,0DAAgC;AAChC,8DAAoC;AACpC,kDAAwB;AACxB,2DAAiC;AACjC,mDAAyB;AACzB,0DAAgC;AAChC,wDAA8B;AAC9B,+DAAqC;AACrC,mDAAyB;AACzB,yDAA+B;AAC/B,yDAA+B;AAC/B,6DAAmC;AACnC,8DAAoC"} -\ No newline at end of file -+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,gDAAsB;AACtB,2DAAiC;AACjC,8DAAoC;AACpC,qDAA2B;AAC3B,qDAA2B;AAC3B,kDAAwB;AACxB,mDAAyB;AACzB,yDAA+B;AAC/B,mDAAyB;AACzB,oDAA0B;AAC1B,iEAAuC;AACvC,oDAA0B;AAC1B,iDAAuB;AACvB,4DAAkC;AAClC,0DAAgC;AAChC,8DAAoC;AACpC,sDAA4B;AAC5B,oDAA0B;AAC1B,2DAAiC;AACjC,iDAAuB;AACvB,mDAAyB;AACzB,oDAA0B;AAC1B,uDAA6B;AAC7B,0DAAgC;AAChC,8DAAoC;AACpC,kDAAwB;AACxB,2DAAiC;AACjC,mDAAyB;AACzB,0DAAgC;AAChC,wDAA8B;AAC9B,+DAAqC;AACrC,mDAAyB;AACzB,yDAA+B;AAC/B,yDAA+B;AAC/B,6DAAmC;AACnC,8DAAoC;AACpC,+DAAqC"} -\ No newline at end of file diff --git a/packages/cli/src/commands/ui/create/angular.spec.ts b/packages/cli/src/commands/ui/create/angular.spec.ts index 366b9c3ca2..7bf60272ec 100644 --- a/packages/cli/src/commands/ui/create/angular.spec.ts +++ b/packages/cli/src/commands/ui/create/angular.spec.ts @@ -1,6 +1,5 @@ jest.mock('../../../lib/decorators/preconditions/npm'); jest.mock('../../../lib/decorators/preconditions/node'); -jest.mock('../../../lib/decorators/preconditions/apiKeyPrivilege'); jest.mock('../../../lib/utils/process'); jest.mock('../../../lib/oauth/oauth'); jest.mock('../../../lib/config/config'); @@ -20,7 +19,6 @@ import {Config, Configuration} from '../../../lib/config/config'; import { IsNpmVersionInRange, IsNodeVersionInRange, - HasNecessaryCoveoPrivileges, } from '../../../lib/decorators/preconditions/'; import {getPackageVersion} from '../../../lib/utils/misc'; import Command from '@oclif/command'; @@ -34,12 +32,9 @@ describe('ui:create:angular', () => { const mockedIsNpmVersionInRange = mocked(IsNpmVersionInRange, true); const mockedIsNodeVersionInRange = mocked(IsNodeVersionInRange, true); const angularAppExecutable = join('@angular', 'cli', 'lib', 'init.js'); - const mockedApiKeyPrivilege = mocked(HasNecessaryCoveoPrivileges, true); - const mockedCreateImpersonateApiKey = jest.fn(); const preconditionStatus = { node: true, npm: true, - apiKey: true, }; const doMockPreconditions = function () { const mockNode = function (_target: Command) { @@ -50,14 +45,8 @@ describe('ui:create:angular', () => { const mockNpm = function (_target: Command) { return new Promise((resolve) => resolve(preconditionStatus.npm)); }; - const mockApiKeyPrivilege = function (_target: Command) { - return new Promise((resolve) => - resolve(preconditionStatus.apiKey) - ); - }; mockedIsNodeVersionInRange.mockReturnValue(mockNode); mockedIsNpmVersionInRange.mockReturnValue(mockNpm); - mockedApiKeyPrivilege.mockReturnValue(mockApiKeyPrivilege); }; const doMockSpawnProcess = () => { @@ -84,14 +73,13 @@ describe('ui:create:angular', () => { }; const doMockAuthenticatedClient = () => { - mockedCreateImpersonateApiKey.mockImplementation((_name: string) => - Promise.resolve({value: 'foo'}) - ); - mockedAuthenticatedClient.mockImplementation( () => ({ - createImpersonateApiKey: mockedCreateImpersonateApiKey, + createImpersonateApiKey: (_name: string) => + Promise.resolve({ + value: 'foo', + }), getUserInfo: () => Promise.resolve({ username: 'bob@coveo.com', @@ -106,7 +94,7 @@ describe('ui:create:angular', () => { }) ), cfg: mockedConfig.getMockImplementation()!('./'), - } as unknown as AuthenticatedClient) + } as AuthenticatedClient) ); }; @@ -128,7 +116,6 @@ describe('ui:create:angular', () => { doMockPreconditions(); preconditionStatus.npm = true; preconditionStatus.node = true; - preconditionStatus.apiKey = true; }); afterEach(() => { @@ -136,18 +123,6 @@ describe('ui:create:angular', () => { mockedIsNpmVersionInRange.mockClear(); }); - test - .do(() => { - preconditionStatus.apiKey = false; - }) - .command(['ui:create:angular', 'myapp']) - .it( - 'should not execute the command if the API key preconditions are not respected', - async () => { - expect(mockedCreateImpersonateApiKey).toHaveBeenCalledTimes(0); - } - ); - test .do(() => { preconditionStatus.npm = false; diff --git a/packages/cli/src/commands/ui/create/angular.ts b/packages/cli/src/commands/ui/create/angular.ts index bacbe981cd..152e8754da 100644 --- a/packages/cli/src/commands/ui/create/angular.ts +++ b/packages/cli/src/commands/ui/create/angular.ts @@ -13,7 +13,6 @@ import { IsAuthenticated, IsNodeVersionInRange, IsNpmVersionInRange, - HasNecessaryCoveoPrivileges, } from '../../../lib/decorators/preconditions/'; export default class Angular extends Command { @@ -52,8 +51,7 @@ export default class Angular extends Command { @Preconditions( IsAuthenticated(), IsNodeVersionInRange(Angular.requiredNodeVersion), - IsNpmVersionInRange(Angular.requiredNpmVersion), - HasNecessaryCoveoPrivileges() + IsNpmVersionInRange(Angular.requiredNpmVersion) ) public async run() { const {args, flags} = this.parse(Angular); diff --git a/packages/cli/src/commands/ui/create/react.spec.ts b/packages/cli/src/commands/ui/create/react.spec.ts index 139bbc004e..1c9ce26c60 100644 --- a/packages/cli/src/commands/ui/create/react.spec.ts +++ b/packages/cli/src/commands/ui/create/react.spec.ts @@ -1,6 +1,5 @@ jest.mock('../../../lib/decorators/preconditions/npx'); jest.mock('../../../lib/decorators/preconditions/node'); -jest.mock('../../../lib/decorators/preconditions/apiKeyPrivilege'); jest.mock('../../../lib/utils/process'); jest.mock('../../../lib/oauth/oauth'); jest.mock('../../../lib/config/config'); @@ -21,7 +20,6 @@ import {Config, Configuration} from '../../../lib/config/config'; import { IsNpxInstalled, IsNodeVersionInRange, - HasNecessaryCoveoPrivileges, } from '../../../lib/decorators/preconditions/'; import {getPackageVersion} from '../../../lib/utils/misc'; import Command from '@oclif/command'; @@ -37,8 +35,6 @@ describe('ui:create:react', () => { const mockedAuthenticatedClient = mocked(AuthenticatedClient); const mockedIsNpxInstalled = mocked(IsNpxInstalled, true); const mockedIsNodeVersionInRange = mocked(IsNodeVersionInRange, true); - const mockedApiKeyPrivilege = mocked(HasNecessaryCoveoPrivileges, true); - const mockedCreateImpersonateApiKey = jest.fn(); const processExitCode = { spawn: 0, spawnOutput: 0, @@ -46,7 +42,6 @@ describe('ui:create:react', () => { const preconditionStatus = { node: true, npx: true, - apiKey: true, }; const doMockPreconditions = function () { const mockNode = function (_target: Command) { @@ -57,14 +52,8 @@ describe('ui:create:react', () => { const mockNpx = function (_target: Command) { return new Promise((resolve) => resolve(preconditionStatus.npx)); }; - const mockApiKeyPrivilege = function (_target: Command) { - return new Promise((resolve) => - resolve(preconditionStatus.apiKey) - ); - }; mockedIsNodeVersionInRange.mockReturnValue(mockNode); mockedIsNpxInstalled.mockReturnValue(mockNpx); - mockedApiKeyPrivilege.mockReturnValue(mockApiKeyPrivilege); }; const doMockSpawnProcess = () => { @@ -101,14 +90,13 @@ describe('ui:create:react', () => { }; const doMockAuthenticatedClient = () => { - mockedCreateImpersonateApiKey.mockImplementation((_name: string) => - Promise.resolve({value: 'foo'}) - ); - mockedAuthenticatedClient.mockImplementation( () => ({ - createImpersonateApiKey: mockedCreateImpersonateApiKey, + createImpersonateApiKey: (_name: string) => + Promise.resolve({ + value: 'foo', + }), getUserInfo: () => Promise.resolve({ username: 'bob@coveo.com', @@ -123,7 +111,7 @@ describe('ui:create:react', () => { }) ), cfg: mockedConfig.getMockImplementation()!('./'), - } as unknown as AuthenticatedClient) + } as AuthenticatedClient) ); }; @@ -145,7 +133,6 @@ describe('ui:create:react', () => { doMockPreconditions(); preconditionStatus.npx = true; preconditionStatus.node = true; - preconditionStatus.apiKey = true; processExitCode.spawn = 0; processExitCode.spawnOutput = 0; }); @@ -153,21 +140,8 @@ describe('ui:create:react', () => { afterEach(() => { mockedIsNodeVersionInRange.mockClear(); mockedIsNpxInstalled.mockClear(); - mockedApiKeyPrivilege.mockClear(); }); - test - .do(() => { - preconditionStatus.apiKey = false; - }) - .command(['ui:create:react', 'myapp']) - .it( - 'should not execute the command if the API key preconditions are not respected', - async () => { - expect(mockedCreateImpersonateApiKey).toHaveBeenCalledTimes(0); - } - ); - test .do(() => { preconditionStatus.npx = false; diff --git a/packages/cli/src/commands/ui/create/react.ts b/packages/cli/src/commands/ui/create/react.ts index 1dde2fcfab..bf9ab57040 100644 --- a/packages/cli/src/commands/ui/create/react.ts +++ b/packages/cli/src/commands/ui/create/react.ts @@ -15,7 +15,6 @@ import { IsAuthenticated, IsNodeVersionInRange, IsNpxInstalled, - HasNecessaryCoveoPrivileges, } from '../../../lib/decorators/preconditions'; import {appendCmdIfWindows} from '../../../lib/utils/os'; import {EOL} from 'os'; @@ -57,8 +56,7 @@ export default class React extends Command { @Preconditions( IsAuthenticated(), IsNodeVersionInRange(React.requiredNodeVersion), - IsNpxInstalled(), - HasNecessaryCoveoPrivileges() + IsNpxInstalled() ) public async run() { const args = this.args; diff --git a/packages/cli/src/commands/ui/create/vue.spec.ts b/packages/cli/src/commands/ui/create/vue.spec.ts index ac9df132b9..4d5e1c4e5b 100644 --- a/packages/cli/src/commands/ui/create/vue.spec.ts +++ b/packages/cli/src/commands/ui/create/vue.spec.ts @@ -1,5 +1,4 @@ jest.mock('../../../lib/decorators/preconditions/node'); -jest.mock('../../../lib/decorators/preconditions/apiKeyPrivilege'); jest.mock('../../../lib/utils/process'); jest.mock('../../../lib/oauth/oauth'); jest.mock('../../../lib/config/config'); @@ -16,10 +15,7 @@ import {spawnProcess} from '../../../lib/utils/process'; import {AuthenticatedClient} from '../../../lib/platform/authenticatedClient'; import PlatformClient from '@coveord/platform-client'; import {Config, Configuration} from '../../../lib/config/config'; -import { - IsNodeVersionInRange, - HasNecessaryCoveoPrivileges, -} from '../../../lib/decorators/preconditions/'; +import {IsNodeVersionInRange} from '../../../lib/decorators/preconditions/'; import {getPackageVersion} from '../../../lib/utils/misc'; import Command from '@oclif/command'; @@ -31,11 +27,8 @@ describe('ui:create:vue', () => { const mockedAuthenticatedClient = mocked(AuthenticatedClient); const mockedIsNodeVersionInRange = mocked(IsNodeVersionInRange, true); const vueAppExecutable = join('@vue', 'cli', 'bin', 'vue.js'); //TODO: change that - const mockedApiKeyPrivilege = mocked(HasNecessaryCoveoPrivileges, true); - const mockedCreateImpersonateApiKey = jest.fn(); const preconditionStatus = { node: true, - apiKey: true, }; const doMockPreconditions = function () { const mockNode = function (_target: Command) { @@ -43,13 +36,7 @@ describe('ui:create:vue', () => { resolve(preconditionStatus.node) ); }; - const mockApiKeyPrivilege = function (_target: Command) { - return new Promise((resolve) => - resolve(preconditionStatus.apiKey) - ); - }; mockedIsNodeVersionInRange.mockReturnValue(mockNode); - mockedApiKeyPrivilege.mockReturnValue(mockApiKeyPrivilege); }; const doMockSpawnProcess = () => { @@ -76,14 +63,13 @@ describe('ui:create:vue', () => { }; const doMockAuthenticatedClient = () => { - mockedCreateImpersonateApiKey.mockImplementation((_name: string) => - Promise.resolve({value: 'foo'}) - ); - mockedAuthenticatedClient.mockImplementation( () => ({ - createImpersonateApiKey: mockedCreateImpersonateApiKey, + createImpersonateApiKey: (_name: string) => + Promise.resolve({ + value: 'foo', + }), getUserInfo: () => Promise.resolve({ username: 'bob@coveo.com', @@ -98,7 +84,7 @@ describe('ui:create:vue', () => { }) ), cfg: mockedConfig.getMockImplementation()!('./'), - } as unknown as AuthenticatedClient) + } as AuthenticatedClient) ); }; @@ -119,26 +105,12 @@ describe('ui:create:vue', () => { doMockAuthenticatedClient(); doMockPreconditions(); preconditionStatus.node = true; - preconditionStatus.apiKey = true; }); afterEach(() => { mockedIsNodeVersionInRange.mockClear(); - mockedApiKeyPrivilege.mockClear(); }); - test - .do(() => { - preconditionStatus.apiKey = false; - }) - .command(['ui:create:vue', 'myapp']) - .it( - 'should not execute the command if the API key preconditions are not respected', - async () => { - expect(mockedCreateImpersonateApiKey).toHaveBeenCalledTimes(0); - } - ); - test .do(() => { preconditionStatus.node = false; diff --git a/packages/cli/src/commands/ui/create/vue.ts b/packages/cli/src/commands/ui/create/vue.ts index 77ef658514..22c7e55372 100644 --- a/packages/cli/src/commands/ui/create/vue.ts +++ b/packages/cli/src/commands/ui/create/vue.ts @@ -9,7 +9,6 @@ import { Preconditions, IsAuthenticated, IsNodeVersionInRange, - HasNecessaryCoveoPrivileges, } from '../../../lib/decorators/preconditions'; import {AuthenticatedClient} from '../../../lib/platform/authenticatedClient'; import {platformUrl} from '../../../lib/platform/environment'; @@ -60,8 +59,7 @@ export default class Vue extends Command { @Preconditions( IsAuthenticated(), - IsNodeVersionInRange(Vue.requiredNodeVersion), - HasNecessaryCoveoPrivileges() + IsNodeVersionInRange(Vue.requiredNodeVersion) ) public async run() { const {args, flags} = this.parse(Vue); diff --git a/packages/cli/src/lib/decorators/preconditions/apiKeyPrivilege.spec.ts b/packages/cli/src/lib/decorators/preconditions/apiKeyPrivilege.spec.ts deleted file mode 100644 index 92a37f583a..0000000000 --- a/packages/cli/src/lib/decorators/preconditions/apiKeyPrivilege.spec.ts +++ /dev/null @@ -1,84 +0,0 @@ -jest.mock('@oclif/command'); -jest.mock('../../platform/authenticatedClient'); -jest.mock('../../config/config'); - -import {IConfig} from '@oclif/config'; -import {mocked} from 'ts-jest/utils'; -import {Config} from '../../config/config'; -import {AuthenticatedClient} from '../../platform/authenticatedClient'; -import {HasNecessaryCoveoPrivileges} from './apiKeyPrivilege'; -import {getFakeCommand} from './testsUtils/utils'; - -const mockConfig = mocked(Config); - -describe('apiKeyPrivilege', () => { - const mockedAuthenticatedClient = mocked(AuthenticatedClient); - const mockEvaluate = jest.fn(); - const mockGet = jest.fn().mockReturnValue({ - environment: 'dev', - region: 'eu-west-1', - organization: 'my_org', - accessToken: 'my_token', - }); - const mockGetClient = jest.fn().mockResolvedValue({ - privilegeEvaluator: { - evaluate: mockEvaluate, - }, - }); - - mockConfig.prototype.get = mockGet; - mockedAuthenticatedClient.prototype.getClient = mockGetClient; - - beforeEach(() => { - global.config = {configDir: 'the_config_dir'} as IConfig; - }); - - afterAll(() => { - jest.clearAllMocks(); - }); - - describe.each([ - [ - true, - false, - 'You are not authorized to create an API Key with the Impersonate privilege', - ], - [false, true, 'You are not authorized to create an API Key'], - ])( - 'when the API key condition is %s and the impersonate condition is %s.', - ( - apiKeyCondition: boolean, - impersonateCondition: boolean, - expectedWarning: string - ) => { - it(`warns '${expectedWarning}' and returns false`, async () => { - mockEvaluate - .mockReturnValueOnce({approved: apiKeyCondition}) - .mockReturnValueOnce({approved: impersonateCondition}); - - const fakeCommand = getFakeCommand(); - await expect(HasNecessaryCoveoPrivileges()(fakeCommand)).resolves.toBe( - false - ); - expect(fakeCommand.warn).toHaveBeenCalledTimes(1); - expect(fakeCommand.warn).toHaveBeenCalledWith( - expect.stringContaining(expectedWarning) - ); - }); - } - ); - - describe('when the user has all the required privileges', () => { - beforeEach(() => { - mockEvaluate.mockReturnValue({approved: true}); - }); - - it('returns true and does not warn', async () => { - const fakeCommand = getFakeCommand(); - await expect(HasNecessaryCoveoPrivileges()(fakeCommand)).resolves.toBe( - true - ); - expect(fakeCommand.warn).not.toHaveBeenCalled(); - }); - }); -}); diff --git a/packages/cli/src/lib/decorators/preconditions/apiKeyPrivilege.ts b/packages/cli/src/lib/decorators/preconditions/apiKeyPrivilege.ts deleted file mode 100644 index 5d721bbda3..0000000000 --- a/packages/cli/src/lib/decorators/preconditions/apiKeyPrivilege.ts +++ /dev/null @@ -1,89 +0,0 @@ -import PlatformClient, { - PrivilegeEvaluatorModel, -} from '@coveord/platform-client'; -import Command from '@oclif/command'; -import dedent from 'ts-dedent'; -import {Config} from '../../config/config'; -import {AuthenticatedClient} from '../../platform/authenticatedClient'; - -export const impersonatePrivilege = { - requestedPrivilege: { - owner: 'SEARCH_API', - targetDomain: 'IMPERSONATE', - targetId: '*', - }, -}; - -export const createApiKeyPrivilege = { - requestedPrivilege: { - owner: 'PLATFORM', - targetDomain: 'API_KEY', - targetId: '*', - type: 'CREATE', - }, -}; - -export function HasNecessaryCoveoPrivileges() { - return async function (target: Command) { - const authenticatedClient = new AuthenticatedClient(); - - const client = await authenticatedClient.getClient(); - const {organization, anonymous} = await getConfiguration(target); - - if (!(await hasCreateApiKeyPrivilege(client, organization))) { - target.warn( - anonymous - ? 'Your API key is missing the privilege to create other API keys. Make sure to grant this privilege before running the command again. See https://docs.coveo.com/en/1707/#api-keys-domain.' - : 'You are not authorized to create an API Key. Please contact an administrator of your Coveo organization and ask for that privilege. See https://docs.coveo.com/en/1707/#api-keys-domain.' - ); - return false; - } - if (!(await hasImpersonatePrivilege(client, organization))) { - target.warn( - anonymous - ? dedent`Your API key is missing the Impersonate privilege. Make sure to grant this privilege to your API key before running the command again. - See https://docs.coveo.com/en/1707/#impersonate-domain-1.` - : 'You are not authorized to create an API Key with the Impersonate privilege. Please contact an administrator of your Coveo organization and ask for that privilege. See https://docs.coveo.com/en/1707/#impersonate-domain-1.' - ); - return false; - } - return true; - }; -} - -async function hasImpersonatePrivilege( - client: PlatformClient, - organizationId: string -) { - const model: PrivilegeEvaluatorModel = { - ...impersonatePrivilege, - organizationId, - }; - - return await hasPrivilege(client, model); -} - -async function hasCreateApiKeyPrivilege( - client: PlatformClient, - organizationId: string -) { - const model: PrivilegeEvaluatorModel = { - ...createApiKeyPrivilege, - organizationId, - }; - - return await hasPrivilege(client, model); -} - -async function hasPrivilege( - client: PlatformClient, - model: PrivilegeEvaluatorModel -) { - const validation = await client.privilegeEvaluator.evaluate(model); - return validation.approved; -} - -async function getConfiguration(target: Command) { - const config = new Config(global.config.configDir, target.error); - return config.get(); -} diff --git a/packages/cli/src/lib/decorators/preconditions/index.ts b/packages/cli/src/lib/decorators/preconditions/index.ts index 6bdc779cdb..ed95311d2e 100644 --- a/packages/cli/src/lib/decorators/preconditions/index.ts +++ b/packages/cli/src/lib/decorators/preconditions/index.ts @@ -2,5 +2,4 @@ export * from './node'; export * from './npx'; export * from './npm'; export * from './authenticated'; -export * from './apiKeyPrivilege'; export * from './preconditions';