testidentity

package
v0.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// IdentityVersions holds pregenerated identities for each/ identity version.
	IdentityVersions = VersionedIdentitiesMap{
		storj.V0: pregeneratedV0Identities,
	}

	// SignedIdentityVersions holds pregenerated, signed identities for each.
	// identity version
	SignedIdentityVersions = VersionedIdentitiesMap{
		storj.V0: pregeneratedV0SignedIdentities,
	}

	// SignerVersions holds certificate authorities for each identity version.
	SignerVersions = VersionedCertificateAuthorityMap{
		storj.V0: pregeneratedV0Signer,
	}
)

Functions

func CompleteIdentityVersionsTest added in v0.9.0

func CompleteIdentityVersionsTest(t *testing.T, test IdentityTest)

CompleteIdentityVersionsTest runs the `IdentityTest` for each identity version, with both signed dn unsigned identities.

func IdentityVersionsTest added in v0.9.0

func IdentityVersionsTest(t *testing.T, test IdentityTest)

IdentityVersionsTest runs the `IdentityTest` for each identity version, with an unsigned identity.

func MustPregeneratedIdentity added in v0.9.0

func MustPregeneratedIdentity(index int, version storj.IDVersion) *identity.FullIdentity

MustPregeneratedIdentity returns a pregenerated identity or panics

func MustPregeneratedSignedIdentity added in v0.9.0

func MustPregeneratedSignedIdentity(index int, version storj.IDVersion) *identity.FullIdentity

MustPregeneratedSignedIdentity returns a pregenerated identity or panics

func NewPregeneratedSigner added in v0.9.0

func NewPregeneratedSigner(version storj.IDVersion) *identity.FullCertificateAuthority

NewPregeneratedSigner returns the signer for all pregenerated, signed identities

func NewTestCA

NewTestCA returns a ca with a default difficulty and concurrency for use in tests

func NewTestIdentity

func NewTestIdentity(ctx context.Context) (*identity.FullIdentity, error)

NewTestIdentity is a helper function to generate new node identities with correct difficulty and concurrency

func NewTestManageableFullIdentity

func NewTestManageableFullIdentity(ctx context.Context) (*identity.ManageableFullIdentity, error)

NewTestManageableFullIdentity returns a new manageable full identity for use in tests.

func NewTestManageablePeerIdentity

func NewTestManageablePeerIdentity(ctx context.Context) (*identity.ManageablePeerIdentity, error)

NewTestManageablePeerIdentity returns a new manageable peer identity for use in tests.

func PregeneratedIdentity added in v0.9.0

func PregeneratedIdentity(index int, version storj.IDVersion) (*identity.FullIdentity, error)

PregeneratedIdentity returns a pregenerated identity from a list

func PregeneratedSignedIdentity added in v0.9.0

func PregeneratedSignedIdentity(index int, version storj.IDVersion) (*identity.FullIdentity, error)

PregeneratedSignedIdentity returns a signed pregenerated identity from a list

func RevocationDBsTest

func RevocationDBsTest(t *testing.T, test func(*testing.T, extensions.RevocationDB, storage.KeyValueStore))

RevocationDBsTest runs the passed test function with each type of revocation database.

func SignedIdentityVersionsTest added in v0.9.0

func SignedIdentityVersionsTest(t *testing.T, test IdentityTest)

SignedIdentityVersionsTest runs the `IdentityTest` for each identity version, with an signed identity.

func SignerVersionsTest added in v0.9.0

func SignerVersionsTest(t *testing.T, test SignerTest)

SignerVersionsTest runs the `SignerTest` for each identity version, with the respective signer used to sign pregenerated, signed identities.

Types

type Identities added in v0.9.0

type Identities struct {
	// contains filtered or unexported fields
}

Identities is a pregenerated full identity table.

func NewIdentities added in v0.9.0

func NewIdentities(list ...*identity.FullIdentity) *Identities

NewIdentities creates a new table from provided identities.

func NewPregeneratedIdentities added in v0.9.0

func NewPregeneratedIdentities(version storj.IDVersion) *Identities

NewPregeneratedIdentities retruns a new table from provided identities.

func NewPregeneratedSignedIdentities added in v0.9.0

func NewPregeneratedSignedIdentities(version storj.IDVersion) *Identities

NewPregeneratedSignedIdentities retruns a new table from provided signed identities.

func (*Identities) Clone added in v0.9.0

func (identities *Identities) Clone() *Identities

Clone creates a shallow clone of the table.

func (*Identities) NewIdentity added in v0.9.0

func (identities *Identities) NewIdentity() (*identity.FullIdentity, error)

NewIdentity gets a new identity from the list.

type IdentityTest added in v0.9.0

type IdentityTest func(*testing.T, storj.IDVersion, *identity.FullIdentity)

IdentityTest is a function that takes a testing struct, an identity version and a full identity.

type SignerTest added in v0.9.0

SignerTest is a function that takes a testing struct, an identity version and a full certificate authority.

type VersionedCertificateAuthorityMap added in v0.9.0

type VersionedCertificateAuthorityMap map[storj.IDVersionNumber]*identity.FullCertificateAuthority

VersionedCertificateAuthorityMap maps a `storj.IDVersionNumber` to a set of pregenerated certificate authorities used for signing the corresponding version of signed identities.

type VersionedIdentitiesMap added in v0.9.0

type VersionedIdentitiesMap map[storj.IDVersionNumber]*Identities

VersionedIdentitiesMap maps a `storj.IDVersionNumber` to a set of pregenerated identities with the corresponding version.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL