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
b0ae68b0
Commit
b0ae68b0
authored
Jun 24, 2021
by
Alfonso Orta
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'staging'
Develop See merge request
!40
parents
e7b081ad
3966f9e5
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
104 additions
and
17 deletions
+104
-17
routes.yml
...on-hub/business-logic-microservice/app/configs/routes.yml
+68
-9
main.py
...participation-hub/business-logic-microservice/app/main.py
+2
-0
requirements.txt
...tion-hub/business-logic-microservice/app/requirements.txt
+1
-0
layer.py
...ation-hub/business-logic-microservice/app/routes/layer.py
+14
-4
tables.py
...tion-hub/business-logic-microservice/app/routes/tables.py
+9
-1
use_case.py
...on-hub/business-logic-microservice/app/routes/use_case.py
+5
-1
blockchain_trace.py
src/rest-gateway/app/routes/blockchain_trace.py
+1
-1
user.py
src/rest-gateway/app/routes/user.py
+1
-1
main.py
...ansaction-hub-in/trace-retrieval-microservice/app/main.py
+2
-0
requirements.txt
...-hub-in/trace-retrieval-microservice/app/requirements.txt
+1
-0
No files found.
src/participation-hub/business-logic-microservice/app/configs/routes.yml
View file @
b0ae68b0
...
@@ -5,7 +5,7 @@ paths:
...
@@ -5,7 +5,7 @@ paths:
/use-cases
:
/use-cases
:
post
:
post
:
security
:
security
:
-
Jwt
Regular
:
[]
-
Jwt
Admin
:
[]
operationId
:
"
routes.use_case.add"
operationId
:
"
routes.use_case.add"
tags
:
tags
:
-
"
Use-Cases"
-
"
Use-Cases"
...
@@ -46,9 +46,18 @@ paths:
...
@@ -46,9 +46,18 @@ paths:
-
"
Use-Cases"
-
"
Use-Cases"
summary
:
"
Delete
all
Use-Cases"
summary
:
"
Delete
all
Use-Cases"
description
:
"
Delete
all
Use-Cases"
description
:
"
Delete
all
Use-Cases"
parameters
:
-
name
:
"
confirmation"
desciption
:
"
'yes'
to
confirm
deletion"
in
:
"
query"
required
:
true
schema
:
type
:
"
string"
responses
:
responses
:
'
200'
:
'
200'
:
description
:
"
Successful
Request"
description
:
"
Successful
Request"
'
403'
:
description
:
"
Confirmation
required"
#####
#####
# TABLES
# TABLES
#####
#####
...
@@ -66,15 +75,24 @@ paths:
...
@@ -66,15 +75,24 @@ paths:
description
:
"
Successful
Request"
description
:
"
Successful
Request"
delete
:
delete
:
security
:
security
:
-
Jwt
Regular
:
[]
-
Jwt
Admin
:
[]
operationId
:
"
routes.tables.delete_all"
operationId
:
"
routes.tables.delete_all"
tags
:
tags
:
-
"
Tables"
-
"
Tables"
summary
:
"
Delete
all
Tables"
summary
:
"
Delete
all
Tables"
description
:
"
Delete
all
Tables"
description
:
"
Delete
all
Tables"
parameters
:
-
name
:
"
confirmation"
desciption
:
"
'yes'
to
confirm
deletion"
in
:
"
query"
required
:
true
schema
:
type
:
"
string"
responses
:
responses
:
'
200'
:
'
200'
:
description
:
"
Successful
Request"
description
:
"
Successful
Request"
'
403'
:
description
:
"
Confirmation
required"
/use-cases/{use_case}/tables
:
/use-cases/{use_case}/tables
:
get
:
get
:
security
:
security
:
...
@@ -95,7 +113,7 @@ paths:
...
@@ -95,7 +113,7 @@ paths:
description
:
"
Successful
Request"
description
:
"
Successful
Request"
post
:
post
:
security
:
security
:
-
Jwt
Regular
:
[]
-
Jwt
Admin
:
[]
operationId
:
"
routes.tables.add_complete"
operationId
:
"
routes.tables.add_complete"
tags
:
tags
:
-
"
Tables"
-
"
Tables"
...
@@ -131,15 +149,23 @@ paths:
...
@@ -131,15 +149,23 @@ paths:
description
:
"
Name
of
the
Use-Case
the
Table
belongs
to"
description
:
"
Name
of
the
Use-Case
the
Table
belongs
to"
required
:
true
required
:
true
type
:
"
string"
type
:
"
string"
-
name
:
"
confirmation"
desciption
:
"
'yes'
to
confirm
deletion"
in
:
"
query"
required
:
true
schema
:
type
:
"
string"
responses
:
responses
:
'
200'
:
'
200'
:
description
:
"
Successful
Request"
description
:
"
Successful
Request"
'
400'
:
'
400'
:
description
:
"
Table
with
the
name
already
exists
or
missing
fields
in
the
request."
description
:
"
Table
with
the
name
already
exists
or
missing
fields
in
the
request."
'
403'
:
description
:
"
Confirmation
required"
/use-cases/{use_case}/tables/{name}/mapping
:
/use-cases/{use_case}/tables/{name}/mapping
:
put
:
put
:
security
:
security
:
-
Jwt
Regular
:
[]
-
Jwt
Admin
:
[]
operationId
:
"
routes.tables.put_mapping"
operationId
:
"
routes.tables.put_mapping"
tags
:
tags
:
-
"
Tables"
-
"
Tables"
...
@@ -193,12 +219,21 @@ paths:
...
@@ -193,12 +219,21 @@ paths:
-
"
Layers"
-
"
Layers"
summary
:
"
Delete
all
Layers
from
the
DB"
summary
:
"
Delete
all
Layers
from
the
DB"
description
:
"
Delete
all
Layers
from
the
DB"
description
:
"
Delete
all
Layers
from
the
DB"
parameters
:
-
name
:
"
confirmation"
desciption
:
"
'yes'
to
confirm
deletion"
in
:
"
query"
required
:
true
schema
:
type
:
"
string"
responses
:
responses
:
'
200'
:
'
200'
:
description
:
"
Successful
Request"
description
:
"
Successful
Request"
'
403'
:
description
:
"
confirmation
required"
post
:
post
:
security
:
security
:
-
Jwt
Regular
:
[]
-
Jwt
Admin
:
[]
operationId
:
"
routes.layer.add_complete"
operationId
:
"
routes.layer.add_complete"
tags
:
tags
:
-
"
Layers"
-
"
Layers"
...
@@ -243,7 +278,7 @@ paths:
...
@@ -243,7 +278,7 @@ paths:
/use-cases/{use_case}/tables/{table}/layers/{name}/cluster-mapping
:
/use-cases/{use_case}/tables/{table}/layers/{name}/cluster-mapping
:
put
:
put
:
security
:
security
:
-
Jwt
Regular
:
[]
-
Jwt
Admin
:
[]
operationId
:
"
routes.layer.add_cluster_mapping"
operationId
:
"
routes.layer.add_cluster_mapping"
tags
:
tags
:
-
"
Layers"
-
"
Layers"
...
@@ -284,7 +319,7 @@ paths:
...
@@ -284,7 +319,7 @@ paths:
description
:
"
Field
in
request
is
missing
or
attribute
does
not
exist
in
the
Layer"
description
:
"
Field
in
request
is
missing
or
attribute
does
not
exist
in
the
Layer"
delete
:
delete
:
security
:
security
:
-
Jwt
Regular
:
[]
-
Jwt
Admin
:
[]
operationId
:
"
routes.layer.delete_cluster_mapping"
operationId
:
"
routes.layer.delete_cluster_mapping"
tags
:
tags
:
-
"
Layers"
-
"
Layers"
...
@@ -316,6 +351,12 @@ paths:
...
@@ -316,6 +351,12 @@ paths:
type
:
string
type
:
string
example
:
"
end_time"
example
:
"
end_time"
description
:
"
Internal
name
of
the
attribute"
description
:
"
Internal
name
of
the
attribute"
-
name
:
"
confirmation"
desciption
:
"
'yes'
to
confirm
deletion"
in
:
"
query"
required
:
true
schema
:
type
:
"
string"
responses
:
responses
:
'
200'
:
'
200'
:
description
:
"
Successful
Request"
description
:
"
Successful
Request"
...
@@ -323,6 +364,8 @@ paths:
...
@@ -323,6 +364,8 @@ paths:
description
:
"
Layer
does
not
exist"
description
:
"
Layer
does
not
exist"
'
400'
:
'
400'
:
description
:
"
Field
in
request
is
missing
or
attribute
does
not
exist
in
the
Layer"
description
:
"
Field
in
request
is
missing
or
attribute
does
not
exist
in
the
Layer"
'
403'
:
description
:
"
Confirmation
required"
/use-cases/{use_case}/layers
:
/use-cases/{use_case}/layers
:
get
:
get
:
security
:
security
:
...
@@ -375,7 +418,7 @@ paths:
...
@@ -375,7 +418,7 @@ paths:
description
:
"
Layer
does
not
exist"
description
:
"
Layer
does
not
exist"
delete
:
delete
:
security
:
security
:
-
Jwt
Regular
:
[]
-
Jwt
Admin
:
[]
operationId
:
"
routes.layer.delete_one"
operationId
:
"
routes.layer.delete_one"
tags
:
tags
:
-
"
Layers"
-
"
Layers"
...
@@ -397,15 +440,23 @@ paths:
...
@@ -397,15 +440,23 @@ paths:
description
:
"
Name
of
the
Layer"
description
:
"
Name
of
the
Layer"
required
:
true
required
:
true
type
:
"
string"
type
:
"
string"
-
name
:
"
confirmation"
desciption
:
"
'yes'
to
confirm
deletion"
in
:
"
query"
required
:
true
schema
:
type
:
"
string"
responses
:
responses
:
'
200'
:
'
200'
:
description
:
"
Successful
Request"
description
:
"
Successful
Request"
'
404'
:
'
404'
:
description
:
"
Layer
does
not
exist"
description
:
"
Layer
does
not
exist"
'
403'
:
description
:
"
Confirmation
required"
/use-cases/{use_case}/layers/{name}/mapping
:
/use-cases/{use_case}/layers/{name}/mapping
:
put
:
put
:
security
:
security
:
-
Jwt
Regular
:
[]
-
Jwt
Admin
:
[]
operationId
:
"
routes.layer.add_mapping"
operationId
:
"
routes.layer.add_mapping"
tags
:
tags
:
-
"
Layers"
-
"
Layers"
...
@@ -458,6 +509,12 @@ paths:
...
@@ -458,6 +509,12 @@ paths:
required
:
true
required
:
true
schema
:
schema
:
$ref
:
'
#/definitions/LayerMapping'
$ref
:
'
#/definitions/LayerMapping'
-
name
:
"
confirmation"
desciption
:
"
'yes'
to
confirm
deletion"
in
:
"
query"
required
:
true
schema
:
type
:
"
string"
responses
:
responses
:
'
200'
:
'
200'
:
description
:
"
Successful
Request"
description
:
"
Successful
Request"
...
@@ -465,6 +522,8 @@ paths:
...
@@ -465,6 +522,8 @@ paths:
description
:
"
Layer
does
not
exist"
description
:
"
Layer
does
not
exist"
'
400'
:
'
400'
:
description
:
"
Field
in
request
is
missing"
description
:
"
Field
in
request
is
missing"
'
403'
:
description
:
"
Confirmation
required"
definitions
:
definitions
:
LayerMapping
:
LayerMapping
:
...
...
src/participation-hub/business-logic-microservice/app/main.py
View file @
b0ae68b0
...
@@ -14,8 +14,10 @@ from security import swagger_util
...
@@ -14,8 +14,10 @@ from security import swagger_util
from
env_info
import
is_running_locally
,
get_resources_path
from
env_info
import
is_running_locally
,
get_resources_path
from
flask
import
request
from
flask
import
request
from
flask
import
redirect
from
flask
import
redirect
from
flask_cors
import
CORS
app
=
connexion
.
App
(
__name__
,
specification_dir
=
'configs/'
)
app
=
connexion
.
App
(
__name__
,
specification_dir
=
'configs/'
)
CORS
(
app
.
app
)
from
db.entities.layer_adapter
import
LayerAdapter
from
db.entities.layer_adapter
import
LayerAdapter
...
...
src/participation-hub/business-logic-microservice/app/requirements.txt
View file @
b0ae68b0
...
@@ -11,6 +11,7 @@ connexion==2.7.0
...
@@ -11,6 +11,7 @@ connexion==2.7.0
coverage==5.3.1
coverage==5.3.1
cryptography==3.1
cryptography==3.1
Flask==1.1.2
Flask==1.1.2
Flask-Cors==3.0.10
idna==2.10
idna==2.10
importlib-metadata==1.7.0
importlib-metadata==1.7.0
inflection==0.5.0
inflection==0.5.0
...
...
src/participation-hub/business-logic-microservice/app/routes/layer.py
View file @
b0ae68b0
...
@@ -16,10 +16,16 @@ def all():
...
@@ -16,10 +16,16 @@ def all():
return
[
layer
.
to_serializable_dict
()
for
layer
in
layer_repository
.
all
()]
return
[
layer
.
to_serializable_dict
()
for
layer
in
layer_repository
.
all
()]
def
delete_all_layers
():
def
delete_all_layers
(
confirmation
:
str
):
'''
'''
delete all layers from the DB
delete all layers from the DB
@params:
confirmation - Required : "yes" to confirm deletion
'''
'''
if
confirmation
!=
"yes"
return
Response
(
status
=
403
)
layer_repository
.
delete_all
()
layer_repository
.
delete_all
()
return
Response
(
status
=
200
)
return
Response
(
status
=
200
)
...
@@ -142,7 +148,7 @@ def one(use_case: str, table: str, name: str):
...
@@ -142,7 +148,7 @@ def one(use_case: str, table: str, name: str):
return
Response
(
status
=
200
,
response
=
json
.
dumps
(
layer
.
to_serializable_dict
()))
return
Response
(
status
=
200
,
response
=
json
.
dumps
(
layer
.
to_serializable_dict
()))
def
delete_mapping
(
use_case
:
str
,
table
:
str
,
name
:
str
):
def
delete_mapping
(
use_case
:
str
,
table
:
str
,
name
:
str
,
confirmation
:
str
):
'''
'''
delete a mapping from the layer identified by the internal representation
delete a mapping from the layer identified by the internal representation
...
@@ -150,6 +156,7 @@ def delete_mapping(use_case: str, table: str, name: str):
...
@@ -150,6 +156,7 @@ def delete_mapping(use_case: str, table: str, name: str):
use_case - Required : String-identifier for the Use-Case the Layer belongs to
use_case - Required : String-identifier for the Use-Case the Layer belongs to
table - Required : unique identifier of the Table the Layer belongs to
table - Required : unique identifier of the Table the Layer belongs to
name - Required : unique identifier for the Layer
name - Required : unique identifier for the Layer
confirmation- Required : "yes" to confirm deletion
'''
'''
use_case_repository
.
put
(
use_case
)
use_case_repository
.
put
(
use_case
)
...
@@ -206,7 +213,7 @@ def add_mapping(name: str, table: str, use_case: str):
...
@@ -206,7 +213,7 @@ def add_mapping(name: str, table: str, use_case: str):
return
Response
(
status
=
200
)
return
Response
(
status
=
200
)
def
delete_one
(
use_case
:
str
,
table
:
str
,
name
:
str
):
def
delete_one
(
use_case
:
str
,
table
:
str
,
name
:
str
,
confirmation
:
str
):
'''
'''
delete a layer and all its mappings from the Db
delete a layer and all its mappings from the Db
...
@@ -214,7 +221,10 @@ def delete_one(use_case: str, table: str, name: str):
...
@@ -214,7 +221,10 @@ def delete_one(use_case: str, table: str, name: str):
use_case - Required : String-identifier for the Use-Case the Layer belongs to
use_case - Required : String-identifier for the Use-Case the Layer belongs to
table - Required : unique identifier of the Table the Layer belongs to
table - Required : unique identifier of the Table the Layer belongs to
name - Required : unique identifier for the Layer
name - Required : unique identifier for the Layer
confirmation- Required : "yes" to confirm deletion
'''
'''
if
confirmation
!=
"yes"
return
Response
(
status
=
403
)
layer
=
layer_repository
.
one
(
name
,
use_case
,
table
)
layer
=
layer_repository
.
one
(
name
,
use_case
,
table
)
...
...
src/participation-hub/business-logic-microservice/app/routes/tables.py
View file @
b0ae68b0
...
@@ -51,10 +51,18 @@ def add_complete(use_case: str):
...
@@ -51,10 +51,18 @@ def add_complete(use_case: str):
return
Response
(
status
=
200
)
return
Response
(
status
=
200
)
def
delete_all_for_use_case
(
use_case
:
str
):
def
delete_all_for_use_case
(
use_case
:
str
,
confirmation
:
str
):
if
confirmation
!=
"yes"
return
Response
(
status
=
403
)
table_repository
.
delete_for_use_case
(
use_case
)
table_repository
.
delete_for_use_case
(
use_case
)
return
Response
(
status
=
200
)
return
Response
(
status
=
200
)
def
delete_all
():
def
delete_all
():
if
confirmation
!=
"yes"
return
Response
(
status
=
403
)
table_repository
.
delete_all
()
table_repository
.
delete_all
()
return
Response
(
status
=
200
)
return
Response
(
status
=
200
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/routes/use_case.py
View file @
b0ae68b0
...
@@ -15,7 +15,11 @@ repository = Repository()
...
@@ -15,7 +15,11 @@ repository = Repository()
def
all
():
def
all
():
return
[
use_case
.
to_serializable_dict
()
for
use_case
in
use_case_repository
.
all
()]
return
[
use_case
.
to_serializable_dict
()
for
use_case
in
use_case_repository
.
all
()]
def
delete_all
():
def
delete_all
(
confirmation
:
str
):
if
confirmation
!=
"yes"
return
Response
(
status
=
403
)
use_case_repository
.
delete_all
()
use_case_repository
.
delete_all
()
repository
.
delete_all
()
repository
.
delete_all
()
table_repository
.
delete_all
()
table_repository
.
delete_all
()
...
...
src/rest-gateway/app/routes/blockchain_trace.py
View file @
b0ae68b0
...
@@ -17,4 +17,4 @@ def receive():
...
@@ -17,4 +17,4 @@ def receive():
def
isBlockchainTraceValid
(
trace
)
->
bool
:
def
isBlockchainTraceValid
(
trace
)
->
bool
:
# different for every use case, no global schema
# different for every use case, no global schema
return
'ApplicationType'
in
trace
return
'ApplicationType'
in
trace
and
'docType'
in
trace
src/rest-gateway/app/routes/user.py
View file @
b0ae68b0
...
@@ -52,7 +52,7 @@ def delete(username):
...
@@ -52,7 +52,7 @@ def delete(username):
return
Response
(
status
=
204
)
return
Response
(
status
=
204
)
except
ValueError
as
e
:
except
ValueError
as
e
:
# return 400 if the user
already exists
# return 400 if the user
does not exist
return
Response
(
status
=
400
,
response
=
str
(
e
))
return
Response
(
status
=
400
,
response
=
str
(
e
))
def
add
():
def
add
():
...
...
src/transaction-hub-in/trace-retrieval-microservice/app/main.py
View file @
b0ae68b0
...
@@ -25,6 +25,7 @@ from messaging.ReconnectingMessageManager import ReconnectingMessageManager
...
@@ -25,6 +25,7 @@ from messaging.ReconnectingMessageManager import ReconnectingMessageManager
from
messaging.rest_fetcher
import
RestFetcher
from
messaging.rest_fetcher
import
RestFetcher
from
flask
import
request
from
flask
import
request
from
flask
import
redirect
from
flask
import
redirect
from
flask_cors
import
CORS
# init message handler
# init message handler
message_handler
:
MessageHandler
=
None
message_handler
:
MessageHandler
=
None
...
@@ -33,6 +34,7 @@ def message_received_callback(channel, method, properties, body):
...
@@ -33,6 +34,7 @@ def message_received_callback(channel, method, properties, body):
# load swagger config
# load swagger config
app
=
connexion
.
App
(
__name__
,
specification_dir
=
'configs/'
)
app
=
connexion
.
App
(
__name__
,
specification_dir
=
'configs/'
)
CORS
(
app
.
app
)
@
app
.
app
.
before_request
@
app
.
app
.
before_request
def
before_request
():
def
before_request
():
...
...
src/transaction-hub-in/trace-retrieval-microservice/app/requirements.txt
View file @
b0ae68b0
...
@@ -11,6 +11,7 @@ coverage==5.3.1
...
@@ -11,6 +11,7 @@ coverage==5.3.1
cryptography==3.1
cryptography==3.1
Deprecated==1.2.10
Deprecated==1.2.10
Flask==1.1.2
Flask==1.1.2
Flask-Cors==3.0.10
idna==2.10
idna==2.10
importlib-metadata==1.7.0
importlib-metadata==1.7.0
inflection==0.5.1
inflection==0.5.1
...
...
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