Skip to content

Commit

Permalink
Run flynt with -tc (aggressive concatenation fixes)
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Oct 27, 2022
1 parent 0390049 commit 0afbf17
Show file tree
Hide file tree
Showing 22 changed files with 1,410 additions and 1,410 deletions.
4 changes: 2 additions & 2 deletions src/saml2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def set_prefixes(self, elem, prefix_map):
uri_map = {}
for prefix, uri in prefix_map.items():
uri_map[uri] = prefix
elem.set("xmlns:" + prefix, uri)
elem.set(f"xmlns:{prefix}", uri)

# fixup all elements in the tree
memo = {}
Expand All @@ -645,7 +645,7 @@ def fixup(name):
return
uri, tag = name[1:].split("}")
if uri in uri_map:
new_name = uri_map[uri] + ":" + tag
new_name = f"{uri_map[uri]}:{tag}"
memo[name] = new_name
return new_name

Expand Down
16 changes: 8 additions & 8 deletions src/saml2/attributemaps/adfs_v1x.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
MAP = {
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
"fro": {
CLAIMS + "commonname": "commonName",
CLAIMS + "emailaddress": "emailAddress",
CLAIMS + "group": "group",
CLAIMS + "upn": "upn",
f"{CLAIMS}commonname": "commonName",
f"{CLAIMS}emailaddress": "emailAddress",
f"{CLAIMS}group": "group",
f"{CLAIMS}upn": "upn",
},
"to": {
"commonName": CLAIMS + "commonname",
"emailAddress": CLAIMS + "emailaddress",
"group": CLAIMS + "group",
"upn": CLAIMS + "upn",
"commonName": f"{CLAIMS}commonname",
"emailAddress": f"{CLAIMS}emailaddress",
"group": f"{CLAIMS}group",
"upn": f"{CLAIMS}upn",
},
}
72 changes: 36 additions & 36 deletions src/saml2/attributemaps/adfs_v20.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,43 @@
MAP = {
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
"fro": {
CLAIMS + "commonname": "commonName",
CLAIMS + "group": "group",
COM_WS_CLAIMS + "denyonlysid": "denyOnlySid",
MS_CLAIMS + "authenticationmethod": "authenticationMethod",
MS_CLAIMS + "denyonlyprimarygroupsid": "denyOnlyPrimaryGroupSid",
MS_CLAIMS + "denyonlyprimarysid": "denyOnlyPrimarySid",
MS_CLAIMS + "groupsid": "groupSid",
MS_CLAIMS + "primarygroupsid": "primaryGroupSid",
MS_CLAIMS + "primarysid": "primarySid",
MS_CLAIMS + "role": "role",
MS_CLAIMS + "windowsaccountname": "windowsAccountName",
ORG_WS_CLAIMS + "emailaddress": "emailAddress",
ORG_WS_CLAIMS + "givenname": "givenName",
ORG_WS_CLAIMS + "name": "name",
ORG_WS_CLAIMS + "nameidentifier": "nameId",
ORG_WS_CLAIMS + "privatepersonalidentifier": "privatePersonalId",
ORG_WS_CLAIMS + "surname": "surname",
ORG_WS_CLAIMS + "upn": "upn",
f"{CLAIMS}commonname": "commonName",
f"{CLAIMS}group": "group",
f"{COM_WS_CLAIMS}denyonlysid": "denyOnlySid",
f"{MS_CLAIMS}authenticationmethod": "authenticationMethod",
f"{MS_CLAIMS}denyonlyprimarygroupsid": "denyOnlyPrimaryGroupSid",
f"{MS_CLAIMS}denyonlyprimarysid": "denyOnlyPrimarySid",
f"{MS_CLAIMS}groupsid": "groupSid",
f"{MS_CLAIMS}primarygroupsid": "primaryGroupSid",
f"{MS_CLAIMS}primarysid": "primarySid",
f"{MS_CLAIMS}role": "role",
f"{MS_CLAIMS}windowsaccountname": "windowsAccountName",
f"{ORG_WS_CLAIMS}emailaddress": "emailAddress",
f"{ORG_WS_CLAIMS}givenname": "givenName",
f"{ORG_WS_CLAIMS}name": "name",
f"{ORG_WS_CLAIMS}nameidentifier": "nameId",
f"{ORG_WS_CLAIMS}privatepersonalidentifier": "privatePersonalId",
f"{ORG_WS_CLAIMS}surname": "surname",
f"{ORG_WS_CLAIMS}upn": "upn",
},
"to": {
"authenticationMethod": MS_CLAIMS + "authenticationmethod",
"commonName": CLAIMS + "commonname",
"denyOnlyPrimaryGroupSid": MS_CLAIMS + "denyonlyprimarygroupsid",
"denyOnlyPrimarySid": MS_CLAIMS + "denyonlyprimarysid",
"denyOnlySid": COM_WS_CLAIMS + "denyonlysid",
"emailAddress": ORG_WS_CLAIMS + "emailaddress",
"givenName": ORG_WS_CLAIMS + "givenname",
"group": CLAIMS + "group",
"groupSid": MS_CLAIMS + "groupsid",
"name": ORG_WS_CLAIMS + "name",
"nameId": ORG_WS_CLAIMS + "nameidentifier",
"primaryGroupSid": MS_CLAIMS + "primarygroupsid",
"primarySid": MS_CLAIMS + "primarysid",
"privatePersonalId": ORG_WS_CLAIMS + "privatepersonalidentifier",
"role": MS_CLAIMS + "role",
"surname": ORG_WS_CLAIMS + "surname",
"upn": ORG_WS_CLAIMS + "upn",
"windowsAccountName": MS_CLAIMS + "windowsaccountname",
"authenticationMethod": f"{MS_CLAIMS}authenticationmethod",
"commonName": f"{CLAIMS}commonname",
"denyOnlyPrimaryGroupSid": f"{MS_CLAIMS}denyonlyprimarygroupsid",
"denyOnlyPrimarySid": f"{MS_CLAIMS}denyonlyprimarysid",
"denyOnlySid": f"{COM_WS_CLAIMS}denyonlysid",
"emailAddress": f"{ORG_WS_CLAIMS}emailaddress",
"givenName": f"{ORG_WS_CLAIMS}givenname",
"group": f"{CLAIMS}group",
"groupSid": f"{MS_CLAIMS}groupsid",
"name": f"{ORG_WS_CLAIMS}name",
"nameId": f"{ORG_WS_CLAIMS}nameidentifier",
"primaryGroupSid": f"{MS_CLAIMS}primarygroupsid",
"primarySid": f"{MS_CLAIMS}primarysid",
"privatePersonalId": f"{ORG_WS_CLAIMS}privatepersonalidentifier",
"role": f"{MS_CLAIMS}role",
"surname": f"{ORG_WS_CLAIMS}surname",
"upn": f"{ORG_WS_CLAIMS}upn",
"windowsAccountName": f"{MS_CLAIMS}windowsaccountname",
},
}
Loading

0 comments on commit 0afbf17

Please sign in to comment.