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
e42e3172
Commit
e42e3172
authored
Sep 17, 2021
by
Manuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed business-logic-scripts to fetch admin tokens
parent
b47868c5
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
14 additions
and
22 deletions
+14
-22
token_manager.py
src/modules/security/token_manager.py
+3
-2
add_bank_app_schema.py
...app/_add_use_case_scripts/bank-app/add_bank_app_schema.py
+1
-1
add_carsharing_schema.py
...add_use_case_scripts/car_sharing/add_carsharing_schema.py
+1
-10
add_carsharingofficial_schema.py
...pts/car_sharing_official/add_carsharingofficial_schema.py
+1
-1
add_schema.py
..._use_case_scripts/community-prediction/taxi/add_schema.py
+1
-1
add_schema.py
...e_case_scripts/community-prediction/youtube/add_schema.py
+1
-1
add_crowdjournalism_schema.py
...se_scripts/crowd_journalism/add_crowdjournalism_schema.py
+2
-2
add_event.py
...add_use_case_scripts/crowd_journalism/tables/add_event.py
+1
-1
add_debug_schema.py
...rvice/app/_add_use_case_scripts/debug/add_debug_schema.py
+1
-1
add_smart_reddit_schema.py
...p/_add_use_case_scripts/reddit/add_smart_reddit_schema.py
+1
-1
add_smart_energy_schema.py
..._use_case_scripts/smart-energy/add_smart_energy_schema.py
+1
-1
No files found.
src/modules/security/token_manager.py
View file @
e42e3172
...
...
@@ -23,10 +23,11 @@ class TokenManager:
def
getToken
(
self
,
admin
=
False
)
->
str
:
if
self
.
_token
==
None
:
credentials_path
=
get_resources_path
()
credentials_path
=
f
"{credentials_path}/{'admin' if admin else 'regular'}_user_credentials.json"
print
(
"Looking for credentials at ... "
+
str
(
credentials_path
)
)
print
(
f
"Looking for credentials at '{credentials_path}'"
)
with
open
(
f
"{credentials_path}/{'admin' if admin else 'regular'}_user_credentials.json"
)
as
file_handler
:
with
open
(
credentials_path
)
as
file_handler
:
credentials
=
json
.
loads
(
file_handler
.
read
())
url
=
f
'https://{network_constants.REST_GATEWAY_HOSTNAME}:{network_constants.REST_GATEWAY_REST_PORT}/api/tokens'
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/bank-app/add_bank_app_schema.py
View file @
e42e3172
...
...
@@ -15,7 +15,7 @@ import tables.add_bank_app as add_bank_app
def
add_use_case
(
use_case
:
str
):
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
jwt
=
TokenManager
.
getInstance
()
.
getToken
(
admin
=
True
)
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/add_carsharing_schema.py
View file @
e42e3172
...
...
@@ -9,17 +9,8 @@ for modules_path in modules_paths:
if
os
.
path
.
exists
(
modules_path
):
sys
.
path
.
insert
(
1
,
modules_path
)
# import _add_use_case_scripts.car_sharing.tables.add_user as user
from
_add_use_case_scripts.car_sharing.tables
import
add_car
,
add_hash
,
add_offer
,
add_publication
,
add_travel
,
add_user
# import _add_use_case_scripts.car_sharing.tables.add_user as user
# from _add_use_case_scripts.car_sharing.tables import add_car
# from _add_use_case_scripts.car_sharing.tables import add_hash
# from _add_use_case_scripts.car_sharing.tables import add_publication
# from _add_use_case_scripts.car_sharing.tables import add_offer
# from _add_use_case_scripts.car_sharing.tables import add_travel
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
...
...
@@ -28,7 +19,7 @@ from security.token_manager import TokenManager
def
add_use_case
(
use_case
:
str
):
use_case
=
"car-sharing"
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
jwt
=
TokenManager
.
getInstance
()
.
getToken
(
admin
=
True
)
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/add_carsharingofficial_schema.py
View file @
e42e3172
...
...
@@ -22,7 +22,7 @@ from security.token_manager import TokenManager
def
add_use_case
(
use_case
:
str
):
use_case
=
"car-sharing-official"
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
jwt
=
TokenManager
.
getInstance
()
.
getToken
(
admin
=
True
)
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/community-prediction/taxi/add_schema.py
View file @
e42e3172
...
...
@@ -14,7 +14,7 @@ from security.token_manager import TokenManager
import
tables.add_table
as
add_table
def
add_use_case
(
use_case
:
str
):
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
jwt
=
TokenManager
.
getInstance
()
.
getToken
(
admin
=
True
)
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/community-prediction/youtube/add_schema.py
View file @
e42e3172
...
...
@@ -14,7 +14,7 @@ from security.token_manager import TokenManager
import
tables.add_table
as
add_table
def
add_use_case
(
use_case
:
str
):
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
jwt
=
TokenManager
.
getInstance
()
.
getToken
(
admin
=
True
)
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/crowd_journalism/add_crowdjournalism_schema.py
View file @
e42e3172
...
...
@@ -16,7 +16,7 @@ from security.token_manager import TokenManager
def
add_use_case
(
use_case
:
str
):
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
jwt
=
TokenManager
.
getInstance
()
.
getToken
(
admin
=
True
)
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
...
...
@@ -26,7 +26,7 @@ def add_use_case(use_case: str):
json
=
{
"name"
:
use_case
}
)
print
(
url
+
": "
+
str
(
response
.
content
))
print
(
url
+
": "
+
str
(
response
.
content
))
if
__name__
==
"__main__"
:
use_case
=
"crowd-journalism-enum"
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/crowd_journalism/tables/add_event.py
View file @
e42e3172
...
...
@@ -53,7 +53,7 @@ def add_layers(use_case:str, table_name: str):
"UniqueID"
,
"objecttype"
,
"eventid"
,
"evenEpicenter"
,
"even
t
Epicenter"
,
"range"
,
"firstTag"
],
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/debug/add_debug_schema.py
View file @
e42e3172
...
...
@@ -14,7 +14,7 @@ from security.token_manager import TokenManager
import
tables.add_pizza_table
as
pizza
def
add_use_case
(
use_case
:
str
):
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
jwt
=
TokenManager
.
getInstance
()
.
getToken
(
admin
=
True
)
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/reddit/add_smart_reddit_schema.py
View file @
e42e3172
...
...
@@ -14,7 +14,7 @@ from security.token_manager import TokenManager
import
tables.add_reddit
as
reddit
def
add_use_case
(
use_case
:
str
):
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
jwt
=
TokenManager
.
getInstance
()
.
getToken
(
admin
=
True
)
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/smart-energy/add_smart_energy_schema.py
View file @
e42e3172
...
...
@@ -14,7 +14,7 @@ from security.token_manager import TokenManager
import
tables.add_smart_energy
as
smart_energy
def
add_use_case
(
use_case
:
str
):
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
jwt
=
TokenManager
.
getInstance
()
.
getToken
(
admin
=
True
)
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
...
...
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