code: func ResolveAuthConfig(ctx context.Context, cli Cli, index *registrytypes.IndexInfo) types.AuthConfig {
  	configKey := index.Name
  	if index.Official {
  		configKey = ElectAuthServer(ctx, cli)
  	}
  
  	a, _ := cli.ConfigFile().GetAuthConfig(configKey)
  	return types.AuthConfig(a)
  }
docs: // ResolveAuthConfig is like registry.ResolveAuthConfig, but if using the
  // default index, it uses the default index name for the daemon's platform,
  // not the client's platform.