Skip to content

Commit 37abab4

Browse files
security: remove API key logging from wrapper scripts (fixes #263)
1 parent b289c32 commit 37abab4

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

demo/cwrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
except:
5959
init_simtime_ym = "[0.0, 0.0, 0.0]"
6060

61-
print(apikey)
61+
# Do not log API key for security reasons
6262
print(yuyu)
6363
print(name1+'='+init_simtime_u)
6464
print(name2+'='+init_simtime_ym)
@@ -83,7 +83,7 @@
8383
u = concore.read(1,name1,init_simtime_u)
8484
f = {'file1': open(concore.inpath+'1/'+name1, 'rb')}
8585
print("CW: before post u="+str(u))
86-
print('http://www.controlcore.org/pm/'+yuyu+apikey+'&fetch='+name2)
86+
print('http://www.controlcore.org/pm/'+yuyu+'<APIKEY_HIDDEN>'+'&fetch='+name2)
8787
r = requests.post('http://www.controlcore.org/pm/'+yuyu+apikey+'&fetch='+name2, files=f,timeout=timeout_max)
8888
if r.status_code!=200:
8989
print("bad POST request "+str(r.status_code))

demo/pwrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
except:
6262
init_simtime_ym = "[0.0, 0.0, 0.0]"
6363

64-
print(apikey)
64+
# Do not log API key for security reasons
6565
print(yuyu)
6666
print(name1+'='+init_simtime_u)
6767
print(name2+'='+init_simtime_ym)

ratc/cwrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
except:
5959
init_simtime_ym = "[0.0, 0.0, 0.0]"
6060

61-
print(apikey)
61+
# Do not log API key for security reasons
6262
print(yuyu)
6363
print(name1+'='+init_simtime_u)
6464
print(name2+'='+init_simtime_ym)
@@ -83,7 +83,7 @@
8383
u = concore.read(1,name1,init_simtime_u)
8484
f = {'file1': open(concore.inpath+'1/'+name1, 'rb')}
8585
print("CW: before post u="+str(u))
86-
print('http://www.controlcore.org/pm/'+yuyu+apikey+'&fetch='+name2)
86+
print('http://www.controlcore.org/pm/'+yuyu+'<APIKEY_HIDDEN>'+'&fetch='+name2)
8787
r = requests.post('http://www.controlcore.org/pm/'+yuyu+apikey+'&fetch='+name2, files=f,timeout=timeout_max)
8888
if r.status_code!=200:
8989
print("bad POST request "+str(r.status_code))

ratc/pwrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
except:
6262
init_simtime_ym = "[0.0, 0.0, 0.0]"
6363

64-
print(apikey)
64+
# Do not log API key for security reasons
6565
print(yuyu)
6666
print(name1+'='+init_simtime_u)
6767
print(name2+'='+init_simtime_ym)

0 commit comments

Comments
 (0)