New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add length check to vouch text #178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm after snake_case and test fix
src/schema3.iced
Outdated
_check : ({path, obj}) -> | ||
if typeof(obj) isnt 'string' or obj.length is 0 then return mkerr path, "value must be a string" | ||
if @_args? and @_args.maxLength? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use snake_case in iced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you like, you can do if (max_length = @_args?.max_length)?
as well, then use that value in the next block
test/files/wot.iced
Outdated
verifier = alloc out.inner.obj.body.type, me | ||
varg = { armored : out.armored, skip_ids : true, make_ids : true, inner : out.inner.str, expansions : out.expansions, require_packet_hash :true} | ||
await verifier.verify_v2 varg, defer err | ||
T.assert err?, "expecting error" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should check the specific type of error. seems to be a bit annoying in this case (thanks javascript), maybe you can just T.assert err?.message.includes("vouch.confidence.other")
(but @mlsteele may have a stronger opinion)
bac147b
to
af425fe
Compare
this is branched off of #177, so merge that first