code: func encodeAuthToBase64(authConfig coretypes.AuthConfig) (string, error) {
  	buf, err := json.Marshal(authConfig)
  	if err != nil {
  		return "", err
  	}
  	return base64.URLEncoding.EncodeToString(buf), nil
  }
docs: // EncodeAuthToBase64 serializes the auth configuration as JSON base64 payload
  // See https://github.com/docker/cli/blob/master/cli/command/registry.go#L41