identity

package
v0.0.0-...-49972a8 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParticipantDocType = "did.participant"
	RoleDocType        = "did.role"
	AccessDocType      = "did.access"
	IssuerDocType      = "did.issuer"
)

docType

View Source
const (
	// index
	Deleted = "deleted"

	// objectType
	ObjectTypeParticipantDeleted = ParticipantDocType + "~" + Deleted + "~did" // use to index deleted participant
	ObjectTypeIssuerByDefault    = IssuerDocType + ":default~uuid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AutogenerateDid bool `json:"autogenerateDid,omitempty" metadata:",optional"` // did is sent by the dapp, it is not generated by the chaincode
}

Config TODO: in a later version this configuration should be able to be managed in a decentralized way

type ContractIdentity

type ContractIdentity struct {
	contractapi.Contract
}

ContractIdentity chaincode that defines the business logic for managing identity

func (*ContractIdentity) CreateAccess

CreateAccess

Arguments:

0: AccessCreateRequest -

Returns:

0: AccessResponse
1: error

func (*ContractIdentity) CreateIssuer

CreateIssuer create in the ledger the issuer's certificate with its attributes

Arguments:

0: IssuerCreateRequest

Returns:

0: Issuer
1: error

func (*ContractIdentity) CreateParticipant

CreateParticipant

func (*ContractIdentity) CreateRole

TODO: remove model-traceability-go dependence CreateRole

func (*ContractIdentity) DeleteIssuer

func (ci *ContractIdentity) DeleteIssuer(ctx contractapi.TransactionContextInterface, issuerRequest model.GetRequest) error

DeleteIssuer delete an issuer from the ledger

Arguments:

0: GetRequest

Returns:

0: Issuer
1: error

func (*ContractIdentity) DeleteParticipant

DeleteParticipant TODO: debug

func (*ContractIdentity) DeleteRole

DeleteRole

func (*ContractIdentity) GetAccess

GetAccess get an access

Arguments:

0: GetRequest

Returns:

0: AccessResponse
1: error

func (*ContractIdentity) GetAccesses

GetAccesses get all access

Arguments:

0: request model.RichQuerySelector

Returns:

0: *model.PaginatedQueryResponse
1: error

func (*ContractIdentity) GetIgnoredFunctions

func (ci *ContractIdentity) GetIgnoredFunctions() []string

GetIgnoredFunctions returns functions are still callable by the code just not directly by outside users

func (*ContractIdentity) GetIssuer

GetIssuer get an issuer from the ledger

Arguments:

0: GetRequest

Returns:

0: Issuer
1: error

func (*ContractIdentity) GetIssuerHistory

GetIssuerHistory returns the chain of custody for a issuer since issuance

Arguments:

0: model.GetRequest

Returns:

0: []model.IssuerHistoryQueryResponse
1: error

func (*ContractIdentity) GetIssuers

GetIssuers get all issuer

Arguments:

0: none

Returns:

0: []Issuer
1: error

func (*ContractIdentity) GetParticipant

func (*ContractIdentity) GetParticipantHistory

GetParticipantHistory returns the chain of custody for an identity since issuance

Arguments:

0: model_api.ParticipantGetRequest

Returns:

0: []model_api.ParticipantHistoryQueryResponse
1: error

func (*ContractIdentity) GetParticipantRoles

func (*ContractIdentity) GetParticipants

GetParticipants get all identity

Arguments:

0: request model.RichQuerySelector

Returns:

0: *model.PaginatedQueryResponse
1: error

func (*ContractIdentity) GetRole

GetRole

func (*ContractIdentity) GetRoles

GetRoles get all role

func (*ContractIdentity) InitLedger

InitLedger adds a base set of data to the ledger

func (*ContractIdentity) OnlyDevAccess

OnlyDevAccess TODO: only for test

func (*ContractIdentity) OnlyDevIssuer

OnlyDevIssuer [temporary] function to populate with test data

func (*ContractIdentity) OnlyDevParticipant

func (ci *ContractIdentity) OnlyDevParticipant(ctx contractapi.TransactionContextInterface) (string, error)

OnlyDevParticipant [temporary] function to populate with test data

func (*ContractIdentity) ParticipantExits

ParticipantExits returns true when identity with given key exists in the worldState.

func (*ContractIdentity) QueryAssetsBy

func (ci *ContractIdentity) QueryAssetsBy(ctx contractapi.TransactionContextInterface, query map[string]interface{}) ([]interface{}, error)

QueryAssetsBy uses a query string to perform a query for any identity contract asset Query string matching state database syntax is passed in and executed as is. Supports ad hoc queries that can be defined at runtime by the client. Param Ex: {"selector":{"docType":"did.participant","id":"myID"}}

Arguments:

0: queryStruct map[string]interface{}

Returns:

0: []string

func (*ContractIdentity) QueryAssetsWithPagination

QueryAssetsWithPagination uses a query string, page size and a bookmark to perform a query for assets. Query string matching state database syntax is passed in and executed as is. The number of fetched records would be equal to or lesser than the specified page size. Supports ad hoc queries that can be defined at runtime by the client. If this is not desired, follow the QueryAssetsForOwner example for parameterized queries. Only available on state databases that support rich query (e.g. CouchDB) Paginated queries are only valid for read only transactions. Example: Pagination with Ad hoc Rich Query

func (*ContractIdentity) RenewIssuer

RenewIssuer update issuer certificate in the ledger

Arguments:

0: IssuerUpdateRequest

Returns:

0: Issuer
1: error

func (*ContractIdentity) UpdateParticipant

func (*ContractIdentity) UpdateRole

UpdateRole

type IssuerUpdateRequest

type IssuerUpdateRequest struct {
	ID      string `json:"id"`
	CertPem string `json:"certPem"` // b64 certificate PEM active
}

IssuerUpdateRequest

Jump to

Keyboard shortcuts

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