NeuraLegion / sec-tester-cr

Bright Security scanner integration for Crystal specs
MIT License
15 stars 1 forks source link

Unexpected char 'F' when the API token is invalid #7

Closed jwoertink closed 2 years ago

jwoertink commented 2 years ago

Related: #6

I set a fake token

LuckySecTester.configure do |settings|
  settings.nexploit_token = "test123"
end

and got this error:

Error creating repeater: Unexpected char 'F' at line 1, column 1 response: Failed to log in with provided credentials. (SecTester::Error)
         from lib/sec_tester/src/scan.cr:226:7 in 'create_repeater'
         from lib/sec_tester/src/scan.cr:15:19 in 'initialize'
         from lib/sec_tester/src/scan.cr:14:5 in 'new:token'
         from lib/sec_tester/src/test.cr:16:15 in 'initialize'
         from lib/sec_tester/src/test.cr:15:5 in 'new'

I'm assuming the char F is probably from decoding some JSON or something. Thankfully it tells me "Failed to log in", so I knew exactly what the issue was. Not really a huge issue/priority here, but just wanted to report as a potential cleanup in the future or whatever.

bararchy commented 2 years ago

Fixed via: https://github.com/NeuraLegion/sec_tester/runs/5720391342?check_suite_focus=true#step:6:13 I'll just update the API key and re-run to see specs pass and I'll cut a new version

bararchy commented 2 years ago

Fixed at: https://github.com/NeuraLegion/sec_tester/releases/tag/v1.2.3