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
088d8d87
Commit
088d8d87
authored
Sep 02, 2020
by
Manuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restGateway: authenticated request POST /trace
parent
2283c7a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
64 deletions
+36
-64
swagger.yml
src/rest-gateway/app/configs/swagger.yml
+19
-32
swagger_local.yml
src/rest-gateway/app/configs/swagger_local.yml
+17
-29
user.py
src/rest-gateway/app/routes/user.py
+0
-3
No files found.
src/rest-gateway/app/configs/swagger.yml
View file @
088d8d87
...
@@ -15,23 +15,8 @@ produces:
...
@@ -15,23 +15,8 @@ produces:
basePath
:
"
/api"
basePath
:
"
/api"
# Paths supported by the server application
# Paths supported by the server application
paths
:
paths
:
/secret
:
get
:
security
:
-
JwtRegular
:
[]
operationId
:
"
routes.user.secret"
tags
:
-
"
User"
summary
:
"
Testpage
for
authentication"
description
:
"
Should
only
be
accessible
with
a
valid
JWT
token
in
the
'authorization'
header"
responses
:
'
200'
:
description
:
"
OK"
'
401'
:
description
:
"
No
or
an
invalid
token
was
provided"
/tokens/{token}
:
/tokens/{token}
:
post
:
post
:
operationId
:
"
routes.user.verify"
operationId
:
"
routes.user.verify"
...
@@ -154,23 +139,25 @@ paths:
...
@@ -154,23 +139,25 @@ paths:
/trace
:
/trace
:
post
:
post
:
operationId
:
"
routes.blockchain_trace.receive"
security
:
tags
:
-
JwtAdmin
:
[]
-
"
Blockchain
Trace"
operationId
:
"
routes.blockchain_trace.receive"
summary
:
"
Add
a
new
blockchain
trace
to
SMART"
tags
:
description
:
"
Receives
a
new
blockchain
trace
to
store
in
SMART."
-
"
Blockchain
Trace"
parameters
:
summary
:
"
Add
a
new
blockchain
trace
to
SMART"
-
in
:
body
description
:
"
Receives
a
new
blockchain
trace
to
store
in
SMART."
name
:
"
BlockchainTrace"
parameters
:
description
:
"
The
trace
to
be
added"
-
in
:
body
required
:
true
name
:
"
BlockchainTrace"
schema
:
description
:
"
The
trace
to
be
added"
$ref
:
"
#/definitions/BlockchainTrace"
required
:
true
responses
:
schema
:
'
201'
:
$ref
:
"
#/definitions/BlockchainTrace"
description
:
"
Successfully
added"
responses
:
'
400'
:
'
201'
:
description
:
"
Invalid
input"
description
:
"
Successfully
added"
'
400'
:
description
:
"
Invalid
input"
definitions
:
definitions
:
TokenReply
:
TokenReply
:
...
...
src/rest-gateway/app/configs/swagger_local.yml
View file @
088d8d87
...
@@ -15,18 +15,6 @@ basePath: "/api"
...
@@ -15,18 +15,6 @@ basePath: "/api"
# Paths supported by the server application
# Paths supported by the server application
paths
:
paths
:
/secret
:
get
:
operationId
:
"
routes.user.secret"
tags
:
-
"
User"
summary
:
"
Testpage
for
authentication"
description
:
"
Should
only
be
accessible
with
a
valid
JWT
token
in
the
'authorization'
header"
responses
:
'
200'
:
description
:
"
OK"
'
401'
:
description
:
"
No
or
an
invalid
token
was
provided"
/tokens/{token}
:
/tokens/{token}
:
post
:
post
:
operationId
:
"
routes.user.verify"
operationId
:
"
routes.user.verify"
...
@@ -143,23 +131,23 @@ paths:
...
@@ -143,23 +131,23 @@ paths:
/trace
:
/trace
:
post
:
post
:
operationId
:
"
routes.blockchain_trace.receive"
operationId
:
"
routes.blockchain_trace.receive"
tags
:
tags
:
-
"
Blockchain
Trace"
-
"
Blockchain
Trace"
summary
:
"
Add
a
new
blockchain
trace
to
SMART"
summary
:
"
Add
a
new
blockchain
trace
to
SMART"
description
:
"
Receives
a
new
blockchain
trace
to
store
in
SMART."
description
:
"
Receives
a
new
blockchain
trace
to
store
in
SMART."
parameters
:
parameters
:
-
in
:
body
-
in
:
body
name
:
"
BlockchainTrace"
name
:
"
BlockchainTrace"
description
:
"
The
trace
to
be
added"
description
:
"
The
trace
to
be
added"
required
:
true
required
:
true
schema
:
schema
:
$ref
:
"
#/definitions/BlockchainTrace"
$ref
:
"
#/definitions/BlockchainTrace"
responses
:
responses
:
'
201'
:
'
201'
:
description
:
"
Successfully
added"
description
:
"
Successfully
added"
'
400'
:
'
400'
:
description
:
"
Invalid
input"
description
:
"
Invalid
input"
definitions
:
definitions
:
TokenReply
:
TokenReply
:
...
...
src/rest-gateway/app/routes/user.py
View file @
088d8d87
...
@@ -9,9 +9,6 @@ import bcrypt
...
@@ -9,9 +9,6 @@ import bcrypt
import
jwt
import
jwt
import
json
import
json
def
secret
():
return
"Pineapple does not belong to pizza!"
def
verify
(
token
):
def
verify
(
token
):
'''
'''
verifies the validity of a JWT token.
verifies the validity of a JWT token.
...
...
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