File: hooks.lua

package info (click to toggle)
monotone 1.1-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,984 kB
  • ctags: 8,622
  • sloc: cpp: 86,450; sh: 6,906; perl: 924; makefile: 813; python: 517; lisp: 379; sql: 118; exp: 91; ansic: 52
file content (23 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- Everything alice signs is trusted, nothing mallory signs is
-- trusted.  For certs signed by other people, everything is
-- trusted except for one particular cert...
function get_revision_cert_trust(signers, id, name, val)
   for k, v in pairs(signers) do
      if v.given_name == "alice@trusted.com" then return true end
      if v.given_name == "mallory@evil.com" then return false end
   end
   -- the id of the revision in which "badfile" is checked in
   if (id == "4c71646d1def3c60b06d8358b1b7016d762e5e02"
       and name == "bad-cert" and val == "bad-val")
   then return false end
   return true
end

function get_manifest_cert_trust(signers, id, name, val)
   return true
end

function get_file_cert_trust(signers, id, name, val)
   return true
end