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.
 
 
 

210 lines
9.1 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. #AXIS attachment implementation details
  25. AXIS = "http://xml.apache.org/xml-soap"
  26. XSD_LIST = [ XSD1, XSD2, XSD3, AXIS]
  27. XSI1 = "http://www.w3.org/1999/XMLSchema-instance"
  28. XSI2 = "http://www.w3.org/2000/10/XMLSchema-instance"
  29. XSI3 = "http://www.w3.org/2001/XMLSchema-instance"
  30. XSI_LIST = [ XSI1, XSI2, XSI3 ]
  31. BASE = XSD3
  32. class WSDL:
  33. BASE = "http://schemas.xmlsoap.org/wsdl/"
  34. BIND_HTTP = "http://schemas.xmlsoap.org/wsdl/http/"
  35. BIND_MIME = "http://schemas.xmlsoap.org/wsdl/mime/"
  36. BIND_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/"
  37. BIND_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/"
  38. class XMLNS:
  39. BASE = "http://www.w3.org/2000/xmlns/"
  40. XML = "http://www.w3.org/XML/1998/namespace"
  41. HTML = "http://www.w3.org/TR/REC-html40"
  42. class DSIG:
  43. BASE = "http://www.w3.org/2000/09/xmldsig#"
  44. C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
  45. C14N_COMM = "http://www.w3.org/TR/2000/CR-xml-c14n-20010315#WithComments"
  46. C14N_EXCL = "http://www.w3.org/2001/10/xml-exc-c14n#"
  47. DIGEST_MD2 = "http://www.w3.org/2000/09/xmldsig#md2"
  48. DIGEST_MD5 = "http://www.w3.org/2000/09/xmldsig#md5"
  49. DIGEST_SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1"
  50. ENC_BASE64 = "http://www.w3.org/2000/09/xmldsig#base64"
  51. ENVELOPED = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
  52. HMAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1"
  53. SIG_DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
  54. SIG_RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
  55. XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116"
  56. XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116"
  57. class ENCRYPTION:
  58. BASE = "http://www.w3.org/2001/04/xmlenc#"
  59. BLOCK_3DES = "http://www.w3.org/2001/04/xmlenc#des-cbc"
  60. BLOCK_AES128 = "http://www.w3.org/2001/04/xmlenc#aes128-cbc"
  61. BLOCK_AES192 = "http://www.w3.org/2001/04/xmlenc#aes192-cbc"
  62. BLOCK_AES256 = "http://www.w3.org/2001/04/xmlenc#aes256-cbc"
  63. DIGEST_RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160"
  64. DIGEST_SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256"
  65. DIGEST_SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512"
  66. KA_DH = "http://www.w3.org/2001/04/xmlenc#dh"
  67. KT_RSA_1_5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5"
  68. KT_RSA_OAEP = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
  69. STREAM_ARCFOUR = "http://www.w3.org/2001/04/xmlenc#arcfour"
  70. WRAP_3DES = "http://www.w3.org/2001/04/xmlenc#kw-3des"
  71. WRAP_AES128 = "http://www.w3.org/2001/04/xmlenc#kw-aes128"
  72. WRAP_AES192 = "http://www.w3.org/2001/04/xmlenc#kw-aes192"
  73. WRAP_AES256 = "http://www.w3.org/2001/04/xmlenc#kw-aes256"
  74. class WSRF_V1_2:
  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 WSTRUST:
  124. BASE = "http://schemas.xmlsoap.org/ws/2004/04/trust"
  125. ISSUE = "http://schemas.xmlsoap.org/ws/2004/04/trust/Issue"
  126. class WSSE:
  127. BASE = "http://schemas.xmlsoap.org/ws/2002/04/secext"
  128. TRUST = WSTRUST.BASE
  129. class WSU:
  130. BASE = "http://schemas.xmlsoap.org/ws/2002/04/utility"
  131. UTILITY = "http://schemas.xmlsoap.org/ws/2002/07/utility"
  132. class WSR:
  133. PROPERTIES = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceProperties"
  134. LIFETIME = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime"
  135. class WSA200508:
  136. ADDRESS = "http://www.w3.org/2005/08/addressing"
  137. ANONYMOUS = "%s/anonymous" %ADDRESS
  138. FAULT = "%s/fault" %ADDRESS
  139. class WSA200408:
  140. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/08/addressing"
  141. ANONYMOUS = "%s/role/anonymous" %ADDRESS
  142. FAULT = "%s/fault" %ADDRESS
  143. class WSA200403:
  144. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/03/addressing"
  145. ANONYMOUS = "%s/role/anonymous" %ADDRESS
  146. FAULT = "%s/fault" %ADDRESS
  147. class WSA200303:
  148. ADDRESS = "http://schemas.xmlsoap.org/ws/2003/03/addressing"
  149. ANONYMOUS = "%s/role/anonymous" %ADDRESS
  150. FAULT = None
  151. WSA = WSA200408
  152. WSA_LIST = (WSA200508, WSA200408, WSA200403, WSA200303)
  153. class _WSAW(str):
  154. """ Define ADDRESS attribute to be compatible with WSA* layout """
  155. ADDRESS = property(lambda s: s)
  156. WSAW200605 = _WSAW("http://www.w3.org/2006/05/addressing/wsdl")
  157. WSAW_LIST = (WSAW200605,)
  158. class WSP:
  159. POLICY = "http://schemas.xmlsoap.org/ws/2002/12/policy"
  160. class BEA:
  161. SECCONV = "http://schemas.xmlsoap.org/ws/2004/04/sc"
  162. SCTOKEN = "http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct"
  163. class GLOBUS:
  164. SECCONV = "http://wsrf.globus.org/core/2004/07/security/secconv"
  165. CORE = "http://www.globus.org/namespaces/2004/06/core"
  166. SIG = "http://www.globus.org/2002/04/xmlenc#gssapi-sign"
  167. TOKEN = "http://www.globus.org/ws/2004/09/security/sc#GSSAPI_GSI_TOKEN"
  168. ZSI_SCHEMA_URI = 'http://www.zolera.com/schemas/ZSI/'