Changeset f77a256 for fedd/access_to_abac.py
- Timestamp:
- Jan 11, 2012 4:02:07 PM (12 years ago)
- Branches:
- compt_changes, info-ops, master
- Children:
- 6886c5a
- Parents:
- ee950c2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/access_to_abac.py
ree950c2 rf77a256 71 71 # All the local parsing functions get the unparsed remainder of the line 72 72 # (after the three-name and the attribute it maps to), the credential list to 73 # add the new ABAC credential(s) that will be mapped into the lo acl73 # add the new ABAC credential(s) that will be mapped into the local 74 74 # credentials, the fedid of this entity, a dict mapping the local credentials 75 75 # to ABAC credentials that are required to exercise those local rights and the … … 77 77 def parse_emulab(l, creds, me, to_id, p, gp, gu, lr): 78 78 ''' 79 Parse the emulab (project, allocation_user, access_user) format. Access 80 users are deprecates and allocation users used for both. This fuction 81 collapses them. 82 ''' 83 right_side_str = '\s*,\s*\(\s*%s\s*,\s*%s\s*,\s*%s\s*\)' % \ 84 (proj_same_str, id_same_str,id_same_str) 79 Parse the emulab (project, allocation_user, cert_file) format. 80 ''' 81 right_side_str = '\s*,\s*\(\s*%s\s*,\s*%s\s*,\s*(%s)\s*\)' % \ 82 (proj_same_str, id_same_str,path_str) 85 83 86 84 m = re.match(right_side_str, l) 87 85 if m: 88 project, user = m.group(1,2)86 project, user, cert = m.group(1,2,3) 89 87 # Resolve "<same>"s in project and user 90 88 if project == '<same>': … … 114 112 [attribute(p, x, lr) for x in (gp, gu) if x is not None]) 115 113 creds.add(c) 116 if (project, user ) in to_id: to_id[(project,user)].append(c)117 else: to_id[(project,user )] = [ c ]114 if (project, user,cert) in to_id: to_id[(project,user,cert)].append(c) 115 else: to_id[(project,user,cert)] = [ c ] 118 116 else: 119 117 raise parse_error("Badly formatted local mapping: %s" % l) … … 320 318 id_str = '[a-zA-Z][\w_-]*' 321 319 proj_str = '[a-zA-Z][\w_/-]*' 322 path_str = '[a-zA-Z _/\.-]+'320 path_str = '[a-zA-Z0-9_/\.-]+' 323 321 id_any_str = '(%s|<any>)' % id_str 324 322 proj_any_str = '(%s|<any>)' % proj_str
Note: See TracChangeset
for help on using the changeset viewer.