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.
 
 
 

170 lines
7.1 KiB

  1. #! /usr/bin/env python
  2. """Namespace module, so you don't need PyXML
  3. """
  4. try:
  5. from xml.ns import SOAP, SCHEMA, WSDL, XMLNS, DSIG, ENCRYPTION
  6. DSIG.C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
  7. except:
  8. class SOAP:
  9. ENV = "http://schemas.xmlsoap.org/soap/envelope/"
  10. ENC = "http://schemas.xmlsoap.org/soap/encoding/"
  11. ACTOR_NEXT = "http://schemas.xmlsoap.org/soap/actor/next"
  12. class SCHEMA:
  13. XSD1 = "http://www.w3.org/1999/XMLSchema"
  14. XSD2 = "http://www.w3.org/2000/10/XMLSchema"
  15. XSD3 = "http://www.w3.org/2001/XMLSchema"
  16. XSD_LIST = [ XSD1, XSD2, XSD3 ]
  17. XSI1 = "http://www.w3.org/1999/XMLSchema-instance"
  18. XSI2 = "http://www.w3.org/2000/10/XMLSchema-instance"
  19. XSI3 = "http://www.w3.org/2001/XMLSchema-instance"
  20. XSI_LIST = [ XSI1, XSI2, XSI3 ]
  21. BASE = XSD3
  22. class WSDL:
  23. BASE = "http://schemas.xmlsoap.org/wsdl/"
  24. BIND_HTTP = "http://schemas.xmlsoap.org/wsdl/http/"
  25. BIND_MIME = "http://schemas.xmlsoap.org/wsdl/mime/"
  26. BIND_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/"
  27. BIND_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/"
  28. class XMLNS:
  29. BASE = "http://www.w3.org/2000/xmlns/"
  30. XML = "http://www.w3.org/XML/1998/namespace"
  31. HTML = "http://www.w3.org/TR/REC-html40"
  32. class DSIG:
  33. BASE = "http://www.w3.org/2000/09/xmldsig#"
  34. C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
  35. C14N_COMM = "http://www.w3.org/TR/2000/CR-xml-c14n-20010315#WithComments"
  36. C14N_EXCL = "http://www.w3.org/2001/10/xml-exc-c14n#"
  37. DIGEST_MD2 = "http://www.w3.org/2000/09/xmldsig#md2"
  38. DIGEST_MD5 = "http://www.w3.org/2000/09/xmldsig#md5"
  39. DIGEST_SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1"
  40. ENC_BASE64 = "http://www.w3.org/2000/09/xmldsig#base64"
  41. ENVELOPED = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
  42. HMAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1"
  43. SIG_DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
  44. SIG_RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
  45. XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116"
  46. XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116"
  47. class ENCRYPTION:
  48. BASE = "http://www.w3.org/2001/04/xmlenc#"
  49. BLOCK_3DES = "http://www.w3.org/2001/04/xmlenc#des-cbc"
  50. BLOCK_AES128 = "http://www.w3.org/2001/04/xmlenc#aes128-cbc"
  51. BLOCK_AES192 = "http://www.w3.org/2001/04/xmlenc#aes192-cbc"
  52. BLOCK_AES256 = "http://www.w3.org/2001/04/xmlenc#aes256-cbc"
  53. DIGEST_RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160"
  54. DIGEST_SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256"
  55. DIGEST_SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512"
  56. KA_DH = "http://www.w3.org/2001/04/xmlenc#dh"
  57. KT_RSA_1_5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5"
  58. KT_RSA_OAEP = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
  59. STREAM_ARCFOUR = "http://www.w3.org/2001/04/xmlenc#arcfour"
  60. WRAP_3DES = "http://www.w3.org/2001/04/xmlenc#kw-3des"
  61. WRAP_AES128 = "http://www.w3.org/2001/04/xmlenc#kw-aes128"
  62. WRAP_AES192 = "http://www.w3.org/2001/04/xmlenc#kw-aes192"
  63. WRAP_AES256 = "http://www.w3.org/2001/04/xmlenc#kw-aes256"
  64. class WSRF_V1_2:
  65. '''OASIS WSRF Specifications Version 1.2
  66. '''
  67. class LIFETIME:
  68. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
  69. XSD_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.xsd"
  70. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
  71. WSDL_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.wsdl"
  72. #LATEST = DRAFT4
  73. WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT4)
  74. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT4)
  75. class PROPERTIES:
  76. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
  77. XSD_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"
  78. WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
  79. WSDL_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.wsdl"
  80. #LATEST = DRAFT5
  81. WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT5)
  82. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT5)
  83. class BASENOTIFICATION:
  84. XSD_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
  85. #LATEST = DRAFT1
  86. #WSDL_LIST = (WSDL_DRAFT1,)
  87. XSD_LIST = (XSD_DRAFT1,)
  88. class BASEFAULTS:
  89. XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd"
  90. XSD_DRAFT3 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-BaseFaults-1.2-draft-03.xsd"
  91. #LATEST = DRAFT3
  92. #WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT3)
  93. XSD_LIST = (XSD_DRAFT1, XSD_DRAFT3)
  94. WSRF = WSRF_V1_2
  95. WSRFLIST = (WSRF_V1_2,)
  96. class OASIS:
  97. '''URLs for Oasis specifications
  98. '''
  99. WSSE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
  100. UTILITY = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  101. LIFETIME = WSRF_V1_2.LIFETIME.XSD_DRAFT1
  102. PROPERTIES = WSRF_V1_2.PROPERTIES.XSD_DRAFT1
  103. BASENOTIFICATION = WSRF_V1_2.BASENOTIFICATION.XSD_DRAFT1
  104. BASEFAULTS = WSRF_V1_2.BASEFAULTS.XSD_DRAFT1
  105. class WSSE:
  106. BASE = "http://schemas.xmlsoap.org/ws/2002/04/secext"
  107. TRUST = "http://schemas.xmlsoap.org/ws/2004/04/trust"
  108. class WSU:
  109. BASE = "http://schemas.xmlsoap.org/ws/2002/04/utility"
  110. UTILITY = "http://schemas.xmlsoap.org/ws/2002/07/utility"
  111. class WSR:
  112. PROPERTIES = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceProperties"
  113. LIFETIME = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime"
  114. class WSA200408:
  115. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/08/addressing"
  116. ANONYMOUS = "%s/role/anonymous" %ADDRESS
  117. FAULT = "%s/fault" %ADDRESS
  118. class WSA200403:
  119. ADDRESS = "http://schemas.xmlsoap.org/ws/2004/03/addressing"
  120. ANONYMOUS = "%s/role/anonymous" %ADDRESS
  121. FAULT = "%s/fault" %ADDRESS
  122. class WSA200303:
  123. ADDRESS = "http://schemas.xmlsoap.org/ws/2003/03/addressing"
  124. ANONYMOUS = "%s/role/anonymous" %ADDRESS
  125. FAULT = None
  126. WSA = WSA200408
  127. WSA_LIST = (WSA200408, WSA200403, WSA200303)
  128. class WSP:
  129. POLICY = "http://schemas.xmlsoap.org/ws/2002/12/policy"
  130. class BEA:
  131. SECCONV = "http://schemas.xmlsoap.org/ws/2004/04/sc"
  132. class GLOBUS:
  133. SECCONV = "http://wsrf.globus.org/core/2004/07/security/secconv"
  134. CORE = "http://www.globus.org/namespaces/2004/06/core"
  135. SIG = "http://www.globus.org/2002/04/xmlenc#gssapi-sign"
  136. ZSI_SCHEMA_URI = 'http://www.zolera.com/schemas/ZSI/'