@@ -119,7 +119,7 @@ def verify(authn_method):
119
119
auth_args = authn_method .unpack_token (kwargs ['token' ])
120
120
authz_request = AuthorizationRequest ().from_urlencoded (auth_args ['query' ])
121
121
122
- endpoint = current_app .server .server_get ( "endpoint" , 'authorization' )
122
+ endpoint = current_app .server .get_endpoint ( 'authorization' )
123
123
_session_id = endpoint .create_session (authz_request , username , auth_args ['authn_class_ref' ],
124
124
auth_args ['iat' ], authn_method )
125
125
@@ -133,8 +133,7 @@ def verify(authn_method):
133
133
134
134
@oidc_op_views .route ('/verify/user' , methods = ['GET' , 'POST' ])
135
135
def verify_user ():
136
- authn_method = current_app .server .server_get (
137
- "endpoint_context" ).authn_broker .get_method_by_id ('user' )
136
+ authn_method = current_app .server .get_context ().authn_broker .get_method_by_id ('user' )
138
137
try :
139
138
return verify (authn_method )
140
139
except FailedAuthentication as exc :
@@ -143,8 +142,7 @@ def verify_user():
143
142
144
143
@oidc_op_views .route ('/verify/user_pass_jinja' , methods = ['GET' , 'POST' ])
145
144
def verify_user_pass_jinja ():
146
- authn_method = current_app .server .server_get (
147
- "endpoint_context" ).authn_broker .get_method_by_id ('user' )
145
+ authn_method = current_app .server .get_context ().authn_broker .get_method_by_id ('user' )
148
146
try :
149
147
return verify (authn_method )
150
148
except FailedAuthentication as exc :
@@ -154,9 +152,9 @@ def verify_user_pass_jinja():
154
152
@oidc_op_views .route ('/.well-known/<service>' )
155
153
def well_known (service ):
156
154
if service == 'openid-configuration' :
157
- _endpoint = current_app .server .server_get ( "endpoint" , 'provider_config' )
155
+ _endpoint = current_app .server .get_endpoint ( 'provider_config' )
158
156
elif service == 'webfinger' :
159
- _endpoint = current_app .server .server_get ( "endpoint" , 'discovery' )
157
+ _endpoint = current_app .server .get_endpoint ( 'discovery' )
160
158
else :
161
159
return make_response ('Not supported' , 400 )
162
160
@@ -166,45 +164,45 @@ def well_known(service):
166
164
@oidc_op_views .route ('/registration' , methods = ['GET' , 'POST' ])
167
165
def registration ():
168
166
return service_endpoint (
169
- current_app .server .server_get ( "endpoint" , 'registration' ))
167
+ current_app .server .get_endpoint ( 'registration' ))
170
168
171
169
172
170
@oidc_op_views .route ('/registration_api' , methods = ['GET' , 'DELETE' ])
173
171
def registration_api ():
174
172
if request .method == "DELETE" :
175
173
return service_endpoint (
176
- current_app .server .server_get ( "endpoint" , 'registration_delete' ))
174
+ current_app .server .get_endpoint ( 'registration_delete' ))
177
175
else :
178
176
return service_endpoint (
179
- current_app .server .server_get ( "endpoint" , 'registration_read' ))
177
+ current_app .server .get_endpoint ( 'registration_read' ))
180
178
181
179
182
180
@oidc_op_views .route ('/authorization' )
183
181
def authorization ():
184
182
return service_endpoint (
185
- current_app .server .server_get ( "endpoint" , 'authorization' ))
183
+ current_app .server .get_endpoint ( 'authorization' ))
186
184
187
185
188
186
@oidc_op_views .route ('/token' , methods = ['GET' , 'POST' ])
189
187
def token ():
190
188
return service_endpoint (
191
- current_app .server .server_get ( "endpoint" , 'token' ))
189
+ current_app .server .get_endpoint ( 'token' ))
192
190
193
191
@oidc_op_views .route ('/introspection' , methods = ['POST' ])
194
192
def introspection_endpoint ():
195
193
return service_endpoint (
196
- current_app .server .server_get ( "endpoint" , 'introspection' ))
194
+ current_app .server .get_endpoint ( 'introspection' ))
197
195
198
196
@oidc_op_views .route ('/userinfo' , methods = ['GET' , 'POST' ])
199
197
def userinfo ():
200
198
return service_endpoint (
201
- current_app .server .server_get ( "endpoint" , 'userinfo' ))
199
+ current_app .server .get_endpoint ( 'userinfo' ))
202
200
203
201
204
202
@oidc_op_views .route ('/session' , methods = ['GET' ])
205
203
def session_endpoint ():
206
204
return service_endpoint (
207
- current_app .server .server_get ( "endpoint" , 'session' ))
205
+ current_app .server .get_endpoint ( 'session' ))
208
206
209
207
210
208
IGNORE = ["cookie" , "user-agent" ]
@@ -298,7 +296,7 @@ def check_session_iframe():
298
296
req_args = dict ([(k , v ) for k , v in request .form .items ()])
299
297
300
298
if req_args :
301
- _context = current_app .server .server_get ( "endpoint_context" )
299
+ _context = current_app .server .get_context ( )
302
300
# will contain client_id and origin
303
301
if req_args ['origin' ] != _context .issuer :
304
302
return 'error'
@@ -314,15 +312,15 @@ def check_session_iframe():
314
312
315
313
@oidc_op_views .route ('/verify_logout' , methods = ['GET' , 'POST' ])
316
314
def verify_logout ():
317
- part = urlparse (current_app .server .server_get ( "endpoint_context" ).issuer )
315
+ part = urlparse (current_app .server .get_context ( ).issuer )
318
316
page = render_template ('logout.html' , op = part .hostname ,
319
317
do_logout = 'rp_logout' , sjwt = request .args ['sjwt' ])
320
318
return page
321
319
322
320
323
321
@oidc_op_views .route ('/rp_logout' , methods = ['GET' , 'POST' ])
324
322
def rp_logout ():
325
- _endp = current_app .server .server_get ( "endpoint" , 'session' )
323
+ _endp = current_app .server .get_endpoint ( 'session' )
326
324
_info = _endp .unpack_signed_jwt (request .form ['sjwt' ])
327
325
try :
328
326
request .form ['logout' ]
0 commit comments