Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions scheduler-utils/src/client/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion servers/mu/src/domain/api/sendDataItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading