Skip to content

Commit 9bdb09e

Browse files
authored
Sanitize flagged URLs (#956)
1 parent 1416438 commit 9bdb09e

3 files changed

Lines changed: 31 additions & 37 deletions

File tree

‎msal/__main__.py‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,7 @@ def _remove_tokens_for_client(app):
216216

217217
def _exit(app):
218218
"""Exit"""
219-
bug_link = (
220-
"https://identitydivision.visualstudio.com/Engineering/_queries/query/79b3a352-a775-406f-87cd-a487c382a8ed/"
221-
if app._enable_broker else
222-
"https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/new/choose"
223-
)
219+
bug_link = "https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/new/choose"
224220
print("Bye. If you found a bug, please report it here: {}".format(bug_link))
225221
sys.exit()
226222

@@ -334,4 +330,3 @@ def _main():
334330

335331
if __name__ == "__main__":
336332
_main()
337-

‎tests/microsoft.mex.xml‎

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,9 @@
648648
</wsp:Policy>
649649
<wsdl:types>
650650
<xsd:schema targetNamespace="http://schemas.microsoft.com/ws/2008/06/identity/securitytokenservice/Imports">
651-
<xsd:import schemaLocation="https://corp.sts.microsoft.com/adfs/services/trust/mex?xsd=xsd0" namespace="http://schemas.microsoft.com/Message"/>
652-
<xsd:import schemaLocation="https://corp.sts.microsoft.com/adfs/services/trust/mex?xsd=xsd1" namespace="http://schemas.xmlsoap.org/ws/2005/02/trust"/>
653-
<xsd:import schemaLocation="https://corp.sts.microsoft.com/adfs/services/trust/mex?xsd=xsd2" namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512"/>
651+
<xsd:import schemaLocation="https://example.com/adfs/services/trust/mex?xsd=xsd0" namespace="http://schemas.microsoft.com/Message"/>
652+
<xsd:import schemaLocation="https://example.com/adfs/services/trust/mex?xsd=xsd1" namespace="http://schemas.xmlsoap.org/ws/2005/02/trust"/>
653+
<xsd:import schemaLocation="https://example.com/adfs/services/trust/mex?xsd=xsd2" namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512"/>
654654
</xsd:schema>
655655
</wsdl:types>
656656
<wsdl:message name="IWSTrustFeb2005Async_TrustFeb2005IssueAsync_InputMessage">
@@ -835,80 +835,80 @@
835835
</wsdl:binding>
836836
<wsdl:service name="SecurityTokenService">
837837
<wsdl:port name="CustomBinding_IWSTrustFeb2005Async" binding="tns:CustomBinding_IWSTrustFeb2005Async">
838-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/2005/windowstransport"/>
838+
<soap12:address location="https://example.com/adfs/services/trust/2005/windowstransport"/>
839839
<wsa10:EndpointReference>
840-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/2005/windowstransport</wsa10:Address>
840+
<wsa10:Address>https://example.com/adfs/services/trust/2005/windowstransport</wsa10:Address>
841841
<Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
842-
<Upn>iamfed@redmond.corp.microsoft.com</Upn>
842+
<Upn>iamfed@example.com</Upn>
843843
</Identity>
844844
</wsa10:EndpointReference>
845845
</wsdl:port>
846846
<wsdl:port name="CertificateWSTrustBinding_IWSTrustFeb2005Async" binding="tns:CertificateWSTrustBinding_IWSTrustFeb2005Async">
847-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/2005/certificatemixed"/>
847+
<soap12:address location="https://example.com/adfs/services/trust/2005/certificatemixed"/>
848848
<wsa10:EndpointReference>
849-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/2005/certificatemixed</wsa10:Address>
849+
<wsa10:Address>https://example.com/adfs/services/trust/2005/certificatemixed</wsa10:Address>
850850
</wsa10:EndpointReference>
851851
</wsdl:port>
852852
<wsdl:port name="UserNameWSTrustBinding_IWSTrustFeb2005Async" binding="tns:UserNameWSTrustBinding_IWSTrustFeb2005Async">
853-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/2005/usernamemixed"/>
853+
<soap12:address location="https://example.com/adfs/services/trust/2005/usernamemixed"/>
854854
<wsa10:EndpointReference>
855-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/2005/usernamemixed</wsa10:Address>
855+
<wsa10:Address>https://example.com/adfs/services/trust/2005/usernamemixed</wsa10:Address>
856856
</wsa10:EndpointReference>
857857
</wsdl:port>
858858
<wsdl:port name="CustomBinding_IWSTrustFeb2005Async1" binding="tns:CustomBinding_IWSTrustFeb2005Async1">
859-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/2005/kerberosmixed"/>
859+
<soap12:address location="https://example.com/adfs/services/trust/2005/kerberosmixed"/>
860860
<wsa10:EndpointReference>
861-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/2005/kerberosmixed</wsa10:Address>
861+
<wsa10:Address>https://example.com/adfs/services/trust/2005/kerberosmixed</wsa10:Address>
862862
</wsa10:EndpointReference>
863863
</wsdl:port>
864864
<wsdl:port name="IssuedTokenWSTrustBinding_IWSTrustFeb2005Async" binding="tns:IssuedTokenWSTrustBinding_IWSTrustFeb2005Async">
865-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/2005/issuedtokenmixedasymmetricbasic256"/>
865+
<soap12:address location="https://example.com/adfs/services/trust/2005/issuedtokenmixedasymmetricbasic256"/>
866866
<wsa10:EndpointReference>
867-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/2005/issuedtokenmixedasymmetricbasic256</wsa10:Address>
867+
<wsa10:Address>https://example.com/adfs/services/trust/2005/issuedtokenmixedasymmetricbasic256</wsa10:Address>
868868
</wsa10:EndpointReference>
869869
</wsdl:port>
870870
<wsdl:port name="IssuedTokenWSTrustBinding_IWSTrustFeb2005Async1" binding="tns:IssuedTokenWSTrustBinding_IWSTrustFeb2005Async1">
871-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/2005/issuedtokenmixedsymmetricbasic256"/>
871+
<soap12:address location="https://example.com/adfs/services/trust/2005/issuedtokenmixedsymmetricbasic256"/>
872872
<wsa10:EndpointReference>
873-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/2005/issuedtokenmixedsymmetricbasic256</wsa10:Address>
873+
<wsa10:Address>https://example.com/adfs/services/trust/2005/issuedtokenmixedsymmetricbasic256</wsa10:Address>
874874
</wsa10:EndpointReference>
875875
</wsdl:port>
876876
<wsdl:port name="CustomBinding_IWSTrust13Async" binding="tns:CustomBinding_IWSTrust13Async">
877-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/13/kerberosmixed"/>
877+
<soap12:address location="https://example.com/adfs/services/trust/13/kerberosmixed"/>
878878
<wsa10:EndpointReference>
879-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/13/kerberosmixed</wsa10:Address>
879+
<wsa10:Address>https://example.com/adfs/services/trust/13/kerberosmixed</wsa10:Address>
880880
</wsa10:EndpointReference>
881881
</wsdl:port>
882882
<wsdl:port name="CertificateWSTrustBinding_IWSTrust13Async" binding="tns:CertificateWSTrustBinding_IWSTrust13Async">
883-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/13/certificatemixed"/>
883+
<soap12:address location="https://example.com/adfs/services/trust/13/certificatemixed"/>
884884
<wsa10:EndpointReference>
885-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/13/certificatemixed</wsa10:Address>
885+
<wsa10:Address>https://example.com/adfs/services/trust/13/certificatemixed</wsa10:Address>
886886
</wsa10:EndpointReference>
887887
</wsdl:port>
888888
<wsdl:port name="UserNameWSTrustBinding_IWSTrust13Async" binding="tns:UserNameWSTrustBinding_IWSTrust13Async">
889-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/13/usernamemixed"/>
889+
<soap12:address location="https://example.com/adfs/services/trust/13/usernamemixed"/>
890890
<wsa10:EndpointReference>
891-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/13/usernamemixed</wsa10:Address>
891+
<wsa10:Address>https://example.com/adfs/services/trust/13/usernamemixed</wsa10:Address>
892892
</wsa10:EndpointReference>
893893
</wsdl:port>
894894
<wsdl:port name="IssuedTokenWSTrustBinding_IWSTrust13Async" binding="tns:IssuedTokenWSTrustBinding_IWSTrust13Async">
895-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/13/issuedtokenmixedasymmetricbasic256"/>
895+
<soap12:address location="https://example.com/adfs/services/trust/13/issuedtokenmixedasymmetricbasic256"/>
896896
<wsa10:EndpointReference>
897-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/13/issuedtokenmixedasymmetricbasic256</wsa10:Address>
897+
<wsa10:Address>https://example.com/adfs/services/trust/13/issuedtokenmixedasymmetricbasic256</wsa10:Address>
898898
</wsa10:EndpointReference>
899899
</wsdl:port>
900900
<wsdl:port name="IssuedTokenWSTrustBinding_IWSTrust13Async1" binding="tns:IssuedTokenWSTrustBinding_IWSTrust13Async1">
901-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/13/issuedtokenmixedsymmetricbasic256"/>
901+
<soap12:address location="https://example.com/adfs/services/trust/13/issuedtokenmixedsymmetricbasic256"/>
902902
<wsa10:EndpointReference>
903-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/13/issuedtokenmixedsymmetricbasic256</wsa10:Address>
903+
<wsa10:Address>https://example.com/adfs/services/trust/13/issuedtokenmixedsymmetricbasic256</wsa10:Address>
904904
</wsa10:EndpointReference>
905905
</wsdl:port>
906906
<wsdl:port name="CustomBinding_IWSTrust13Async1" binding="tns:CustomBinding_IWSTrust13Async1">
907-
<soap12:address location="https://corp.sts.microsoft.com/adfs/services/trust/13/windowstransport"/>
907+
<soap12:address location="https://example.com/adfs/services/trust/13/windowstransport"/>
908908
<wsa10:EndpointReference>
909-
<wsa10:Address>https://corp.sts.microsoft.com/adfs/services/trust/13/windowstransport</wsa10:Address>
909+
<wsa10:Address>https://example.com/adfs/services/trust/13/windowstransport</wsa10:Address>
910910
<Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
911-
<Upn>iamfed@redmond.corp.microsoft.com</Upn>
911+
<Upn>iamfed@example.com</Upn>
912912
</Identity>
913913
</wsa10:EndpointReference>
914914
</wsdl:port>

‎tests/test_mex.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _test_parser(self, sample, expected_endpoint):
1616

1717
def test_happy_path_1(self):
1818
self._test_parser("microsoft.mex.xml",
19-
'https://corp.sts.microsoft.com/adfs/services/trust/13/usernamemixed')
19+
'https://example.com/adfs/services/trust/13/usernamemixed')
2020

2121
def test_happy_path_2(self):
2222
self._test_parser('arupela.mex.xml',
@@ -25,4 +25,3 @@ def test_happy_path_2(self):
2525
def test_happy_path_3(self):
2626
self._test_parser('archan.us.mex.xml',
2727
'https://arvmserver2012.archan.us/adfs/services/trust/13/usernamemixed')
28-

0 commit comments

Comments
 (0)