Skip to content

Commit ab3562e

Browse files
authored
Merge pull request #313 from GaneshPatil7517/fix/remove-api-key-logging
security: prevent API key leakage in wrapper script logs (fixes #263)
2 parents 7eb46ef + 7803521 commit ab3562e

4 files changed

Lines changed: 2 additions & 6 deletions

File tree

demo/cwrap.py

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

61-
print(apikey)
6261
print(yuyu)
6362
print(name1+'='+init_simtime_u)
6463
print(name2+'='+init_simtime_ym)
@@ -83,7 +82,7 @@
8382
u = concore.read(1,name1,init_simtime_u)
8483
f = {'file1': open(concore.inpath+'1/'+name1, 'rb')}
8584
print("CW: before post u="+str(u))
86-
print('http://www.controlcore.org/pm/'+yuyu+apikey+'&fetch='+name2)
85+
print('http://www.controlcore.org/pm/'+yuyu+'<APIKEY_HIDDEN>'+'&fetch='+name2)
8786
r = requests.post('http://www.controlcore.org/pm/'+yuyu+apikey+'&fetch='+name2, files=f,timeout=timeout_max)
8887
if r.status_code!=200:
8988
print("bad POST request "+str(r.status_code))

demo/pwrap.py

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

64-
print(apikey)
6564
print(yuyu)
6665
print(name1+'='+init_simtime_u)
6766
print(name2+'='+init_simtime_ym)

ratc/cwrap.py

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

61-
print(apikey)
6261
print(yuyu)
6362
print(name1+'='+init_simtime_u)
6463
print(name2+'='+init_simtime_ym)
@@ -83,7 +82,7 @@
8382
u = concore.read(1,name1,init_simtime_u)
8483
f = {'file1': open(concore.inpath+'1/'+name1, 'rb')}
8584
print("CW: before post u="+str(u))
86-
print('http://www.controlcore.org/pm/'+yuyu+apikey+'&fetch='+name2)
85+
print('http://www.controlcore.org/pm/'+yuyu+'<APIKEY_HIDDEN>'+'&fetch='+name2)
8786
r = requests.post('http://www.controlcore.org/pm/'+yuyu+apikey+'&fetch='+name2, files=f,timeout=timeout_max)
8887
if r.status_code!=200:
8988
print("bad POST request "+str(r.status_code))

ratc/pwrap.py

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

64-
print(apikey)
6564
print(yuyu)
6665
print(name1+'='+init_simtime_u)
6766
print(name2+'='+init_simtime_ym)

0 commit comments

Comments
 (0)