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
1d8d00f3
Commit
1d8d00f3
authored
Sep 02, 2020
by
Manuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
traceRetrieval: security definitions + handling of missing ApplicationType
parent
19cfc8fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
67 deletions
+37
-67
swagger.yml
...b-in/trace-retrieval-microservice/app/configs/swagger.yml
+31
-67
MessageHandler.py
...ce-retrieval-microservice/app/messaging/MessageHandler.py
+6
-0
No files found.
src/transaction-hub-in/trace-retrieval-microservice/app/configs/swagger.yml
View file @
1d8d00f3
...
...
@@ -11,10 +11,16 @@ produces:
basePath
:
"
/api"
# Import security definitions from seperate file
securityDefinitions
:
$ref
:
'
../security/security.yml#securityDefinitions'
# Paths supported by the server application
paths
:
/transactions
:
delete
:
security
:
-
JwtRegular
:
[]
operationId
:
"
routes.transactions.delete_all_transactions"
tags
:
-
"
Transactions"
...
...
@@ -23,13 +29,31 @@ paths:
responses
:
'
200'
:
description
:
"
Successful
Request"
/transactions-failed/use_case/{use_case}
:
/use_cases/{use_case}/transactions-failed
:
delete
:
security
:
-
JwtRegular
:
[]
operationId
:
"
routes.transactions.delete_all_failed_for_use_case"
tags
:
-
"
Transactions"
summary
:
"
Deletes
all
failed
Transactions
in
the
given
Use-Case"
description
:
"
Deletes
all
failed
Transactions
in
the
given
Use-Case"
parameters
:
-
in
:
path
name
:
"
use_case"
required
:
true
type
:
"
string"
responses
:
'
200'
:
description
:
"
Successful
Request"
get
:
security
:
-
JwtRegular
:
[]
operationId
:
"
routes.transactions.all_failed_for_use_case"
tags
:
-
"
Transactions"
summary
:
"
Retrieves
all
Transactions
in
the
given
Use-Case"
description
:
"
Retrieves
all
Transactions
in
the
given
Use-Case"
summary
:
"
Retrieves
all
failed
Transactions
in
the
given
Use-Case"
description
:
"
Retrieves
all
failed
Transactions
in
the
given
Use-Case"
parameters
:
-
in
:
path
name
:
"
use_case"
...
...
@@ -38,8 +62,10 @@ paths:
responses
:
'
200'
:
description
:
"
Successful
Request"
/
transactions/use_case/{use_case}
:
/
use_cases/{use_case}/transactions
:
get
:
security
:
-
JwtRegular
:
[]
operationId
:
"
routes.transactions.all_for_use_case"
tags
:
-
"
Transactions"
...
...
@@ -69,66 +95,4 @@ paths:
type
:
object
responses
:
'
200'
:
description
:
"
Successful
echo
of
request
data"
/trace
:
post
:
operationId
:
"
routes.blockchain_trace.post"
tags
:
-
"
Blockchain
Trace"
summary
:
"
Add
a
new
blockchain
trace
to
SMART"
description
:
"
Receives
a
new
blockchain
trace
to
store
in
SMART."
parameters
:
-
in
:
body
name
:
"
BlockchainTrace"
description
:
"
The
trace
to
be
added"
required
:
true
schema
:
$ref
:
"
#/definitions/BlockchainTrace"
responses
:
'
201'
:
description
:
"
Successful
operation"
'
400'
:
description
:
"
Invalid
input"
get
:
operationId
:
"
routes.blockchain_trace.get"
tags
:
-
"
Blockchain
Trace"
summary
:
"
Get
blockchain
traces"
description
:
"
Returns
all
blockchain
traces
in
the
database"
parameters
:
[]
responses
:
'
200'
:
description
:
"
Successful
operation"
schema
:
$ref
:
"
#/definitions/BlockchainTrace"
definitions
:
BlockchainTrace
:
type
:
"
object"
properties
:
TransactionId
:
type
:
string
format
:
uuid
Timestamp
:
type
:
"
string"
format
:
"
date-time"
ApplicationType
:
type
:
"
string"
TransactionFrom
:
type
:
"
string"
format
:
"
uuid"
TransactionTo
:
type
:
"
string"
format
:
"
uuid"
TransferredAsset
:
type
:
"
string"
ResourceIds
:
type
:
"
string"
ResourceMd5
:
type
:
"
string"
ResourceState
:
type
:
"
string"
Metadata
:
type
:
"
string"
\ No newline at end of file
description
:
"
Successful
echo
of
request
data"
\ No newline at end of file
src/transaction-hub-in/trace-retrieval-microservice/app/messaging/MessageHandler.py
View file @
1d8d00f3
...
...
@@ -150,6 +150,12 @@ class MessageHandler:
transaction_message - Required: data of the transaction. Has to contain the key 'ApplicationType' which stores the use-case.
'''
if
"ApplicationType"
not
in
transaction_message
.
keys
():
LOGGER
.
error
(
"Transaction has no ApplicationType, storing it under use-case 'unknown'."
)
transaction_message
[
"ApplicationType"
]
=
"unknown"
MessageHandler
.
_repository
.
add_failed_transaction
(
transaction_message
)
return
use_case
=
transaction_message
[
"ApplicationType"
]
try
:
...
...
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