This repository was archived by the owner on Jun 12, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313from oidcendpoint import JWT_BEARER
1414from oidcendpoint import sanitize
15+ from oidcendpoint .exception import InvalidClient
1516from oidcendpoint .exception import MultipleUsage
1617from oidcendpoint .exception import NotForMe
18+ from oidcendpoint .exception import UnknownClient
1719
1820logger = logging .getLogger (__name__ )
1921
@@ -264,16 +266,16 @@ def verify_client(
264266
265267 if client_id :
266268 if not client_id in endpoint_context .cdb :
267- raise ValueError ("Unknown Client ID" )
269+ raise UnknownClient ("Unknown Client ID" )
268270
269271 _cinfo = endpoint_context .cdb [client_id ]
270272 if isinstance (_cinfo , str ):
271273 if not _cinfo in endpoint_context .cdb :
272- raise ValueError ("Unknown Client ID" )
274+ raise UnknownClient ("Unknown Client ID" )
273275
274276 if not valid_client_info (_cinfo ):
275277 logger .warning ("Client registration has timed out" )
276- raise ValueError ("Not valid client" )
278+ raise InvalidClient ("Not valid client" )
277279
278280 # store what authn method was used
279281 if auth_info .get ("method" ):
Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ class UnknownClient(OidcEndpointError):
5858 pass
5959
6060
61+ class InvalidClient (OidcEndpointError ):
62+ pass
63+
64+
6165class UnAuthorizedClient (OidcEndpointError ):
6266 pass
6367
You can’t perform that action at this time.
0 commit comments