NERSC / shifter

Shifter - Linux Containers for HPC
Other
348 stars 65 forks source link

Fix dockerv2 token authorization with multiple permissions #237

Closed uvNikita closed 5 years ago

uvNikita commented 5 years ago

If WWW-Authenticate header of manifest endpoint contains multiple scope permissions (e.g. pull and push), they are specified separated by a comma, see https://docs.docker.com/registry/spec/auth/token/#how-to-authenticate. Such API response causes need more than 1 value to unpack error due to the current string split implementation, therefore auth_data_str split logic should be more strict.

Fixes https://github.com/NERSC/shifter/issues/236.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 64.627% when pulling 591ac921e6cbd644540a81d33388945c7f3e361e on uvNikita:shiftergw/fix-dockerv2 into 032275bbd567cd9a140ec1b50262d78ff2648c85 on NERSC:master.