private function authHeaders($registryAuth)
    {
        $headers = array();
        if ($registryAuth !== null) {
            $headers['X-Registry-Auth'] = base64_encode($this->json($registryAuth));
        }

        return $headers;
    }
private function authHeaders($registryAuth)
    {
        $headers = array();
        if ($registryAuth !== null) {
            $headers['X-Registry-Auth'] = base64_encode($this->json($registryAuth));
        }

        return $headers;
    }
private function authHeaders ( $ registryAuth ) { $ headers = array ( ) ; if ( $ registryAuth !== null ) { $ headers [ 'X-Registry-Auth' ] = base64_encode ( $ this -> json ( $ registryAuth ) ) ; } return $ headers ; }
Helper function to send an AuthConfig object via the X-Registry-Auth header

If your API call returns a "500 Internal Server Error" response with the
message "EOF", it probably means that the endpoint requires authorization
and you did not supply this header.

Description from Docker's docs (see links):

AuthConfig, set as the X-Registry-Auth header, is currently a Base64
encoded (JSON) string with the following structure:
```
{"username": "string", "password": "string", "email": "string", "serveraddress" : "string", "auth": ""}
```

Notice that auth is to be left empty, serveraddress is a domain/ip without
protocol, and that double quotes (instead of single ones) are required.

@param array $registryAuth
@return array
@link https://docs.docker.com/reference/api/docker_remote_api/ for details about the AuthConfig object
@link https://github.com/docker/docker/issues/9315 for error description
Helper function to send an AuthConfig object via the X - Registry - Auth header