Skip to content

Commit

Permalink
Add nameSpace checks
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-tavares committed Jan 31, 2022
1 parent 9908397 commit 73f11f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export const getExceptionsPreCreateItemHandler = (
endpointAppContext: EndpointAppContextService
): ExceptionsListPreCreateItemServerExtension['callback'] => {
return async function ({ data, context: { request } }): Promise<CreateExceptionListItemOptions> {
if (data.namespaceType !== 'agnostic') {
return data;
}

// Validate trusted apps
if (TrustedAppValidator.isTrustedApp(data)) {
return new TrustedAppValidator(endpointAppContext, request).validatePreCreateItem(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export const getExceptionsPreExportHandler = (
endpointAppContextService: EndpointAppContextService
): ExceptionsListPreExportServerExtension['callback'] => {
return async function ({ data, context: { request, exceptionListClient } }) {
if (data.namespaceType !== 'agnostic') {
return data;
}

const { listId: maybeListId, id } = data;
let listId: string | null | undefined = maybeListId;

Expand Down

0 comments on commit 73f11f8

Please sign in to comment.