marcuslindblom / security-headers

Analyse your HTTP response headers
MIT License
7 stars 3 forks source link

add support to pass api key #8

Open basantPayU opened 1 year ago

basantPayU commented 1 year ago

According to docs of security headers, we need to pass an API key for the request, but the current implementation doesn't provide a way to do so. P.S. Refer to the image

Screenshot 2023-04-21 at 4 31 35 PM
iamazeem commented 1 year ago

@basantPayU: Did you check https://github.com/koenbuyens/securityheaders?

And, did you try invoking curl from the command line?

Example:

curl -H "x-api-key: <API-KEY>" "https://api.securityheaders.com/?q=<URL>&hide=on&followRedirects=on" | jq -r '.summary.grade'
marcuslindblom commented 1 year ago

The above seems to work just fine. So this issue is up for grabs :)

marcuslindblom commented 1 year ago

I made a PR draft. This is breaking though because the order of params is changed. What do you think @iamazeem @basantPayU

basantPayU commented 1 year ago

@marcuslindblom Looks good to me!

iamazeem commented 1 year ago

Looks good! :+1:

BTW, I just released this composite action: https://github.com/iamazeem/security-headers-action

As of now, docker actions run only on the Linux runners. I wanted to create something that works on all the GHA runners.

Would love to hear some feedback from you both. :smile: Thank you!