optiopay / klar

Integration of Clair and Docker Registry
MIT License
506 stars 138 forks source link

Header Authorization for request to clair: No token is set #12

Closed savujevi closed 7 years ago

savujevi commented 7 years ago

Hello developers,

if i use klaras desrcibed:

CLAIR_ADDR=http://localhost CLAIR_THRESHOLD=10 DOCKER_USER=me DOCKER_PASSWORD=secret klar postgres:9.5.1

with user and password these parameters are sue to get the dockerImages. But if each layer is analyzed by clair it usese the token which is never initialized.

I have set the token in the docker.go by

if i.Token == "" { req.SetBasicAuth(i.user, i.password) i.Token = req.Header.Get("Authorization") }

Did i use the klar wrong or is there an other way to call klar ?

Thank you for your help.

Greatings Sascha

hashmap commented 7 years ago

Hello Sascha, thanks for the report. What error did you get exactly?

hashmap commented 7 years ago

@savujevi thanks for your fix, I submitted it as a PR and merged it

savujevi commented 7 years ago

Thank you for the fix.