Skip to content

Commit

Permalink
Merge pull request permaweb#839 from permaweb/samcamwilliams/isTruste…
Browse files Browse the repository at this point in the history
…dFix

fix: In the event of having no authorities on the list, trust no-one.
  • Loading branch information
samcamwilliams authored Jun 30, 2024
2 parents df54389 + 9a73306 commit 0f6f99f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dev-cli/container/src/ao.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ function ao.assign(assignment)
table.insert(ao.outbox.Assignments, assignment)
end

-- The default security model of AOS processes: Trust all and *only* those
-- on the ao.authorities list.
function ao.isTrusted(msg)
if #ao.authorities == 0 then return true end

for _, authority in ipairs(ao.authorities) do
if msg.From == authority then return true end
if msg.Owner == authority then return true end
Expand Down

0 comments on commit 0f6f99f

Please sign in to comment.