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.
 
 
 

251 lines
9.2 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/"
  79. "wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
  80. XSD_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/"
  81. "wsrf-WS-ResourceLifetime-1.2-draft-04.xsd"
  82. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/"
  83. "wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
  84. WSDL_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/"
  85. "wsrf-WS-ResourceLifetime-1.2-draft-04.wsdl"
  86. LATEST = WSDL_DRAFT4
  87. WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT4)
  88. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT4)
  89. class PROPERTIES:
  90. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/"
  91. "wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
  92. XSD_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/"
  93. "wsrf-WS-ResourceProperties-1.2-draft-05.xsd"
  94. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/"
  95. "wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
  96. WSDL_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/"
  97. "wsrf-WS-ResourceProperties-1.2-draft-05.wsdl"
  98. LATEST = WSDL_DRAFT5
  99. WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT5)
  100. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT5)
  101. class BASENOTIFICATION:
  102. XSD_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/"
  103. "wsn-WS-BaseNotification-1.2-draft-01.xsd"
  104. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/"
  105. "wsn-WS-BaseNotification-1.2-draft-01.wsdl"
  106. LATEST = WSDL_DRAFT1
  107. WSDL_LIST = (WSDL_DRAFT1,)
  108. XSD_LIST = (XSD_DRAFT1,)
  109. class BASEFAULTS:
  110. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/"
  111. "wsrf-WS-BaseFaults-1.2-draft-01.xsd"
  112. XSD_DRAFT3 = "http://docs.oasis-open.org/wsrf/2004/11/"
  113. "wsrf-WS-BaseFaults-1.2-draft-03.xsd"
  114. # LATEST = DRAFT3
  115. # WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT3)
  116. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT3)
  117. WSRF = WSRF_V1_2
  118. WSRFLIST = (WSRF_V1_2,)
  119. class OASIS:
  120. '''URLs for Oasis specifications
  121. '''
  122. WSSE = "http://docs.oasis-open.org/wss/2004/01/"
  123. "oasis-200401-wss-wssecurity-secext-1.0.xsd"
  124. UTILITY = "http://docs.oasis-open.org/wss/2004/01/"
  125. "oasis-200401-wss-wssecurity-utility-1.0.xsd"
  126. class X509TOKEN:
  127. Base64Binary = "http://docs.oasis-open.org/wss/2004/01/"
  128. "oasis-200401-wss-soap-message-security-1.0#Base64Binary"
  129. STRTransform = "http://docs.oasis-open.org/wss/2004/01/"
  130. "oasis-200401-wss-soap-message-security-1.0"
  131. PKCS7 = "http://docs.oasis-open.org/wss/2004/01/"
  132. "oasis-200401-wss-x509-token-profile-1.0#PKCS7"
  133. X509 = "http://docs.oasis-open.org/wss/2004/01/"
  134. "oasis-200401-wss-x509-token-profile-1.0#X509"
  135. X509PKIPathv1 = "http://docs.oasis-open.org/wss/2004/01/"
  136. "oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"
  137. X509v3SubjectKeyIdentifier = "http://docs.oasis-open.org/wss/2004/01/"
  138. "oasis-200401-wss-x509-token-profile-1.0#X509v3SubjectKeyIdentifier"
  139. LIFETIME = WSRF_V1_2.LIFETIME.XSD_DRAFT1
  140. PROPERTIES = WSRF_V1_2.PROPERTIES.XSD_DRAFT1
  141. BASENOTIFICATION = WSRF_V1_2.BASENOTIFICATION.XSD_DRAFT1
  142. BASEFAULTS = WSRF_V1_2.BASEFAULTS.XSD_DRAFT1
  143. class APACHE:
  144. '''
  145. This name space is defined by AXIS and it is used for the TC in
  146. TCapache.py, Map and file attachment (DataHandler)
  147. '''
  148. AXIS_NS = "http://xml.apache.org/xml-soap"
  149. class WSTRUST:
  150. BASE = "http://schemas.xmlsoap.org/ws/2004/04/trust"
  151. ISSUE = "http://schemas.xmlsoap.org/ws/2004/04/trust/Issue"
  152. class WSSE:
  153. BASE = "http://schemas.xmlsoap.org/ws/2002/04/secext"
  154. TRUST = WSTRUST.BASE
  155. class WSU:
  156. BASE = "http://schemas.xmlsoap.org/ws/2002/04/utility"
  157. UTILITY = "http://schemas.xmlsoap.org/ws/2002/07/utility"
  158. class WSR:
  159. PROPERTIES = \
  160. "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceProperties"
  161. LIFETIME = \
  162. "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime"
  163. class WSA200508:
  164. ADDRESS = "http://www.w3.org/2005/08/addressing"
  165. ANONYMOUS = "%s/anonymous" % ADDRESS
  166. FAULT = "%s/fault" % ADDRESS
  167. class WSA200408:
  168. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/08/addressing"
  169. ANONYMOUS = "%s/role/anonymous" % ADDRESS
  170. FAULT = "%s/fault" % ADDRESS
  171. class WSA200403:
  172. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/03/addressing"
  173. ANONYMOUS = "%s/role/anonymous" % ADDRESS
  174. FAULT = "%s/fault" % ADDRESS
  175. class WSA200303:
  176. ADDRESS = "http://schemas.xmlsoap.org/ws/2003/03/addressing"
  177. ANONYMOUS = "%s/role/anonymous" % ADDRESS
  178. FAULT = None
  179. WSA = WSA200408
  180. WSA_LIST = (WSA200508, WSA200408, WSA200403, WSA200303)
  181. class _WSAW(str):
  182. """
  183. Define ADDRESS attribute to be compatible with WSA* layout
  184. """
  185. ADDRESS = property(lambda s: s)
  186. WSAW200605 = _WSAW("http://www.w3.org/2006/05/addressing/wsdl")
  187. WSAW_LIST = (WSAW200605,)
  188. class WSP:
  189. POLICY = "http://schemas.xmlsoap.org/ws/2002/12/policy"
  190. class BEA:
  191. SECCONV = "http://schemas.xmlsoap.org/ws/2004/04/sc"
  192. SCTOKEN = "http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct"
  193. class GLOBUS:
  194. SECCONV = "http://wsrf.globus.org/core/2004/07/security/secconv"
  195. CORE = "http://www.globus.org/namespaces/2004/06/core"
  196. SIG = "http://www.globus.org/2002/04/xmlenc#gssapi-sign"
  197. TOKEN = "http://www.globus.org/ws/2004/09/security/sc#GSSAPI_GSI_TOKEN"
  198. ZSI_SCHEMA_URI = 'http://www.zolera.com/schemas/ZSI/'