Help us shape the future of Go! Take the 2026 Go Developer Survey

engine

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheRevocationChecks = true

Functions

This section is empty.

Types

type Engine

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

There is one engine per perspective (a perspective is a controlling entity)

func NewEngine

func NewEngine(ctx context.Context, state iapi.WaveState, st iapi.StorageInterface, perspective *iapi.EntitySecrets, perspectiveLoc iapi.LocationSchemeInstance) (*Engine, error)

func NewEngineWithNoPerspective

func NewEngineWithNoPerspective(ctx context.Context, state iapi.WaveState, st iapi.StorageInterface) (*Engine, error)

func (*Engine) CheckAttestation

func (e *Engine) CheckAttestation(ctx context.Context, d *iapi.Attestation) (*Validity, error)

Unlike checkDot, this should not touch the DB, it is a read-only operation

func (*Engine) CheckEntity

func (e *Engine) CheckEntity(ctx context.Context, ent *iapi.Entity) (*Validity, error)

func (*Engine) CheckNameDeclaration added in v0.2.0

func (e *Engine) CheckNameDeclaration(ctx context.Context, nd *iapi.NameDeclaration) (*Validity, error)

func (*Engine) InsertAttestation

func (e *Engine) InsertAttestation(ctx context.Context, att *iapi.Attestation) error

External function: insert a DOT learned out of band

func (*Engine) InsertReverseName added in v0.2.0

func (e *Engine) InsertReverseName(ctx context.Context, name string, hi iapi.HashSchemeInstance) wve.WVE

func (*Engine) IsAttestationRevoked added in v0.2.1

func (e *Engine) IsAttestationRevoked(att *iapi.Attestation) (bool, error)

func (*Engine) IsEntityRevoked added in v0.2.1

func (e *Engine) IsEntityRevoked(ent *iapi.Entity) (bool, error)

func (*Engine) IsNameDeclarationRevoked added in v0.2.1

func (e *Engine) IsNameDeclarationRevoked(nd *iapi.NameDeclaration) (bool, error)

func (*Engine) LookupAttestationInPerspective

func (e *Engine) LookupAttestationInPerspective(ctx context.Context, hash iapi.HashSchemeInstance, location iapi.LocationSchemeInstance) (*iapi.Attestation, *Validity, error)

func (*Engine) LookupAttestationNoPerspective

func (e *Engine) LookupAttestationNoPerspective(ctx context.Context, hash iapi.HashSchemeInstance, verifierKey []byte, location iapi.LocationSchemeInstance) (*iapi.Attestation, *Validity, error)

This should try find and decrypt a dot given the hash and aesk. No information from our perspective (active entity) is used

func (*Engine) LookupAttestationsFrom

func (e *Engine) LookupAttestationsFrom(ctx context.Context, entityHash iapi.HashSchemeInstance, filter *iapi.LookupFromFilter) (chan *LookupResult, chan error)

External function: get dots granted from an entity on a namespace. global grants will also be returned. The returned channel must be consumed completely, or the context must be cancelled

func (*Engine) LookupAttestationsTo

func (e *Engine) LookupAttestationsTo(ctx context.Context, entityHash iapi.HashSchemeInstance, filter *iapi.LookupFromFilter) (chan *LookupResult, chan error)

func (*Engine) LookupEntity

func (*Engine) LookupFullName added in v0.2.0

func (e *Engine) LookupFullName(ctx context.Context, attester iapi.HashSchemeInstance, name string) ([]*iapi.NameDeclaration, wve.WVE)

func (*Engine) LookupName added in v0.2.0

func (e *Engine) LookupName(ctx context.Context, attester iapi.HashSchemeInstance, name string) (*iapi.NameDeclaration, wve.WVE)

func (*Engine) LookupNameDeclaration added in v0.2.1

func (*Engine) LookupReverseName added in v0.2.0

func (e *Engine) LookupReverseName(ctx context.Context, hi iapi.HashSchemeInstance) (string, wve.WVE)

func (*Engine) MarkEntityInterestingAndQueueForSync

func (e *Engine) MarkEntityInterestingAndQueueForSync(dest *iapi.Entity, loc iapi.LocationSchemeInstance) error

This function should be quick. Processing should happen elsewhere

func (*Engine) Perspective added in v0.2.0

func (e *Engine) Perspective() *iapi.EntitySecrets

func (*Engine) PerspectiveLocation added in v0.2.0

func (e *Engine) PerspectiveLocation() iapi.LocationSchemeInstance

func (*Engine) ResetRevocationCache added in v0.2.1

func (e *Engine) ResetRevocationCache(ctx context.Context)

func (*Engine) ResyncEntireGraph

func (e *Engine) ResyncEntireGraph(ctx context.Context) error

func (*Engine) SyncStatus

func (e *Engine) SyncStatus(ctx context.Context) (*SyncStatus, error)

func (*Engine) WaitForEmptySyncQueue

func (e *Engine) WaitForEmptySyncQueue() chan struct{}

The returned channel will be closed the next time the sync queue is empty

type EngineDecryptionContext

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

func NewEngineDecryptionContext

func NewEngineDecryptionContext(e *Engine) *EngineDecryptionContext

The map is just for IBE keys decrypting the partition. The OAQUE keys must come from E

func (*EngineDecryptionContext) AttestationByHashLoc added in v0.2.1

func (*EngineDecryptionContext) AutoLoadPartitionSecrets added in v0.2.0

func (dctx *EngineDecryptionContext) AutoLoadPartitionSecrets(v bool)

func (*EngineDecryptionContext) EntityByHashLoc

func (*EngineDecryptionContext) LoadAllPartitionSecrets added in v0.2.0

func (dctx *EngineDecryptionContext) LoadAllPartitionSecrets(issuer iapi.HashSchemeInstance) wve.WVE

func (*EngineDecryptionContext) SetPartitionSecrets

func (dctx *EngineDecryptionContext) SetPartitionSecrets(m map[int]iapi.EntitySecretKeySchemeInstance)

func (*EngineDecryptionContext) SetProverKey

func (dctx *EngineDecryptionContext) SetProverKey(k []byte)

func (*EngineDecryptionContext) SetVerifierKey

func (dctx *EngineDecryptionContext) SetVerifierKey(k []byte)

func (*EngineDecryptionContext) WR1AttesterDirectDecryptionKey added in v0.2.1

func (dctx *EngineDecryptionContext) WR1AttesterDirectDecryptionKey(ctx context.Context, onResult func(k iapi.EntitySecretKeySchemeInstance) bool) error

func (*EngineDecryptionContext) WR1DirectDecryptionKey

func (dctx *EngineDecryptionContext) WR1DirectDecryptionKey(ctx context.Context, dst iapi.HashSchemeInstance, onResult func(k iapi.EntitySecretKeySchemeInstance) bool) error

func (*EngineDecryptionContext) WR1EntityFromHash added in v0.2.1

func (*EngineDecryptionContext) WR1IBEKeysForPartitionLabel

func (dctx *EngineDecryptionContext) WR1IBEKeysForPartitionLabel(ctx context.Context, dst iapi.HashSchemeInstance, onResult func(k iapi.EntitySecretKeySchemeInstance) bool) error

func (*EngineDecryptionContext) WR1OAQUEKeysForContent

func (dctx *EngineDecryptionContext) WR1OAQUEKeysForContent(ctx context.Context, dst iapi.HashSchemeInstance, delegable bool, slots [][]byte, onResult func(k iapi.SlottedSecretKey) bool) error

func (*EngineDecryptionContext) WR1ProverBodyKey

func (dctx *EngineDecryptionContext) WR1ProverBodyKey(ctx context.Context) []byte

func (*EngineDecryptionContext) WR1VerifierBodyKey

func (dctx *EngineDecryptionContext) WR1VerifierBodyKey(ctx context.Context) []byte

type Filter

type Filter struct {
	//Like namespace and permissions and stuff
	//backend might be able to index some of it
	//also validity
	Valid *bool
}

type LookupResult

type LookupResult struct {
	//The dot but also its validity
	Attestation    *iapi.Attestation
	KnownLocations []iapi.LocationSchemeInstance
	Validity       *Validity
}

type SyncStatus

type SyncStatus struct {
	WaitSyncEmpty       chan struct{}
	StorageStatus       map[string]iapi.StorageDriverStatus
	TotalSyncRequests   int64
	TotalCompletedSyncs int64
}

type Validity

type Validity struct {
	//Like if revoked / expired / entExpired etc
	//shared between entity and dot
	Valid        bool
	Revoked      bool
	Expired      bool
	NotValidYet  bool
	Malformed    bool
	NotDecrypted bool

	//Only for dots
	SrcInvalid bool
	DstInvalid bool

	Message string
}

Jump to

Keyboard shortcuts

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