increased maximum difficulty multiplier to 30
[p2pool.git] / wstools / Namespaces.py
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
12 ident = "$Id$"
13 try:
14     from xml.ns import SOAP, SCHEMA, WSDL, XMLNS, DSIG, ENCRYPTION
15     DSIG.C14N       = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
16     
17 except:
18     class SOAP:
19         ENV         = "http://schemas.xmlsoap.org/soap/envelope/"
20         ENC         = "http://schemas.xmlsoap.org/soap/encoding/"
21         ACTOR_NEXT  = "http://schemas.xmlsoap.org/soap/actor/next"
22
23     class SCHEMA:
24         XSD1        = "http://www.w3.org/1999/XMLSchema"
25         XSD2        = "http://www.w3.org/2000/10/XMLSchema"
26         XSD3        = "http://www.w3.org/2001/XMLSchema"
27         XSD_LIST    = [ XSD1, XSD2, XSD3]
28         XSI1        = "http://www.w3.org/1999/XMLSchema-instance"
29         XSI2        = "http://www.w3.org/2000/10/XMLSchema-instance"
30         XSI3        = "http://www.w3.org/2001/XMLSchema-instance"
31         XSI_LIST    = [ XSI1, XSI2, XSI3 ]
32         BASE        = XSD3
33
34     class WSDL:
35         BASE        = "http://schemas.xmlsoap.org/wsdl/"
36         BIND_HTTP   = "http://schemas.xmlsoap.org/wsdl/http/"
37         BIND_MIME   = "http://schemas.xmlsoap.org/wsdl/mime/"
38         BIND_SOAP   = "http://schemas.xmlsoap.org/wsdl/soap/"
39         BIND_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/"
40
41     class XMLNS:
42         BASE        = "http://www.w3.org/2000/xmlns/"
43         XML         = "http://www.w3.org/XML/1998/namespace"
44         HTML        = "http://www.w3.org/TR/REC-html40"
45
46     class DSIG:
47         BASE         = "http://www.w3.org/2000/09/xmldsig#"
48         C14N         = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
49         C14N_COMM    = "http://www.w3.org/TR/2000/CR-xml-c14n-20010315#WithComments"
50         C14N_EXCL    = "http://www.w3.org/2001/10/xml-exc-c14n#"
51         DIGEST_MD2   = "http://www.w3.org/2000/09/xmldsig#md2"
52         DIGEST_MD5   = "http://www.w3.org/2000/09/xmldsig#md5"
53         DIGEST_SHA1  = "http://www.w3.org/2000/09/xmldsig#sha1"
54         ENC_BASE64   = "http://www.w3.org/2000/09/xmldsig#base64"
55         ENVELOPED    = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
56         HMAC_SHA1    = "http://www.w3.org/2000/09/xmldsig#hmac-sha1"
57         SIG_DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
58         SIG_RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
59         XPATH        = "http://www.w3.org/TR/1999/REC-xpath-19991116"
60         XSLT         = "http://www.w3.org/TR/1999/REC-xslt-19991116"
61
62     class ENCRYPTION:
63         BASE    = "http://www.w3.org/2001/04/xmlenc#"
64         BLOCK_3DES    = "http://www.w3.org/2001/04/xmlenc#des-cbc"
65         BLOCK_AES128    = "http://www.w3.org/2001/04/xmlenc#aes128-cbc"
66         BLOCK_AES192    = "http://www.w3.org/2001/04/xmlenc#aes192-cbc"
67         BLOCK_AES256    = "http://www.w3.org/2001/04/xmlenc#aes256-cbc"
68         DIGEST_RIPEMD160    = "http://www.w3.org/2001/04/xmlenc#ripemd160"
69         DIGEST_SHA256    = "http://www.w3.org/2001/04/xmlenc#sha256"
70         DIGEST_SHA512    = "http://www.w3.org/2001/04/xmlenc#sha512"
71         KA_DH    = "http://www.w3.org/2001/04/xmlenc#dh"
72         KT_RSA_1_5    = "http://www.w3.org/2001/04/xmlenc#rsa-1_5"
73         KT_RSA_OAEP    = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
74         STREAM_ARCFOUR    = "http://www.w3.org/2001/04/xmlenc#arcfour"
75         WRAP_3DES    = "http://www.w3.org/2001/04/xmlenc#kw-3des"
76         WRAP_AES128    = "http://www.w3.org/2001/04/xmlenc#kw-aes128"
77         WRAP_AES192    = "http://www.w3.org/2001/04/xmlenc#kw-aes192"
78         WRAP_AES256    = "http://www.w3.org/2001/04/xmlenc#kw-aes256"
79
80
81 class WSRF_V1_2:
82     '''OASIS WSRF Specifications Version 1.2
83     '''
84     class LIFETIME:
85         XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
86         XSD_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.xsd"
87
88         WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
89         WSDL_DRAFT4 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceLifetime-1.2-draft-04.wsdl"
90         LATEST = WSDL_DRAFT4
91         WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT4)
92         XSD_LIST = (XSD_DRAFT1, XSD_DRAFT4)
93
94     class PROPERTIES:
95         XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
96         XSD_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"
97
98         WSDL_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
99         WSDL_DRAFT5 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.wsdl"
100         LATEST = WSDL_DRAFT5
101         WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT5)
102         XSD_LIST = (XSD_DRAFT1, XSD_DRAFT5)
103
104     class BASENOTIFICATION:
105         XSD_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
106
107         WSDL_DRAFT1 = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl"
108         LATEST = WSDL_DRAFT1
109         WSDL_LIST = (WSDL_DRAFT1,)
110         XSD_LIST = (XSD_DRAFT1,)
111
112     class BASEFAULTS:
113         XSD_DRAFT1 = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd"
114         XSD_DRAFT3 = "http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-BaseFaults-1.2-draft-03.xsd"
115         #LATEST = DRAFT3
116         #WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT3)
117         XSD_LIST = (XSD_DRAFT1, XSD_DRAFT3)
118
119 WSRF = WSRF_V1_2
120 WSRFLIST = (WSRF_V1_2,)
121
122
123 class OASIS:
124     '''URLs for Oasis specifications
125     '''
126     WSSE    = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
127     UTILITY = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
128     
129     class X509TOKEN:
130         Base64Binary = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
131         STRTransform = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0"
132         PKCS7 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#PKCS7"
133         X509 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509"
134         X509PKIPathv1 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"
135         X509v3SubjectKeyIdentifier = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3SubjectKeyIdentifier"
136         
137     LIFETIME = WSRF_V1_2.LIFETIME.XSD_DRAFT1
138     PROPERTIES = WSRF_V1_2.PROPERTIES.XSD_DRAFT1
139     BASENOTIFICATION = WSRF_V1_2.BASENOTIFICATION.XSD_DRAFT1
140     BASEFAULTS = WSRF_V1_2.BASEFAULTS.XSD_DRAFT1
141
142
143 class APACHE:
144     '''This name space is defined by AXIS and it is used for the TC in TCapache.py,
145     Map and file attachment (DataHandler)
146     '''
147     AXIS_NS = "http://xml.apache.org/xml-soap"
148
149
150 class WSTRUST:
151     BASE = "http://schemas.xmlsoap.org/ws/2004/04/trust"
152     ISSUE = "http://schemas.xmlsoap.org/ws/2004/04/trust/Issue"
153
154 class WSSE:
155     BASE    = "http://schemas.xmlsoap.org/ws/2002/04/secext"
156     TRUST   = WSTRUST.BASE
157
158
159 class WSU:
160     BASE    = "http://schemas.xmlsoap.org/ws/2002/04/utility"
161     UTILITY = "http://schemas.xmlsoap.org/ws/2002/07/utility"
162
163
164 class WSR:
165     PROPERTIES = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceProperties"
166     LIFETIME   = "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime"
167
168
169 class WSA200508:
170     ADDRESS    = "http://www.w3.org/2005/08/addressing"
171     ANONYMOUS  = "%s/anonymous" %ADDRESS
172     FAULT      = "%s/fault" %ADDRESS
173
174 class WSA200408:
175     ADDRESS    = "http://schemas.xmlsoap.org/ws/2004/08/addressing"
176     ANONYMOUS  = "%s/role/anonymous" %ADDRESS
177     FAULT      = "%s/fault" %ADDRESS
178
179 class WSA200403:
180     ADDRESS    = "http://schemas.xmlsoap.org/ws/2004/03/addressing"
181     ANONYMOUS  = "%s/role/anonymous" %ADDRESS
182     FAULT      = "%s/fault" %ADDRESS
183
184 class WSA200303:
185     ADDRESS    = "http://schemas.xmlsoap.org/ws/2003/03/addressing"
186     ANONYMOUS  = "%s/role/anonymous" %ADDRESS
187     FAULT      = None
188
189
190 WSA = WSA200408
191 WSA_LIST = (WSA200508, WSA200408, WSA200403, WSA200303)
192
193 class _WSAW(str):
194     """ Define ADDRESS attribute to be compatible with WSA* layout """
195     ADDRESS = property(lambda s: s)
196
197 WSAW200605 = _WSAW("http://www.w3.org/2006/05/addressing/wsdl")
198
199 WSAW_LIST = (WSAW200605,)
200  
201 class WSP:
202     POLICY = "http://schemas.xmlsoap.org/ws/2002/12/policy"
203
204 class BEA:
205     SECCONV = "http://schemas.xmlsoap.org/ws/2004/04/sc"
206     SCTOKEN = "http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct"
207
208 class GLOBUS:
209     SECCONV = "http://wsrf.globus.org/core/2004/07/security/secconv"
210     CORE    = "http://www.globus.org/namespaces/2004/06/core"
211     SIG     = "http://www.globus.org/2002/04/xmlenc#gssapi-sign"
212     TOKEN   = "http://www.globus.org/ws/2004/09/security/sc#GSSAPI_GSI_TOKEN"
213
214 ZSI_SCHEMA_URI = 'http://www.zolera.com/schemas/ZSI/'