Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit cfde5c9

Browse files
committed
clean up.
1 parent ea1a0c3 commit cfde5c9

File tree

2 files changed

+10
-31
lines changed

2 files changed

+10
-31
lines changed

src/oidcrp/util.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,9 @@ def get_http_body(req, content_type=URL_ENCODED):
128128
Get the message into the format that should be places in the body part
129129
of a HTTP request.
130130
131-
:param req: The service request as a :py:class:`oidcmsg.message.Message`
132-
instance
131+
:param req: The service request as a :py:class:`oidcmsg.message.Message` instance
133132
:param content_type: The format of the body part.
134-
:return: The correctly formatet service request.
133+
:return: The correctly formatted service request.
135134
"""
136135
if URL_ENCODED in content_type:
137136
return req.to_urlencoded()
@@ -142,8 +141,7 @@ def get_http_body(req, content_type=URL_ENCODED):
142141
if JOSE_ENCODED in content_type:
143142
return req # already packaged
144143

145-
raise UnSupported(
146-
"Unsupported content type: '%s'" % content_type)
144+
raise UnSupported("Unsupported content type: '%s'" % content_type)
147145

148146

149147
def load_yaml_config(filename):

tests/test_40_rp_handler_persistent.py

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,6 @@
2323
"verify_args": {"allow_sign_alg_none": True}
2424
}
2525

26-
DB_CONF = {
27-
'keyjar': {
28-
'handler': 'oidcmsg.storage.abfile.LabeledAbstractFileSystem',
29-
'fdir': 'db/{}/keyjar',
30-
'key_conv': 'oidcmsg.storage.converter.QPKey',
31-
'value_conv': 'cryptojwt.serialize.item.KeyIssuer',
32-
'label': 'keyjar'
33-
},
34-
'default': {
35-
'handler': 'oidcmsg.storage.abfile.AbstractFileSystem',
36-
'fdir': 'db/{}',
37-
'key_conv': 'oidcmsg.storage.converter.QPKey',
38-
'value_conv': 'oidcmsg.storage.converter.JSON'
39-
}
40-
}
41-
4226
CLIENT_CONFIG = {
4327
"": {
4428
"client_preferences": CLIENT_PREFS,
@@ -97,8 +81,7 @@
9781
'userinfo': {
9882
'class': 'oidcrp.provider.linkedin.UserInfo'
9983
}
100-
},
101-
'db_conf': DB_CONF
84+
}
10285
},
10386
"facebook": {
10487
"issuer": "https://www.facebook.com/v2.11/dialog/oauth",
@@ -130,8 +113,7 @@
130113
'class': 'oidcrp.oidc.userinfo.UserInfo',
131114
'kwargs': {'conf': {'default_authn_method': ''}}
132115
}
133-
},
134-
'db_conf': DB_CONF
116+
}
135117
},
136118
'github': {
137119
"issuer": "https://github.com/login/oauth/authorize",
@@ -167,8 +149,7 @@
167149
'class': 'oidcrp.oidc.refresh_access_token'
168150
'.RefreshAccessToken'
169151
}
170-
},
171-
'db_conf': DB_CONF
152+
}
172153
}
173154
}
174155

@@ -333,11 +314,11 @@ def test_begin(self):
333314
'redirect_uri', 'response_type', 'scope'}
334315

335316
# nonce and state are created on the fly so can't check for those
336-
assert query['client_id'] == ['eeeeeeeee']
337-
assert query['redirect_uri'] == [
317+
assert query[b'client_id'] == ['eeeeeeeee']
318+
assert query[b'redirect_uri'] == [
338319
'https://example.com/rp/authz_cb/github']
339-
assert query['response_type'] == ['code']
340-
assert query['scope'] == ['user public_repo openid']
320+
assert query[b'response_type'] == ['code']
321+
assert query[b'scope'] == ['user public_repo openid']
341322

342323
def test_get_session_information(self):
343324
rph_1 = RPHandler(BASE_URL, client_configs=CLIENT_CONFIG,

0 commit comments

Comments
 (0)