Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
1b00f4c9
Commit
1b00f4c9
authored
Aug 05, 2020
by
manuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disabled proxy on internal REST request
parent
2988a39d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
token_service.py
...tage-discovery-microservice/app/services/token_service.py
+4
-2
security_util.py
src/modules/security/security_util.py
+1
-1
No files found.
src/data-hub/role-stage-discovery-microservice/app/services/token_service.py
View file @
1b00f4c9
...
...
@@ -2,13 +2,15 @@
from
security
import
security_util
from
typing
import
List
import
logging
def
_verify
(
token
:
str
,
roles
:
List
[
str
]
=
[]):
try
:
token_info
=
security_util
.
decodeToken
(
token
,
roles
=
roles
)
return
token_info
except
Exception
as
e
:
print
(
"ERROR DURING TOKEN VALIDATION: "
+
str
(
e
))
LOGGER
=
logging
.
getLogger
(
__name__
)
LOGGER
.
error
(
"ERROR DURING TOKEN VALIDATION: "
+
str
(
e
))
return
None
...
...
@@ -16,4 +18,4 @@ def verifyTokenRegular(token, required_scopes):
return
_verify
(
token
)
def
verifyTokenAdmin
(
token
,
required_scopes
):
return
_verify
(
token
,
roles
=
[
"a"
])
\ No newline at end of file
return
_verify
(
token
,
roles
=
[
"a"
])
src/modules/security/security_util.py
View file @
1b00f4c9
...
...
@@ -57,7 +57,7 @@ def decodeToken(token: str, roles:List[str]=[]) -> Dict:
response
=
requests
.
post
(
url
,
verify
=
False
,
# proxies = { "http":"http://proxy.uni-klu.ac.at:3128/", "https":"http://proxy.uni-klu.ac.at:3128/"
}
proxies
=
{
"http"
:
None
,
"https"
:
None
}
)
if
response
.
status_code
!=
200
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment