network

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPublicParamsFetcher added in v0.2.0

func NewPublicParamsFetcher(sp view.ServiceProvider, network string, channel string, namespace string) *publicParamsFetcher

Types

type Authorization

type Authorization interface {
	// IsMine returns true if the passed token is owned by an owner wallet in the passed TMS
	IsMine(tms *token.ManagementService, tok *token2.Token) ([]string, bool)
	// AmIAnAuditor return true if the passed TMS contains an auditor wallet for any of the auditor identities
	// defined in the public parameters of the passed TMS.
	AmIAnAuditor(tms *token.ManagementService) bool
}

Authorization is an interface that defines method to check the relation between a token or TMS and wallets (owner, auditor, etc.)

type AuthorizationMultiplexer

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

AuthorizationMultiplexer iterates over multiple authorization checker

func NewAuthorizationMultiplexer

func NewAuthorizationMultiplexer(ownerships ...Authorization) *AuthorizationMultiplexer

NewAuthorizationMultiplexer returns a new AuthorizationMultiplexer for the passed ownership checkers

func (*AuthorizationMultiplexer) AmIAnAuditor

func (o *AuthorizationMultiplexer) AmIAnAuditor(tms *token.ManagementService) bool

AmIAnAuditor returns true it there exists an authorization checker that returns true

func (*AuthorizationMultiplexer) IsMine

IsMine returns true it there exists an authorization checker that returns true

type CertificationClientProvider

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

func NewCertificationClientProvider

func NewCertificationClientProvider(sp view.ServiceProvider) *CertificationClientProvider

func (*CertificationClientProvider) New

func (c *CertificationClientProvider) New(network string, channel string, namespace string, driver string) (driver.CertificationClient, error)

type FabricVault

type FabricVault struct {
	*fabric.Vault
}

func (*FabricVault) Status

func (v *FabricVault) Status(id string) (int, error)

type Issued

type Issued interface {
	// Issued returns true if the passed issuer issued the passed token
	Issued(tms *token.ManagementService, issuer view.Identity, tok *token2.Token) bool
}

type IssuedMultiplexer

type IssuedMultiplexer struct {
	Checkers []Issued
}

IssuedMultiplexer iterates over multiple Issued checker

func NewIssuedMultiplexer

func NewIssuedMultiplexer(checkers ...Issued) *IssuedMultiplexer

NewIssuedMultiplexer returns a new IssuedMultiplexer for the passed Issued checkers

func (*IssuedMultiplexer) Issued

func (o *IssuedMultiplexer) Issued(tms *token.ManagementService, issuer view.Identity, tok *token2.Token) bool

Issued returns true if the passed issuer issued the passed token

type LockerProvider

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

func NewLockerProvider

func NewLockerProvider(sp view.ServiceProvider, sleepTimeout time.Duration, validTxEvictionTimeout time.Duration) *LockerProvider

func (*LockerProvider) New

func (s *LockerProvider) New(network string, channel string, namespace string) selector.Locker

type Normalizer

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

Normalizer is a normalizer for token service options Namely, if no network is specified, it will try to find a default network. And so on.

func NewNormalizer

func NewNormalizer(cp TokenSDKConfig, sp view.ServiceProvider) *Normalizer

NewNormalizer creates a new Normalizer

func (*Normalizer) Normalize

func (n *Normalizer) Normalize(opt *token.ServiceOptions) (*token.ServiceOptions, error)

Normalize normalizes the passed options. If no network is specified, it will try to find a default network. And so on.

type OrionVault

type OrionVault struct {
	*orion.Vault
}

func (*OrionVault) Status

func (v *OrionVault) Status(id string) (int, error)

type TMSAuthorization

type TMSAuthorization struct{}

TMSAuthorization is an owner wallet-based ownership checker

func (*TMSAuthorization) AmIAnAuditor

func (w *TMSAuthorization) AmIAnAuditor(tms *token.ManagementService) bool

AmIAnAuditor return true if the passed TMS contains an auditor wallet for any of the auditor identities defined in the public parameters of the passed TMS.

func (*TMSAuthorization) IsMine

func (w *TMSAuthorization) IsMine(tms *token.ManagementService, tok *token2.Token) ([]string, bool)

IsMine returns true if the passed token is owned by an owner wallet in the passed TMS

type TokenSDKConfig

type TokenSDKConfig interface {
	// LookupNamespace searches for a TMS configuration that matches the given network and channel, and
	// return its namespace.
	// If no matching configuration is found, an error is returned.
	// If multiple matching configurations are found, an error is returned.
	LookupNamespace(network, channel string) (string, error)
}

TokenSDKConfig is the configuration for the token SDK

type WalletIssued

type WalletIssued struct{}

WalletIssued is an owner wallet-based Issued checker

func (*WalletIssued) Issued

func (w *WalletIssued) Issued(tms *token.ManagementService, issuer view.Identity, tok *token2.Token) bool

Issued returns true if the passed issuer issued the passed token

Jump to

Keyboard shortcuts

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