{"action":"opened","issue":{"url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/23","labels_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/23/comments","events_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/23/events","html_url":"https://github.com/localmed/ruby-macaroons/issues/23","id":110886161,"number":23,"title":"Stricter callbacks?","user":{"login":"nyarly","id":127548,"avatar_url":"https://avatars.githubusercontent.com/u/127548?v=3","gravatar_id":"","url":"https://api.github.com/users/nyarly","html_url":"https://github.com/nyarly","followers_url":"https://api.github.com/users/nyarly/followers","following_url":"https://api.github.com/users/nyarly/following{/other_user}","gists_url":"https://api.github.com/users/nyarly/gists{/gist_id}","starred_url":"https://api.github.com/users/nyarly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyarly/subscriptions","organizations_url":"https://api.github.com/users/nyarly/orgs","repos_url":"https://api.github.com/users/nyarly/repos","events_url":"https://api.github.com/users/nyarly/events{/privacy}","received_events_url":"https://api.github.com/users/nyarly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-11T22:23:24Z","updated_at":"2015-10-11T22:23:24Z","closed_at":null,"body":"I was checking out how the Verifier works and noticed this line in `verify_first_party_caveat`:\r\n\r\n```\r\ncaveat_met = true if callback.call(caveat.caveat_id)\r\n```\r\n\r\nThis is concerning since, because of Ruby's default-return semantics, it becomes very easy to write callbacks that will return a truthy value accidentally. It seems safer to:\r\n\r\n```\r\ncaveat_met = true if callback.call(caveat.caveat_id) == true\r\n```\r\n\r\n"}}