How to avoid exposing the passwd when using curl to run an RTC query on the command line ?
C:\Users\gr4truo\Documents\junk\curl>curl -k -c ..\query\run\cookie.txt https://<RTCserver:port>/jts/authenticated/identity -o quiet.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1983 100 1983 0 0 237 0 0:00:08 0:00:08 --:--:-- 492
C:\Users\gr4truo\Documents\junk\curl>curl -k -L -b ..\query\run\cookie.txt -c ..\query\run\cookie.txt -d j_username=<id> -d j_password=<pwd> https://<RTCserver:port>/jts/authenticated/j_security_check -o quiet.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 38 0 0 100 38 0 25 0:00:01 0:00:01 --:--:-- 25
100 58 100 58 0 0 31 0 0:00:01 0:00:01 --:--:-- 0
C:\Users\gr4truo\Documents\junk\curl>curl -k -b ..\query\run\cookie.txt https://<RTCserver:port>/ccm/resource/itemOid/com.ibm.team.workitem.query.QueryDescriptor/_lXptgOouEeK1n5H9W5_BtQ?_mediaType=text/csv -o dump_10000.csv
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 604k 0 604k 0 0 5424 0 --:--:-- 0:01:54 --:--:-- 14441
- The ID & passwd are hardwired into the batch file, we just wonder if we can somehow avoid the exposure of the passwd either through encryption or via LDAP ?
- Also this script is great for automating collection of the query results.
- But to fulfill its original intention, picking up the Time Spent as a measure of the RTC performance, it is not a true measure of the performance: As the majority of time spent is on exporting/creating the CSV file not to run the query. Have tried a query which run for 10 secs took 5 min to export to a CSV file on webUI, took 12 min by this script.
- Not familiar with curl, and had tried to modify the batch file in vain to dump the retrieved infos: Is there a way to just time the query, separate and isolate from outputting the results into a csv file ?
2 answers
go.bat 2>&1 >output.txtIf you do adapt this method, remove the "pause" at the end of the script, otherwise you tend to forget to press a key and wonder why the script runs so long.
I updated my plainjava query sample to demonstrate it
accepted answer here https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes