This repository was archived by the owner on Aug 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +5
-2
lines changed
rest_framework_microservice Expand file tree Collapse file tree 4 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ REST_FRAMEWORK_MICROSERVICE = {
114
114
" REFRESH_COOKIE_PATH" : " /auth" ,
115
115
" IDP" : {
116
116
" PROVIDER" : " aws" ,
117
+ " REGION" : " us-west-2" ,
117
118
" USER_POOL" : " us-west-2_abcdefg" ,
118
119
" CLIENT_ID" : " abcdefg" ,
119
120
},
@@ -140,6 +141,7 @@ needs to match the path of authentication endpoint path set in urls.py.
140
141
A dictionary containing IDP attributes:
141
142
- `` PROVIDER `` : a string identifying what IDP backend to use, defaults to ` 'aws' `
142
143
(Currently only AWS Cognito is supported.)
144
+ - `` REGION `` : user pool region.
143
145
- `` USER_POOL `` : user pool identifier used with the IDP.
144
146
- `` CLIENT_ID `` : IDP client id for your application.
145
147
Original file line number Diff line number Diff line change 9
9
"REFRESH_COOKIE_PATH" : "/auth" ,
10
10
"IDP" : {
11
11
"PROVIDER" : "aws" ,
12
+ "REGION" : "us-west-2" ,
12
13
"USER_POOL" : "us-west-2_abcdefg" ,
13
14
"CLIENT_ID" : "abcdefg" ,
14
15
},
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def get_pub_keys():
21
21
22
22
if pub_keys is None :
23
23
pub_keys = {key ['kid' ]: json .dumps (key ) for key in requests .get (
24
- f"https://cognito-idp.us-west-2 .amazonaws.com/{ rest_microservice_settings .IDP ['USER_POOL' ]} /.well-known/jwks.json" ).json ().get ('keys' )}
24
+ f"https://cognito-idp.{ rest_microservice_settings . IDP [ 'REGION' ] } .amazonaws.com/{ rest_microservice_settings .IDP ['USER_POOL' ]} /.well-known/jwks.json" ).json ().get ('keys' )}
25
25
cache .set ('cognito_pub_keys' , pub_keys , 86000 )
26
26
27
27
return pub_keys
Original file line number Diff line number Diff line change 1
1
[metadata]
2
2
name = django-rest-microservice
3
- version = 1.0.2
3
+ version = 1.0.3
4
4
description = Facilitating microservice architecture in Django REST framework
5
5
long_description = file: README.md
6
6
url = https://github.com/oscarychen/django-rest-microservice
You can’t perform that action at this time.
0 commit comments