Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsteele committed Mar 11, 2020
1 parent b4b20b8 commit 5912591
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/parse3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 17 additions & 15 deletions lib/wot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 19 additions & 10 deletions src/wot.iced
Expand Up @@ -24,14 +24,23 @@ exports.Vouch = class Vouch extends Base
obj = json.body.wot_vouch
if not obj? then return cb null

proof_schema = schema.dict({
check_data_json : schema.or([
schema.dict({name : schema.string(), username : schema.string() }),
schema.dict({domain : schema.string(), protocol : schema.string() })
])
state : schema.int()
proof_type : schema.int()
})
proof_schema = schema.or([
schema.dict({
proof_type : schema.int(), # keybase1.ProofType
name : schema.string(),
username : schema.string()
}),
schema.dict({
proof_type : schema.int(),
protocol : schema.string(),
hostname : schema.string()
}),
schema.dict({
proof_type : schema.int(),
protocol : schema.string(),
domain : schema.string()
})
])

schm = schema.dict({
user : schema.dict({
Expand All @@ -49,10 +58,10 @@ exports.Vouch = class Vouch extends Base
})
confidence : schema.dict({
username_verified_via : schema.string_enum(["in_person", "proofs", "video", "audio", "other_chat", "familiar", "other"]).optional()
proofs : schema.array(schema.string()).optional()
proofs: schema.array(proof_schema).optional()
other : schema.string().optional()
})
failing_proofs : schema.array(schema.string()).optional()
failing_proofs : schema.array(proof_schema).optional()
vouch_text : schema.array(schema.string())
})
err = schm.check(obj)
Expand Down
9 changes: 6 additions & 3 deletions test/files/wot.iced
Expand Up @@ -10,7 +10,10 @@ exports.wot_vouch_happy = (T,cb) ->
esc = make_esc cb
await new_km_and_sig_arg {}, esc defer me
await new_km_and_sig_arg {}, esc defer them
sig_id = "24786764ee0861eb134925fe967c03975fba5df02edfabcf4048c71d8cb8623c0f"
proof1 = { proof_type : 4, name : "reddit", username : "betaveros" }
proof2 = { proof_type : 9, name : "mastodon.social", username : "gammaveros" }
proof3 = { proof_type : 1000, protocol : "https:", hostname : "beta.veros" }
proof4 = { proof_type : 1001, protocol : "dns", hostname : "beta.veros" }
me.wot =
vouch :
user :
Expand All @@ -26,8 +29,8 @@ exports.wot_vouch_happy = (T,cb) ->
confidence :
username_verified_via : "audio"
other : "lorem ipsum"
proofs : [ sig_id, sig_id]
failing_proofs : [ sig_id, sig_id ]
proofs : [ proof1, proof2]
failing_proofs : [ proof3, proof4 ]
vouch_text : [
"darn rootin tootin"
]
Expand Down

0 comments on commit 5912591

Please sign in to comment.