lanrat / czds

simple golang API and tools to interact with czds.icann.org
https://pkg.go.dev/github.com/lanrat/czds
GNU General Public License v3.0
72 stars 14 forks source link

czds-report with "Reason" on multiple lines #10

Closed uggyuggy closed 2 years ago

uggyuggy commented 2 years ago

Hi Ian,

Thank's for providing and maintaining this CZDS tool. Very helpful !

Testing the new version including the new extend "feature" I noticed something about the output of czds-report

$ ./czds-report -username "$CZDS_LOGIN" -password "$CZDS_PASS" -verbose -file report-a.csv
2022/07/13 17:06:18 Authenticating to https://account-api.icann.org/api/authenticate
2022/07/13 17:06:19 Saving to report-a.csv

I guess from the header, what should be the expected fields, with one single line per TLD.

$ head -1 report-a.csv
"Email","TLD name","Status","Last Updated","Reason","Expire Date"

But some lines into the csv report looks split on multiple lines

"aaa@example.net","associates","approved","2016-03-17T10:05:46Z","Your request has been approved.

Xxxxx Xxxxxx, CTO
Donuts Inc.","2027-02-28T10:05:46Z"

Checking into the web interface, it looks like the "issue" is when the "Reason" has been provided by the registry on multiple lines.

image

I guess a multiple lines "Reason" should be displayed on the same line into the csv output.

lanrat commented 2 years ago

Thanks for the report.

Can you verify the behavior of the report download from the CZDS website? I think it does the same, but I have not tested with new lines in the reason field.

uggyuggy commented 2 years ago

Hi,

I didn't even noticed this was a report available into the CZDS website. (That's the problem of using the API instead of their website 😅 ) I was thinking the CSV was "built" on your software side.

As you guessed, the CSV provided by CZDS website is indeed wrong and have the described problem...
So unless you want to fix their CSV on your side, I think we can close this 👍

uggyuggy commented 2 years ago

Btw I went with

sed -z 's/\r\n/ /g' out.csv > out.cleaned.csv

that seems to fix it on my side.