Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Commits
990a6e70
Verified
Commit
990a6e70
authored
May 1, 2023
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
Added flask jwt endoint authentication
parent
62a2436e
No related branches found
No related tags found
2 merge requests
!163
Relase 1.3.0
,
!156
Added readme to authentication service and added eureka service
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dbrepo-semantics-service/app.py
+5
-1
5 additions, 1 deletion
dbrepo-semantics-service/app.py
dbrepo-semantics-service/requirements.txt
+2
-1
2 additions, 1 deletion
dbrepo-semantics-service/requirements.txt
with
7 additions
and
2 deletions
dbrepo-semantics-service/app.py
+
5
−
1
View file @
990a6e70
...
...
@@ -13,6 +13,7 @@ from gevent.pywsgi import WSGIServer
from
save
import
insert_mdb_concepts
,
insert_mdb_units
from
onto_feat
import
list_ontologies
,
get_ontology
from
prometheus_flask_exporter
import
PrometheusMetrics
from
flask_jwt_extended
import
jwt_required
,
JWTManager
dictConfig
({
'
version
'
:
1
,
...
...
@@ -31,6 +32,7 @@ dictConfig({
})
app
=
Flask
(
__name__
)
jwt
=
JWTManager
(
app
)
metrics
=
PrometheusMetrics
(
app
)
metrics
.
info
(
'
app_info
'
,
'
Application info
'
,
version
=
'
1.2.0
'
)
app
.
config
[
'
SWAGGER
'
]
=
{
'
openapi
'
:
'
3.0.0
'
,
'
title
'
:
'
Swagger UI
'
,
'
uiversion
'
:
3
}
...
...
@@ -194,6 +196,7 @@ def get_concept_label():
@app.route
(
'
/api/semantics/concept
'
,
methods
=
[
'
POST
'
],
endpoint
=
'
concepts_save
'
)
@swag_from
(
'
us-yml/post_concept.yml
'
)
@jwt_required
()
def
save_concept
():
input_json
=
request
.
get_json
()
logging
.
debug
(
'
endpoint save concept, body=%s
'
,
input_json
)
...
...
@@ -216,7 +219,8 @@ def save_concept():
@app.route
(
'
/api/semantics/unit
'
,
methods
=
[
'
POST
'
],
endpoint
=
'
units_save
'
)
@swag_from
(
'
us-yml/post_unit.yml
'
)
def
save_concept
():
@jwt_required
()
def
save_unit
():
input_json
=
request
.
get_json
()
logging
.
debug
(
'
endpoint save unit, body=%s
'
,
input_json
)
try
:
...
...
This diff is collapsed.
Click to expand it.
dbrepo-semantics-service/requirements.txt
+
2
−
1
View file @
990a6e70
...
...
@@ -37,3 +37,4 @@ zope.interface==5.5.2
html5lib==1.1
pytest==7.2.1
coverage==7.1.0
Flask-JWT-Extended==4.4.4
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment