v.io: v.io/v23/internal/sectest Index | Files

package sectest

import "v.io/v23/internal/sectest"

Package sectest contains support for security related tests

Index

Package Files

security.go

Variables

var SuffixCaveat = security.CaveatDescriptor{
    Id:        uniqueid.Id{0xce, 0xc4, 0xd0, 0x98, 0x94, 0x53, 0x90, 0xdb, 0x15, 0x7c, 0xa8, 0x10, 0xae, 0x62, 0x80, 0x0},
    ParamType: vdl.TypeOf(string("")),
}

SuffixCaveat is a Caveat that validates iff Call.Suffix matches the string.

Since at the time of this writing, it was not clear that we want to make caveats on suffixes generally available, this type is implemented in this test file. If there is a general need for such a caveat, it should be defined similar to other caveats (like methodCaveat) in caveat.vdl and removed from this test file.

func AddToRoots Uses

func AddToRoots(t *testing.T, p security.Principal, b security.Blessings)

AddToRoots calls security.AddAddToRoots.

func BlessSelf Uses

func BlessSelf(t *testing.T, p security.Principal, name string, caveats ...security.Caveat) security.Blessings

BlessSelf returns a named blessing for the supplied principal.

func NewECDSAPrincipalP256 Uses

func NewECDSAPrincipalP256(t testing.TB) security.Principal

NewECDSAPrincipalP256 returns a new ECDSA based principal using &Roots{} and the P256 curve.

func NewECDSAPrincipalP256TrustAllRoots Uses

func NewECDSAPrincipalP256TrustAllRoots(t testing.TB) security.Principal

NewECDSAPrincipalP256TrustAllRoots returns a new ECDSA based principal using &TrustAllRoots{} and the P256 curve.

func NewECDSASigner Uses

func NewECDSASigner(t testing.TB, curve elliptic.Curve) security.Signer

NewECDSASigner creates a new ECDSA based signer.

func NewECDSASignerP256 Uses

func NewECDSASignerP256(t testing.TB) security.Signer

NewECDSASignerP256 creates a new ECDSA based signer using the P256 curve.

func NewED25519Principal Uses

func NewED25519Principal(t testing.TB) security.Principal

NewED25519Principal returns a new ED25519 based principal using &Roots{}.

func NewED25519PrincipalTrustAllRoots Uses

func NewED25519PrincipalTrustAllRoots(t testing.TB) security.Principal

NewED25519PrincipalTrustAllRoots returns a new ED25519 based principal using &TrustAllRoots{}.

func NewED25519Signer Uses

func NewED25519Signer(t testing.TB) security.Signer

NewED25519Signer creates a new ED25519 signer.

func NewExpiryCaveat Uses

func NewExpiryCaveat(t testing.TB, until time.Time) security.Caveat

NewExpiryCaveat is like security.NewNewExpiryCaveat except that it fails on error.

func NewMethodCaveat Uses

func NewMethodCaveat(t testing.TB, method string, additionalMethods ...string) security.Caveat

NewMethodCaveat is like security.NewNewMethodCaveat except that it fails on error.

func NewPrincipal Uses

func NewPrincipal(t testing.TB, signer security.Signer, store security.BlessingStore, roots security.BlessingRoots) security.Principal

NewPrincipal creates a new security.Principal using the supplied signer, blessings store and roots.

func NewPublicKeyUnconstrainedCaveat Uses

func NewPublicKeyUnconstrainedCaveat(t testing.TB, p security.Principal, name string) security.Caveat

NewPublicKeyUnconstrainedCaveat creates a named, unconstrained caveat using the supplied principal and with no third party caveats.

func NewSuffixCaveat Uses

func NewSuffixCaveat(t *testing.T, suffix string) security.Caveat

NewSuffixCaveat returns a caveat for SuffixCaveat.

func RoundTrip Uses

func RoundTrip(in, out interface{}) error

RoundTrip simulates a network round trip by encoding/decoding from to/from vom.

type Roots Uses

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

Roots is an implementation of security.BlessingRoots that trusts the roots that have been added to it.

func (*Roots) Add Uses

func (r *Roots) Add(root []byte, pattern security.BlessingPattern) error

func (*Roots) DebugString Uses

func (*Roots) DebugString() string

func (*Roots) Dump Uses

func (r *Roots) Dump() map[security.BlessingPattern][]security.PublicKey

func (*Roots) Recognized Uses

func (r *Roots) Recognized(root []byte, blessing string) error

type TrustAllRoots Uses

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

TrustAllRoots is an implementation of security.BlessingRoots that trusts all roots, regardless of whether they have been added to it.

func (*TrustAllRoots) Add Uses

func (r *TrustAllRoots) Add(root []byte, pattern security.BlessingPattern) error

func (*TrustAllRoots) DebugString Uses

func (r *TrustAllRoots) DebugString() string

func (*TrustAllRoots) Dump Uses

func (r *TrustAllRoots) Dump() map[security.BlessingPattern][]security.PublicKey

func (*TrustAllRoots) Recognized Uses

func (r *TrustAllRoots) Recognized(root []byte, blessing string) error

Package sectest imports 13 packages (graph). Updated 2020-10-29. Refresh now. Tools for package owners.