code: func (r *remoteAuthChallenger) tryEstablishChallenges(ctx context.Context) error {
  	r.Lock()
  	defer r.Unlock()
  
  	remoteURL := r.remoteURL
  	remoteURL.Path = "/v2/"
  	challenges, err := r.cm.GetChallenges(remoteURL)
  	if err != nil {
  		return err
  	}
  
  	if len(challenges) > 0 {
  		return nil
  	}
  
  	// establish challenge type with upstream
  	if err := ping(r.cm, remoteURL.String(), challengeHeader); err != nil {
  		return err
  	}
  
  	dcontext.GetLogger(ctx).Infof("Challenge established with upstream : %s %s", remoteURL, r.cm)
  	return nil
  }
docs: // tryEstablishChallenges will attempt to get a challenge type for the upstream if none currently exist