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

Commit 58f97cf

Browse files
authored
Merge pull request #43 from IdentityPython/develop
Minor changes
2 parents 6e7c562 + e6ee34f commit 58f97cf

File tree

6 files changed

+162
-5
lines changed

6 files changed

+162
-5
lines changed

.github/release-drafter.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
-
5+
title: 'Features'
6+
labels:
7+
- 'enhancement'
8+
- 'feat'
9+
- 'feature'
10+
-
11+
title: 'Bug Fixes'
12+
labels:
13+
- 'bug'
14+
- 'bugfix'
15+
- 'fix'
16+
-
17+
title: 'Maintenance'
18+
labels:
19+
- 'chore'
20+
- 'style'
21+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
22+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
23+
version-resolver:
24+
major:
25+
labels: ['major']
26+
minor:
27+
labels: ['minor']
28+
patch:
29+
labels: ['patch']
30+
default: patch
31+
exclude-labels: ['skip']
32+
autolabeler:
33+
-
34+
label: 'bug'
35+
branch:
36+
- '/bug\/.+/'
37+
- '/bugfix\/.+/'
38+
- '/fix\/.+/'
39+
-
40+
label: 'enhancement'
41+
branch:
42+
- '/dependabot\/.+/'
43+
- '/enhancement\/.+/'
44+
- '/feat\/.+/'
45+
- '/feature\/.+/'
46+
-
47+
label: 'chore'
48+
branch:
49+
- '/chore\/.+/'
50+
- '/style\/.+/'
51+
template: |
52+
## Release notes
53+
54+
$CHANGES

.github/workflows/python-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: oidcrp
55

66
on:
77
push:
8-
branches: [ main, develop ]
8+
branches: [ master, develop ]
99
pull_request:
10-
branches: [ main, develop ]
10+
branches: [ master, develop ]
1111

1212
jobs:
1313
build:

.github/workflows/release-drafter.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Release drafter
2+
3+
on:
4+
push:
5+
branches: [master, develop]
6+
pull_request:
7+
types: [opened, reopened, synchronize]
8+
9+
jobs:
10+
update_release_draft:
11+
name: Update draft release
12+
runs-on: ubuntu-latest
13+
steps:
14+
-
15+
uses: release-drafter/release-drafter@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

example/flask_rp/conf.json

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
}
137137
}
138138
},
139-
"local": {
139+
"flask_provider": {
140140
"client_preferences": {
141141
"application_name": "rphandler",
142142
"application_type": "web",
@@ -204,6 +204,75 @@
204204
}
205205
}
206206
}
207+
},
208+
"django_provider": {
209+
"client_preferences": {
210+
"application_name": "rphandler",
211+
"application_type": "web",
212+
"contacts": [
213+
214+
],
215+
"response_types": [
216+
"code"
217+
],
218+
"scope": [
219+
"openid",
220+
"profile",
221+
"email",
222+
"address",
223+
"phone"
224+
],
225+
"token_endpoint_auth_method": [
226+
"client_secret_basic",
227+
"client_secret_post"
228+
]
229+
},
230+
"issuer": "https://127.0.0.1:8000/",
231+
"redirect_uris": [
232+
"https://{domain}:{port}/authz_cb/django"
233+
],
234+
"post_logout_redirect_uris": [
235+
"https://{domain}:{port}/session_logout/django"
236+
],
237+
"frontchannel_logout_uri": "https://{domain}:{port}/fc_logout/django",
238+
"frontchannel_logout_session_required": true,
239+
"backchannel_logout_uri": "https://{domain}:{port}/bc_logout/django",
240+
"backchannel_logout_session_required": true,
241+
"services": {
242+
"discovery": {
243+
"class": "oidcrp.oidc.provider_info_discovery.ProviderInfoDiscovery",
244+
"kwargs": {}
245+
},
246+
"registration": {
247+
"class": "oidcrp.oidc.registration.Registration",
248+
"kwargs": {}
249+
},
250+
"authorization": {
251+
"class": "oidcrp.oidc.authorization.Authorization",
252+
"kwargs": {}
253+
},
254+
"accesstoken": {
255+
"class": "oidcrp.oidc.access_token.AccessToken",
256+
"kwargs": {}
257+
},
258+
"userinfo": {
259+
"class": "oidcrp.oidc.userinfo.UserInfo",
260+
"kwargs": {}
261+
},
262+
"end_session": {
263+
"class": "oidcrp.oidc.end_session.EndSession",
264+
"kwargs": {}
265+
}
266+
},
267+
"add_ons": {
268+
"pkce": {
269+
"function": "oidcrp.oauth2.add_on.pkce.add_support",
270+
"kwargs": {
271+
"code_challenge_length": 64,
272+
"code_challenge_method": "S256"
273+
}
274+
}
275+
}
207276
}
208277
},
209278
"webserver": {

example/flask_rp/views.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import urllib
23
from urllib.parse import parse_qs
34

45
from flask import Blueprint
@@ -149,8 +150,21 @@ def finalize(op_hash, request_args):
149150
return make_response(res['error'], 400)
150151

151152

153+
def get_ophash_by_cb_uri(url:str):
154+
uri = urllib.parse.splitquery(request.url)[0]
155+
clients = current_app.rp_config.clients
156+
for k,v in clients.items():
157+
for endpoint in ("redirect_uris",
158+
"post_logout_redirect_uris",
159+
"frontchannel_logout_uri",
160+
"backchannel_logout_uri"):
161+
if uri in clients[k].get(endpoint, []):
162+
return k
163+
164+
152165
@oidc_rp_views.route('/authz_cb/<op_hash>')
153166
def authz_cb(op_hash):
167+
op_hash = get_ophash_by_cb_uri(request.url)
154168
return finalize(op_hash, request.args)
155169

156170

@@ -215,6 +229,7 @@ def session_change():
215229
# post_logout_redirect_uri
216230
@oidc_rp_views.route('/session_logout/<op_hash>')
217231
def session_logout(op_hash):
232+
op_hash = get_ophash_by_cb_uri(request.url)
218233
_rp = get_rp(op_hash)
219234
logger.debug('post_logout')
220235
return "Post logout from {}".format(_rp.client_get("service_context").issuer)

src/oidcrp/oidc/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
DEFAULT_SERVICES = {
2323
"discovery": {
24-
'class': 'oidcrp.oidc.provider_info_discovery'
25-
'.ProviderInfoDiscovery'
24+
'class': 'oidcrp.oidc.provider_info_discovery.ProviderInfoDiscovery'
2625
},
2726
'registration': {
2827
'class': 'oidcrp.oidc.registration.Registration'
@@ -38,6 +37,9 @@
3837
},
3938
'userinfo': {
4039
'class': 'oidcrp.oidc.userinfo.UserInfo'
40+
},
41+
'end_session': {
42+
'class': 'oidcrp.oidc.end_session.EndSession'
4143
}
4244
}
4345

0 commit comments

Comments
 (0)