FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JWTConnect-Python-OidcService/tests/MockOP.py at develop · IdentityPython/JWTConnect-Python-OidcService · GitHub
This repository was archived by the owner on Jun 12, 2021. It is now read-only.
IdentityPython
JWTConnect-Python-OidcService
Repository navigation
Code
Issues
1
(1)
Pull requests
3
(3)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JWTConnect-Python-OidcService
/
tests
/
MockOP.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
49 lines (36 loc) · 1.21 KB
Breadcrumbs
JWTConnect-Python-OidcService
/
tests
/
MockOP.py
Copy path
File metadata and controls
49 lines (36 loc) · 1.21 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from
oidcmsg
.
exception
import
OidcMsgError
from
oidcmsg
.
oauth2
import
AuthorizationRequest
class
HTTPResponse
(
object
):
def
__init__
(
self
,
text
=
''
,
status_code
=
200
,
headers
=
None
):
self
.
text
=
text
self
.
status_code
=
status_code
self
.
headers
=
headers
or
{}
class
MockOP
(
object
):
def
__init__
(
self
,
baseurl
=
'http://example.com/'
):
self
.
baseurl
=
baseurl
def
__call__
(
self
,
url
,
method
,
**
kwargs
):
if
url
.
startswith
(
self
.
baseurl
):
path
=
url
[
len
(
self
.
baseurl
):]
else
:
path
=
url
if
'?'
in
path
:
what
,
req
=
path
.
split
(
'?'
,
1
)
meth
=
getattr
(
self
,
what
)
return
meth
(
req
)
else
:
meth
=
getattr
(
self
,
path
)
return
meth
(
kwargs
[
'data'
])
def
discovery
(
self
):
pass
def
register
(
self
,
request
):
pass
def
authorization
(
self
,
request
,
**
kwargs
):
areq
=
AuthorizationRequest
().
from_urlencoded
(
request
)
if
not
areq
.
verify
():
raise
OidcMsgError
(
'Verification failed'
)
resp
=
HTTPResponse
(
'OK'
)
return
resp
def
token
(
self
,
request
,
**
kwargs
):
pass
def
userinfo
(
self
,
request
,
**
kwargs
):
pass
Back
|
FazBrowse Home
|
New Git URL