Skip to content

Commit

Permalink
Merge pull request #173 from keybase/miles/PICNIC-875-wot-methods
Browse files Browse the repository at this point in the history
Update wot schema
  • Loading branch information
mlsteele committed Mar 12, 2020
2 parents cb02a09 + 5912591 commit 38db5e5
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 41 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 2.3.22 (2020-03-10)

- update WOT schema

## 2.3.21 (2020-02-23)

- enforce full packet hash in nacl sig infos via flag (require_packet_hash in verify calls)
Expand Down
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.

34 changes: 17 additions & 17 deletions lib/wot.js

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

31 changes: 19 additions & 12 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 @@ -48,11 +57,9 @@ exports.Vouch = class Vouch extends Base
})
})
confidence : schema.dict({
proofs : schema.array(proof_schema).optional()
vouched_by : schema.array(schema.uid().convert()).optional()
username_verified_via : schema.string_enum(["audio","video","email","other_chat","in_person"]).optional()
username_verified_via : schema.string_enum(["in_person", "proofs", "video", "audio", "other_chat", "familiar", "other"]).optional()
proofs: schema.array(proof_schema).optional()
other : schema.string().optional()
known_on_keybase_days : schema.int().optional()
})
failing_proofs : schema.array(proof_schema).optional()
vouch_text : schema.array(schema.string())
Expand Down
17 changes: 6 additions & 11 deletions test/files/wot.iced
Expand Up @@ -10,13 +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
proof = {
check_data_json :
name : "reddit",
username : "betaveros"
state : 1,
proof_type : 2
}
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 @@ -30,12 +27,10 @@ exports.wot_vouch_happy = (T,cb) ->
sig_id : new_sig_id()
payload_hash : new_payload_hash()
confidence :
vouched_by : (new_uid() for _ in [0...4])
username_verified_via : "audio"
other : "lorem ipsum"
proofs : [ proof, proof]
known_on_keybase_days : 60
failing_proofs : [ proof, proof ]
proofs : [ proof1, proof2]
failing_proofs : [ proof3, proof4 ]
vouch_text : [
"darn rootin tootin"
]
Expand Down

0 comments on commit 38db5e5

Please sign in to comment.