Changeset 0a49bd7 for fedd/access_to_abac.py
- Timestamp:
- Jan 15, 2011 5:52:15 PM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master
- Children:
- aaf7f41
- Parents:
- ac15159 (diff), 944b746 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Ted Faber <faber@…> (01/15/11 17:51:40)
- git-committer:
- Ted Faber <faber@…> (01/15/11 17:52:15)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/access_to_abac.py
rac15159 r0a49bd7 12 12 from federation.fedid import fedid 13 13 from federation.authorizer import abac_authorizer 14 from federation.util import abac_split_cert, abac_pem_type 14 from federation.util import abac_split_cert, abac_pem_type, file_expanding_opts 15 15 16 16 … … 185 185 186 186 187 def parse_access(fn, mapper ):187 def parse_access(fn, mapper, delegation_link): 188 188 """ 189 189 Parse the access file, calling out to the mapper to parse specific … … 224 224 225 225 226 class access_opts( OptionParser):226 class access_opts(file_expanding_opts): 227 227 ''' 228 228 Parse the options for this program. Most are straightforward, but the … … 247 247 248 248 def __init__(self): 249 OptionParser.__init__(self, usage='%prog [opts] file [...]')249 file_expanding_opts.__init__(self, usage='%prog [opts] file [...]') 250 250 self.add_option('--cert', dest='cert', default=None, 251 type='str', action='callback', callback=self.expand_file, 251 252 help='my fedid as an X.509 certificate') 252 253 self.add_option('--key', dest='key', default=None, 254 type='str', action='callback', callback=self.expand_file, 253 255 help='key for the certificate') 254 256 self.add_option('--dir', dest='dir', default=None, 257 type='str', action='callback', callback=self.expand_file, 255 258 help='Output directory for credentials') 256 259 self.add_option('--type', action='callback', nargs=1, type='str', … … 263 266 default=False, 264 267 help='Do not print credential to local attribute map') 265 self.add_option('--create-creds', action='store_true', 266 dest='create_creds', default=False, 267 help='create credentials for rules. Requires ' + \ 268 '--cert, --key, and --dir to be given.') 268 self.add_option('--no_create_creds', action='store_false', 269 dest='create_creds', default=True, 270 help='Do not create credentials for rules.') 269 271 self.add_option('--file', dest='file', default=None, 272 type='str', action='callback', callback=self.expand_file, 270 273 help='Access DB to parse. If this is present, ' + \ 271 274 'omit the positional filename') 272 275 self.add_option('--mapfile', dest='map', default=None, 276 type='str', action='callback', callback=self.expand_file, 273 277 help='File for the attribute to local authorization data') 274 278 self.add_option('--no-delegate', action='store_false', dest='delegate', … … 276 280 help='do not accept delegated attributes with the ' +\ 277 281 'acting_for linking role') 278 self.add_option('-- auth', action='store_true', dest='create_auth',279 default= False, help='create a full ABAC authorizer')282 self.add_option('--no_auth', action='store_false', dest='create_auth', 283 default=True, help='do not create a full ABAC authorizer') 280 284 self.add_option('--debug', action='store_true', dest='debug', 281 285 default=False, help='Just print actions') … … 402 406 for fn in args: 403 407 try: 404 creds, to_id = parse_access(fn, opts.mapper )408 creds, to_id = parse_access(fn, opts.mapper, delegation_link) 405 409 except parse_error, e: 406 410 print >> sys.stderr, "%s" % e
Note: See TracChangeset
for help on using the changeset viewer.