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
3051a5d2
Commit
3051a5d2
authored
Jul 21, 2020
by
Manuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring main.py
parent
52f460c3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
21 deletions
+57
-21
main.py
src/data-hub/role-stage-discovery-microservice/app/main.py
+4
-1
security_util.py
src/modules/security/security_util.py
+4
-0
main.py
src/rest-gateway/app/main.py
+3
-16
requirements.txt
src/rest-gateway/app/requirements.txt
+46
-4
No files found.
src/data-hub/role-stage-discovery-microservice/app/main.py
View file @
3051a5d2
...
...
@@ -25,6 +25,9 @@ app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger.yml")),
def
api_root
():
return
'Endpoint of role-stage-discovery-microservice!'
# SSL configuration
context
=
(
f
'{modules_path}/certificate/articonf1.crt'
,
f
'{modules_path}/certificate/articonf1.key'
)
# certificate and key files
# start app
if
__name__
==
'__main__'
:
app
.
run
(
host
=
'0.0.0.0'
,
port
=
5000
,
debug
=
True
)
app
.
run
(
host
=
'0.0.0.0'
,
port
=
5000
,
debug
=
True
,
ssl_context
=
context
)
src/modules/security/security_util.py
0 → 100644
View file @
3051a5d2
from
typing
import
Dict
def
decodeToken
(
token
:
str
)
->
Dict
:
pass
\ No newline at end of file
src/rest-gateway/app/main.py
View file @
3051a5d2
...
...
@@ -17,23 +17,13 @@ LOGGER = logging.getLogger(__name__)
#################################
import
connexion
from
security
import
swagger_util
# load swagger config
def
get_bundled_specs
(
main_file
:
Path
)
->
Dict
[
str
,
Any
]:
'''
parses the given swagger.yml file and resolves dependencies
from that file to enable the possibility to split the
configuration into several files
'''
parser
=
prance
.
ResolvingParser
(
str
(
main_file
.
absolute
()),
lazy
=
True
,
backend
=
'openapi-spec-validator'
)
parser
.
parse
()
return
parser
.
specification
app
=
connexion
.
App
(
__name__
,
specification_dir
=
'configs/'
)
app
.
add_api
(
get_bundled_specs
(
Path
(
"configs/swagger.yml"
)),
app
.
add_api
(
swagger_util
.
get_bundled_specs
(
Path
(
"configs/swagger.yml"
)),
resolver
=
connexion
.
RestyResolver
(
"cms_rest_api"
))
@
app
.
route
(
'/'
,
methods
=
[
'GET'
])
...
...
@@ -41,11 +31,8 @@ def api_root():
return
'Endpoint of SMART RESTful API Gateway!'
# SSL configuration
context
=
(
'../../modules/certificate/articonf1.crt'
,
'../../modules/certificate/articonf1.key'
)
# certificate and key files
context
=
(
f
'{modules_path}/certificate/articonf1.crt'
,
f
'{modules_path}/certificate/articonf1.key'
)
# certificate and key files
# start app
if
__name__
==
'__main__'
:
# app.run(host='0.0.0.0', port=5000, debug=True, use_reloader=False) # disable reloader so only subscribed once to rabbitmq
app
.
run
(
host
=
'0.0.0.0'
,
port
=
5000
,
debug
=
True
,
use_reloader
=
False
,
ssl_context
=
context
)
# disable reloader so only subscribed once to rabbitmq
\ No newline at end of file
src/rest-gateway/app/requirements.txt
View file @
3051a5d2
flask
connexion[swagger-ui]
pika
deprecated
astroid==2.4.2
attrs==19.3.0
autopep8==1.5.3
bcrypt==3.1.7
certifi==2020.6.20
cffi==1.14.0
chardet==3.0.4
click==7.1.2
clickclick==1.2.2
colorama==0.4.3
connexion==2.7.0
cryptography==2.9.2
Deprecated==1.2.10
Flask==1.1.2
idna==2.10
importlib-metadata==1.7.0
inflection==0.5.0
isort==4.3.21
itsdangerous==1.1.0
Jinja2==2.11.2
jsonschema==3.2.0
lazy-object-proxy==1.4.3
MarkupSafe==1.1.1
mccabe==0.6.1
openapi-spec-validator==0.2.8
pika==1.1.0
prance==0.19.0
pycodestyle==2.6.0
pycparser==2.20
PyJWT==1.7.1
pylint==2.5.3
pymongo==3.10.1
pyOpenSSL==19.1.0
pyrsistent==0.16.0
PyYAML==5.3.1
requests==2.24.0
rope==0.17.0
semver==2.10.2
six==1.15.0
swagger-ui-bundle==0.0.6
toml==0.10.1
typed-ast==1.4.1
urllib3==1.25.9
Werkzeug==1.0.1
wrapt==1.12.1
zipp==3.1.0
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