source: fedd/init_abac_authorizer.py @ 09b1e9d

axis_examplecompt_changesinfo-ops
Last change on this file since 09b1e9d was 71461a4, checked in by Ted Faber <faber@…>, 14 years ago

Create a saved format directory from the parts of an abac authorizer

  • Property mode set to 100755
File size: 754 bytes
Line 
1#!/usr/local/bin/python
2
3from optparse import OptionParser
4from federation.authorizer import abac_authorizer
5
6class Parser(OptionParser):
7    def __init__(self):
8        OptionParser.__init__(self, usage='%prog [options')
9        self.add_option('--cert', dest='cert', help='Identity certificate')
10        self.add_option('--key', dest='key', help='Identity key')
11        self.add_option('--policy', dest='policy', 
12                help='ABAC policy certificates')
13        self.add_option('--dir', dest='out_dir', help='directory to save into')
14
15parser = Parser()
16opts, args = parser.parse_args()
17
18if any([ not x for x in (opts.key, opts.cert, opts.policy, opts.out_dir)]):
19    parser.print_help()
20    sys.exit(1)
21
22a = abac_authorizer(key=opts.key, me=opts.cert, certs=opts.policy)
23a.save(opts.out_dir)
Note: See TracBrowser for help on using the repository browser.