diff --git a/scheduler-utils/src/client/gateway.js b/scheduler-utils/src/client/gateway.js index 8aa8ceaa3..04bb64a81 100644 --- a/scheduler-utils/src/client/gateway.js +++ b/scheduler-utils/src/client/gateway.js @@ -141,9 +141,6 @@ export function loadProcessSchedulerWith ({ fetch, GRAPHQL_URL, GRAPHQL_MAX_RETR query GetTransactions ($transactionIds: [ID!]!) { transactions( ids: $transactionIds - tags: [ - { name: "Data-Protocol", values: ["ao"] } - ] ) { edges { node { @@ -178,6 +175,12 @@ export function loadProcessSchedulerWith ({ fetch, GRAPHQL_URL, GRAPHQL_MAX_RETR return gateway({ query: GET_TRANSACTIONS_QUERY, variables: { transactionIds: [process] } }) .then(path(['data', 'transactions', 'edges', '0', 'node'])) .then(findTransactionTags(`Process ${process} was not found on gateway`)) + .then((tags) => { + if (findTagValue('Data-Protocol')(tags) !== 'ao') { + throw new TransactionNotFoundError(`Process ${process} is not an ao process`) + } + return tags + }) .then(findTagValue(SCHEDULER_TAG)) .then((walletAddress) => { if (!walletAddress) throw new SchedulerTagNotFoundError('No "Scheduler" tag found on process') diff --git a/servers/mu/src/domain/api/sendDataItem.js b/servers/mu/src/domain/api/sendDataItem.js index 7a283a620..cc16eba8f 100644 --- a/servers/mu/src/domain/api/sendDataItem.js +++ b/servers/mu/src/domain/api/sendDataItem.js @@ -321,7 +321,7 @@ export function sendDataItemWith ({ .chain(({ isMessage }) => { if (isMessage) { const whitelist = fetchProcessWhitelist ? fetchProcessWhitelist() : {} - if (whitelist && !whitelist[ctx.dataItem.target]) { + if (whitelist && Object.keys(whitelist).length > 0 && !whitelist[ctx.dataItem.target]) { const error = new Error('Forbidden, process not whitelisted') error.status = 403 return Rejected(error)