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.
 
 
 

232 lines
9.0 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 = \
  44. "http://www.w3.org/TR/2000/CR-xml-c14n-20010315#WithComments"
  45. C14N_EXCL = "http://www.w3.org/2001/10/xml-exc-c14n#"
  46. DIGEST_MD2 = "http://www.w3.org/2000/09/xmldsig#md2"
  47. DIGEST_MD5 = "http://www.w3.org/2000/09/xmldsig#md5"
  48. DIGEST_SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1"
  49. ENC_BASE64 = "http://www.w3.org/2000/09/xmldsig#base64"
  50. ENVELOPED = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
  51. HMAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1"
  52. SIG_DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
  53. SIG_RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
  54. XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116"
  55. XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116"
  56. class ENCRYPTION:
  57. BASE = "http://www.w3.org/2001/04/xmlenc#"
  58. BLOCK_3DES = "http://www.w3.org/2001/04/xmlenc#des-cbc"
  59. BLOCK_AES128 = "http://www.w3.org/2001/04/xmlenc#aes128-cbc"
  60. BLOCK_AES192 = "http://www.w3.org/2001/04/xmlenc#aes192-cbc"
  61. BLOCK_AES256 = "http://www.w3.org/2001/04/xmlenc#aes256-cbc"
  62. DIGEST_RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160"
  63. DIGEST_SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256"
  64. DIGEST_SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512"
  65. KA_DH = "http://www.w3.org/2001/04/xmlenc#dh"
  66. KT_RSA_1_5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5"
  67. KT_RSA_OAEP = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
  68. STREAM_ARCFOUR = "http://www.w3.org/2001/04/xmlenc#arcfour"
  69. WRAP_3DES = "http://www.w3.org/2001/04/xmlenc#kw-3des"
  70. WRAP_AES128 = "http://www.w3.org/2001/04/xmlenc#kw-aes128"
  71. WRAP_AES192 = "http://www.w3.org/2001/04/xmlenc#kw-aes192"
  72. WRAP_AES256 = "http://www.w3.org/2001/04/xmlenc#kw-aes256"
  73. class WSRF_V1_2:
  74. '''
  75. OASIS WSRF Specifications Version 1.2
  76. '''
  77. class LIFETIME:
  78. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
  79. XSD_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.xsd"
  80. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
  81. WSDL_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.wsdl"
  82. LATEST = WSDL_DRAFT4
  83. WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT4)
  84. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT4)
  85. class PROPERTIES:
  86. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
  87. XSD_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"
  88. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
  89. WSDL_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.wsdl"
  90. LATEST = WSDL_DRAFT5
  91. WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT5)
  92. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT5)
  93. class BASENOTIFICATION:
  94. XSD_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
  95. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl"
  96. LATEST = WSDL_DRAFT1
  97. WSDL_LIST = (WSDL_DRAFT1,)
  98. XSD_LIST = (XSD_DRAFT1,)
  99. class BASEFAULTS:
  100. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd"
  101. XSD_DRAFT3 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-BaseFaults-1.2-draft-03.xsd"
  102. # LATEST = DRAFT3
  103. # WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT3)
  104. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT3)
  105. WSRF = WSRF_V1_2
  106. WSRFLIST = (WSRF_V1_2,)
  107. class OASIS:
  108. '''URLs for Oasis specifications
  109. '''
  110. WSSE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
  111. UTILITY = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  112. class X509TOKEN:
  113. Base64Binary = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
  114. STRTransform = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0"
  115. PKCS7 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#PKCS7"
  116. X509 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509"
  117. X509PKIPathv1 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"
  118. X509v3SubjectKeyIdentifier = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3SubjectKeyIdentifier"
  119. LIFETIME = WSRF_V1_2.LIFETIME.XSD_DRAFT1
  120. PROPERTIES = WSRF_V1_2.PROPERTIES.XSD_DRAFT1
  121. BASENOTIFICATION = WSRF_V1_2.BASENOTIFICATION.XSD_DRAFT1
  122. BASEFAULTS = WSRF_V1_2.BASEFAULTS.XSD_DRAFT1
  123. class APACHE:
  124. '''
  125. This name space is defined by AXIS and it is used for the TC in
  126. TCapache.py, Map and file attachment (DataHandler)
  127. '''
  128. AXIS_NS = "http://xml.apache.org/xml-soap"
  129. class WSTRUST:
  130. BASE = "http://schemas.xmlsoap.org/ws/2004/04/trust"
  131. ISSUE = "http://schemas.xmlsoap.org/ws/2004/04/trust/Issue"
  132. class WSSE:
  133. BASE = "http://schemas.xmlsoap.org/ws/2002/04/secext"
  134. TRUST = WSTRUST.BASE
  135. class WSU:
  136. BASE = "http://schemas.xmlsoap.org/ws/2002/04/utility"
  137. UTILITY = "http://schemas.xmlsoap.org/ws/2002/07/utility"
  138. class WSR:
  139. PROPERTIES = \
  140. "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceProperties"
  141. LIFETIME = \
  142. "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime"
  143. class WSA200508:
  144. ADDRESS = "http://www.w3.org/2005/08/addressing"
  145. ANONYMOUS = "%s/anonymous" % ADDRESS
  146. FAULT = "%s/fault" % ADDRESS
  147. class WSA200408:
  148. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/08/addressing"
  149. ANONYMOUS = "%s/role/anonymous" % ADDRESS
  150. FAULT = "%s/fault" % ADDRESS
  151. class WSA200403:
  152. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/03/addressing"
  153. ANONYMOUS = "%s/role/anonymous" % ADDRESS
  154. FAULT = "%s/fault" % ADDRESS
  155. class WSA200303:
  156. ADDRESS = "http://schemas.xmlsoap.org/ws/2003/03/addressing"
  157. ANONYMOUS = "%s/role/anonymous" % ADDRESS
  158. FAULT = None
  159. WSA = WSA200408
  160. WSA_LIST = (WSA200508, WSA200408, WSA200403, WSA200303)
  161. class _WSAW(str):
  162. """
  163. Define ADDRESS attribute to be compatible with WSA* layout
  164. """
  165. ADDRESS = property(lambda s: s)
  166. WSAW200605 = _WSAW("http://www.w3.org/2006/05/addressing/wsdl")
  167. WSAW_LIST = (WSAW200605,)
  168. class WSP:
  169. POLICY = "http://schemas.xmlsoap.org/ws/2002/12/policy"
  170. class BEA:
  171. SECCONV = "http://schemas.xmlsoap.org/ws/2004/04/sc"
  172. SCTOKEN = "http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct"
  173. class GLOBUS:
  174. SECCONV = "http://wsrf.globus.org/core/2004/07/security/secconv"
  175. CORE = "http://www.globus.org/namespaces/2004/06/core"
  176. SIG = "http://www.globus.org/2002/04/xmlenc#gssapi-sign"
  177. TOKEN = "http://www.globus.org/ws/2004/09/security/sc#GSSAPI_GSI_TOKEN"
  178. ZSI_SCHEMA_URI = 'http://www.zolera.com/schemas/ZSI/'