Skip to content

Commit 9f3ebae

Browse files
committed
Revert "Merge pull request #5 from tnydwrds/fix-0.3.2-optional-realm-support"
This reverts commit 073e7e0, reversing changes made to a6b6b56.
1 parent 073e7e0 commit 9f3ebae

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

History.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
0.3.2 / 2013-10-09
2-
==================
3-
* Added: Optional realm support
4-
* `Client.__init__`'s `realm` parameter is now optional (or named).
5-
61
0.3.1 / 2013-06-04
72
==================
83
* Removed: Realm Support
@@ -15,13 +10,15 @@
1510
* Fixed: JSON support for Python 2.4 and 2.5
1611
* Fixed: OAuth support for Python 2.4
1712
* Fixed: Version number below (0.2.1)
13+
1814

1915
0.2.1 / 2012-09-25
2016
==================
2117
# Added: `upload_creative` to support uploading creative files.
2218

2319
0.2.0 / 2012-08-29
2420
==================
21+
2522
* Fixed: JSON parse error when deleting objects with call to `Client.delete()`
2623
* Added: "Official" support for Python 2.4, 2.5, 2.6
2724
* Added: `logon` and `logoff` convenience methods.
@@ -30,4 +27,5 @@
3027

3128
0.1.0 / 2012-08-26
3229
==================
30+
3331
* "Official release"

ox3apiclient/__init__.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
if major_py_version == 2 and minor_py_version > 4:
2121
import oauth2 as oauth
2222
else:
23-
import oauth2_version as oauth
23+
import oauth2_version as oauth
2424

2525
import urllib
2626
import urllib2
@@ -33,7 +33,7 @@
3333

3434
import urlparse
3535

36-
__version__ = '0.3.2'
36+
__version__ = '0.3.1'
3737

3838
REQUEST_TOKEN_URL = 'https://sso.openx.com/api/index/initiate'
3939
ACCESS_TOKEN_URL = 'https://sso.openx.com/api/index/token'
@@ -43,8 +43,7 @@
4343

4444
class Client(object):
4545

46-
def __init__(self, domain, consumer_key, consumer_secret,
47-
realm='',
46+
def __init__(self, domain, realm, consumer_key, consumer_secret,
4847
callback_url='oob',
4948
scheme='http',
5049
request_token_url=REQUEST_TOKEN_URL,
@@ -58,9 +57,9 @@ def __init__(self, domain, consumer_key, consumer_secret,
5857
"""
5958
6059
domain -- Your UI domain. The API is accessed off this domain.
60+
realm -- This is no longer used. Just specify None.
6161
consumer_key -- Your consumer key.
6262
consumer_secret -- Your consumer secret.
63-
realm -- Optional realm.
6463
callback_url -- Callback URL to redirect to on successful authorization.
6564
We default to 'oob' for headless login.
6665
request_token -- Only override for debugging.
@@ -69,13 +68,12 @@ def __init__(self, domain, consumer_key, consumer_secret,
6968
api_path -- Only override for debugging.
7069
http_proxy -- Optional proxy to send HTTP requests through.
7170
"""
72-
71+
7372
self.domain = domain
7473
self.consumer_key = consumer_key
7574
self.consumer_secret = consumer_secret
76-
self.realm = realm
7775
self.callback_url = callback_url
78-
self.scheme = scheme
76+
self.scheme=scheme
7977
self.request_token_url = request_token_url
8078
self.access_token_url = access_token_url
8179
self.authorization_url = authorization_url
@@ -132,9 +130,8 @@ def _sign_request(self, req):
132130
oauth.SignatureMethod_HMAC_SHA1(),
133131
self._consumer,
134132
self._token)
135-
136-
req.headers.update(oauth_req.to_header(realm=self.realm))
137-
133+
134+
req.headers.update(oauth_req.to_header())
138135
return \
139136
urllib2.Request(req.get_full_url(), headers=req.headers, data=data)
140137

@@ -162,7 +159,7 @@ def request(self, url, method='GET', headers={}, data=None, sign=False):
162159
# Everything needs to be UTF-8 for urlencode:
163160
data_utf8 = req.get_data()
164161
for i in data_utf8:
165-
data_utf8[i] = data_utf8[i].encode('utf-8')
162+
data_utf8[i] = data_utf8[i].encode('utf-8')
166163
req.add_data(urllib.urlencode(data_utf8))
167164

168165
# In 2.4 and 2.5, urllib2 throws errors for all non 200 status codes.
@@ -395,7 +392,6 @@ def client_from_file(file_path='.ox3rc', env=None):
395392

396393
# Load optional parameters.
397394
optional_params = [
398-
'realm',
399395
'callback_url',
400396
'scheme',
401397
'request_token_url',

0 commit comments

Comments
 (0)