You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

195 lines
8.6 KiB

  1. # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
  2. #
  3. # This software is subject to the provisions of the Zope Public License,
  4. # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
  5. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
  6. # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  7. # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
  8. # FOR A PARTICULAR PURPOSE.
  9. """Namespace module, so you don't need PyXML
  10. """
  11. ident = "$Id$"
  12. try:
  13. from xml.ns import SOAP, SCHEMA, WSDL, XMLNS, DSIG, ENCRYPTION
  14. DSIG.C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
  15. except:
  16. class SOAP:
  17. ENV = "http://schemas.xmlsoap.org/soap/envelope/"
  18. ENC = "http://schemas.xmlsoap.org/soap/encoding/"
  19. ACTOR_NEXT = "http://schemas.xmlsoap.org/soap/actor/next"
  20. class SCHEMA:
  21. XSD1 = "http://www.w3.org/1999/XMLSchema"
  22. XSD2 = "http://www.w3.org/2000/10/XMLSchema"
  23. XSD3 = "http://www.w3.org/2001/XMLSchema"
  24. XSD_LIST = [ XSD1, XSD2, XSD3 ]
  25. XSI1 = "http://www.w3.org/1999/XMLSchema-instance"
  26. XSI2 = "http://www.w3.org/2000/10/XMLSchema-instance"
  27. XSI3 = "http://www.w3.org/2001/XMLSchema-instance"
  28. XSI_LIST = [ XSI1, XSI2, XSI3 ]
  29. BASE = XSD3
  30. class WSDL:
  31. BASE = "http://schemas.xmlsoap.org/wsdl/"
  32. BIND_HTTP = "http://schemas.xmlsoap.org/wsdl/http/"
  33. BIND_MIME = "http://schemas.xmlsoap.org/wsdl/mime/"
  34. BIND_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/"
  35. BIND_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/"
  36. class XMLNS:
  37. BASE = "http://www.w3.org/2000/xmlns/"
  38. XML = "http://www.w3.org/XML/1998/namespace"
  39. HTML = "http://www.w3.org/TR/REC-html40"
  40. class DSIG:
  41. BASE = "http://www.w3.org/2000/09/xmldsig#"
  42. C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
  43. C14N_COMM = "http://www.w3.org/TR/2000/CR-xml-c14n-20010315#WithComments"
  44. C14N_EXCL = "http://www.w3.org/2001/10/xml-exc-c14n#"
  45. DIGEST_MD2 = "http://www.w3.org/2000/09/xmldsig#md2"
  46. DIGEST_MD5 = "http://www.w3.org/2000/09/xmldsig#md5"
  47. DIGEST_SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1"
  48. ENC_BASE64 = "http://www.w3.org/2000/09/xmldsig#base64"
  49. ENVELOPED = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
  50. HMAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1"
  51. SIG_DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
  52. SIG_RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
  53. XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116"
  54. XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116"
  55. class ENCRYPTION:
  56. BASE = "http://www.w3.org/2001/04/xmlenc#"
  57. BLOCK_3DES = "http://www.w3.org/2001/04/xmlenc#des-cbc"
  58. BLOCK_AES128 = "http://www.w3.org/2001/04/xmlenc#aes128-cbc"
  59. BLOCK_AES192 = "http://www.w3.org/2001/04/xmlenc#aes192-cbc"
  60. BLOCK_AES256 = "http://www.w3.org/2001/04/xmlenc#aes256-cbc"
  61. DIGEST_RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160"
  62. DIGEST_SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256"
  63. DIGEST_SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512"
  64. KA_DH = "http://www.w3.org/2001/04/xmlenc#dh"
  65. KT_RSA_1_5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5"
  66. KT_RSA_OAEP = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
  67. STREAM_ARCFOUR = "http://www.w3.org/2001/04/xmlenc#arcfour"
  68. WRAP_3DES = "http://www.w3.org/2001/04/xmlenc#kw-3des"
  69. WRAP_AES128 = "http://www.w3.org/2001/04/xmlenc#kw-aes128"
  70. WRAP_AES192 = "http://www.w3.org/2001/04/xmlenc#kw-aes192"
  71. WRAP_AES256 = "http://www.w3.org/2001/04/xmlenc#kw-aes256"
  72. class WSRF_V1_2:
  73. '''OASIS WSRF Specifications Version 1.2
  74. '''
  75. class LIFETIME:
  76. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
  77. XSD_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.xsd"
  78. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
  79. WSDL_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.wsdl"
  80. LATEST = WSDL_DRAFT4
  81. WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT4)
  82. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT4)
  83. class PROPERTIES:
  84. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
  85. XSD_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"
  86. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
  87. WSDL_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.wsdl"
  88. LATEST = WSDL_DRAFT5
  89. WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT5)
  90. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT5)
  91. class BASENOTIFICATION:
  92. XSD_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
  93. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl"
  94. LATEST = WSDL_DRAFT1
  95. WSDL_LIST = (WSDL_DRAFT1,)
  96. XSD_LIST = (XSD_DRAFT1,)
  97. class BASEFAULTS:
  98. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd"
  99. XSD_DRAFT3 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-BaseFaults-1.2-draft-03.xsd"
  100. #LATEST = DRAFT3
  101. #WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT3)
  102. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT3)
  103. WSRF = WSRF_V1_2
  104. WSRFLIST = (WSRF_V1_2,)
  105. class OASIS:
  106. '''URLs for Oasis specifications
  107. '''
  108. WSSE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
  109. UTILITY = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  110. class X509TOKEN:
  111. Base64Binary = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
  112. STRTransform = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0"
  113. PKCS7 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#PKCS7"
  114. X509 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509"
  115. X509PKIPathv1 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"
  116. X509v3SubjectKeyIdentifier = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3SubjectKeyIdentifier"
  117. LIFETIME = WSRF_V1_2.LIFETIME.XSD_DRAFT1
  118. PROPERTIES = WSRF_V1_2.PROPERTIES.XSD_DRAFT1
  119. BASENOTIFICATION = WSRF_V1_2.BASENOTIFICATION.XSD_DRAFT1
  120. BASEFAULTS = WSRF_V1_2.BASEFAULTS.XSD_DRAFT1
  121. class WSTRUST:
  122. BASE = "http://schemas.xmlsoap.org/ws/2004/04/trust"
  123. ISSUE = "http://schemas.xmlsoap.org/ws/2004/04/trust/Issue"
  124. class WSSE:
  125. BASE = "http://schemas.xmlsoap.org/ws/2002/04/secext"
  126. TRUST = WSTRUST.BASE
  127. class WSU:
  128. BASE = "http://schemas.xmlsoap.org/ws/2002/04/utility"
  129. UTILITY = "http://schemas.xmlsoap.org/ws/2002/07/utility"
  130. class WSR:
  131. PROPERTIES = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceProperties"
  132. LIFETIME = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime"
  133. class WSA200408:
  134. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/08/addressing"
  135. ANONYMOUS = "%s/role/anonymous" %ADDRESS
  136. FAULT = "%s/fault" %ADDRESS
  137. class WSA200403:
  138. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/03/addressing"
  139. ANONYMOUS = "%s/role/anonymous" %ADDRESS
  140. FAULT = "%s/fault" %ADDRESS
  141. class WSA200303:
  142. ADDRESS = "http://schemas.xmlsoap.org/ws/2003/03/addressing"
  143. ANONYMOUS = "%s/role/anonymous" %ADDRESS
  144. FAULT = None
  145. WSA = WSA200408
  146. WSA_LIST = (WSA200408, WSA200403, WSA200303)
  147. class WSP:
  148. POLICY = "http://schemas.xmlsoap.org/ws/2002/12/policy"
  149. class BEA:
  150. SECCONV = "http://schemas.xmlsoap.org/ws/2004/04/sc"
  151. SCTOKEN = "http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct"
  152. class GLOBUS:
  153. SECCONV = "http://wsrf.globus.org/core/2004/07/security/secconv"
  154. CORE = "http://www.globus.org/namespaces/2004/06/core"
  155. SIG = "http://www.globus.org/2002/04/xmlenc#gssapi-sign"
  156. TOKEN = "http://www.globus.org/ws/2004/09/security/sc#GSSAPI_GSI_TOKEN"
  157. ZSI_SCHEMA_URI = 'http://www.zolera.com/schemas/ZSI/'