|
From: | Conrad Steenberg |
Subject: | [Monotone-devel] [Script] ACL file script |
Date: | Thu, 21 Apr 2005 11:41:57 -0700 |
Hi I couldn't find a place on the monotone web page to upload lua script contribs, so here is a small spam to the list instead: Attached is a simple lua script, acl.lua, that can be used to read cert names from a file instead of having it coded in your .monotonerc hooks. Also attached is a .monotonerc that loads $HOME/.monotone/acl.lua and uses $HOME/.monotone/netsync_read_permitted.acl and $HOME/.monotone/netsync_write_permitted.acl to look for cert names. The .acl files consist of one cert name per line, with a line containing "*all" matching all certs. The .acl files are read every time the respective hooks are called, so the ACLs can be modified without stopping and restarting a monotone server. Of course it would be nicer to have the ACL info in a table in the actual monotone database in future, but let's see how this goes first... The acl.lua file implements a function grant_access(cert_name, file_name, debug) which checks whether the provided cert_name (or *all) is found on one of the lines in the file_name file. It returns either true or false. The debug parameter is optional and defaults to nil. The test_acl.lua file can be run from the command line with a cert name as an argument and uses the file $HOME/.monotone/netsync_write_permitted.acl as an ACL allowed list. Cheers Conrad -- Conrad Steenberg <address@hidden>
acl.lua
Description: Text document
testacl.lua
Description: Text document
.monotonerc
Description: Text document
smime.p7s
Description: S/MIME cryptographic signature
[Prev in Thread] | Current Thread | [Next in Thread] |