axis_examplecompt_changesinfo-ops
Last change
on this file since 9ecda47 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 | |
---|
3 | from optparse import OptionParser |
---|
4 | from federation.authorizer import abac_authorizer |
---|
5 | |
---|
6 | class 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 | |
---|
15 | parser = Parser() |
---|
16 | opts, args = parser.parse_args() |
---|
17 | |
---|
18 | if any([ not x for x in (opts.key, opts.cert, opts.policy, opts.out_dir)]): |
---|
19 | parser.print_help() |
---|
20 | sys.exit(1) |
---|
21 | |
---|
22 | a = abac_authorizer(key=opts.key, me=opts.cert, certs=opts.policy) |
---|
23 | a.save(opts.out_dir) |
---|
Note: See
TracBrowser
for help on using the repository browser.