Ejemplo n.º 1
0
func setupClient(w *test.World) (*client.Client, error) {
	// Do the silly env vars dance to avoid the "non-hermetic use of host config panic".
	if err := os.Setenv("CAMLI_KEYID", w.ClientIdentity()); err != nil {
		return nil, err
	}
	if err := os.Setenv("CAMLI_SECRET_RING", w.SecretRingFile()); err != nil {
		return nil, err
	}
	osutil.AddSecretRingFlag()
	cl := client.New(w.ServerBaseURL())
	return cl, nil
}
Ejemplo n.º 2
0
func setupClient(w *test.World) (*client.Client, error) {
	// Do the silly env vars dance to avoid the "non-hermetic use of host config panic".
	if err := os.Setenv("CAMLI_KEYID", w.ClientIdentity()); err != nil {
		return nil, err
	}
	if err := os.Setenv("CAMLI_SECRET_RING", w.SecretRingFile()); err != nil {
		return nil, err
	}
	osutil.AddSecretRingFlag()
	cl := client.New(w.ServerBaseURL())
	// This permanode is not needed in itself, but that takes care of uploading
	// behind the scenes the public key to the blob server. A bit gross, but
	// it's just for a test anyway.
	if _, err := cl.UploadNewPermanode(); err != nil {
		return nil, err
	}
	return cl, nil
}