identity

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ClaimRecordKeyPrefix for store prefixes
	ClaimRecordKeyPrefix   = []byte{0x00} // prefix for each key to a candidate
	ClaimsAccountKeyPrefix = []byte{0x01}
	ClaimsOwnerKeyPrefix   = []byte{0x02}
)

Functions

func GetClaimRecordKey

func GetClaimRecordKey(uuid string) []byte

GetClaimRecordKey ...

func GetClaimsAccountKey

func GetClaimsAccountKey(addr []byte) []byte

GetClaimRecordKey ...

func GetClaimsOwnerKey

func GetClaimsOwnerKey(addr []byte) []byte

GetClaimRecordKey ...

func NewHandler

func NewHandler(k Keeper) sdk.Handler

NewHandler ...

func RegisterWire added in v0.0.2

func RegisterWire(cdc *wire.Codec)

Register concrete types on wire codec

Types

type Claim

type Claim struct {
	ID       string        `json:"id"`
	Context  string        `json:"context"`
	Content  Content       `json:"content"`
	Metadata ClaimMetadata `json:"metadata"`
}

Claim struct

func (Claim) IsOwner

func (c Claim) IsOwner(addr sdk.Address) bool

type ClaimMetadata

type ClaimMetadata struct {
	CreateTime time.Time   `json:"create_time"`
	Issuer     sdk.Address `json:"issuer"`
	Recipient  sdk.Address `json:"recipient"`
	Expires    time.Time   `json:"expires"`
	Revocation string      `json:"revocation"`
}

ClaimMetadata the claim metadata

type Content

type Content []byte

type Keeper

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

Keeper manages identity claims

func NewKeeper

func NewKeeper(key sdk.StoreKey, cdc *wire.Codec) Keeper

NewKeeper - Returns the Keeper

func (Keeper) CreateClaim added in v0.1.0

func (k Keeper) CreateClaim(ctx sdk.Context, msg MsgCreateClaim) (sdk.Tags, sdk.Error)

ClaimIssue ...

func (Keeper) GetClaim

func (k Keeper) GetClaim(ctx sdk.Context, claimID string) (*Claim, sdk.Error)

GetClaim ...

func (Keeper) RevokeClaim added in v0.1.0

func (k Keeper) RevokeClaim(ctx sdk.Context, msg MsgRevokeClaim) (sdk.Tags, sdk.Error)

Revoke ...

type MsgCreateClaim added in v0.1.0

type MsgCreateClaim struct {
	ID       string        `json:"id"`
	Context  string        `json:"context"`
	Content  Content       `json:"content"`
	Metadata ClaimMetadata `json:"metadata"`
}

MsgCreateClaim ...

func (MsgCreateClaim) Get added in v0.1.0

func (msg MsgCreateClaim) Get(key interface{}) (value interface{})

func (MsgCreateClaim) GetSignBytes added in v0.1.0

func (msg MsgCreateClaim) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgCreateClaim) GetSigners added in v0.1.0

func (msg MsgCreateClaim) GetSigners() []sdk.Address

func (MsgCreateClaim) String added in v0.1.0

func (msg MsgCreateClaim) String() string

func (MsgCreateClaim) Type added in v0.1.0

func (msg MsgCreateClaim) Type() string

nolint ...

func (MsgCreateClaim) ValidateBasic added in v0.1.0

func (msg MsgCreateClaim) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgRevokeClaim added in v0.1.0

type MsgRevokeClaim struct {
	ClaimID    string      `json:"claim_id"`
	Owner      sdk.Address `json:"owner"`
	Revocation string      `json:"revocation"`
}

RevokeMsg ...

func (MsgRevokeClaim) Get added in v0.1.0

func (msg MsgRevokeClaim) Get(key interface{}) (value interface{})

func (MsgRevokeClaim) GetSignBytes added in v0.1.0

func (msg MsgRevokeClaim) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgRevokeClaim) GetSigners added in v0.1.0

func (msg MsgRevokeClaim) GetSigners() []sdk.Address

func (MsgRevokeClaim) String added in v0.1.0

func (msg MsgRevokeClaim) String() string

func (MsgRevokeClaim) Type added in v0.1.0

func (msg MsgRevokeClaim) Type() string

nolint ...

func (MsgRevokeClaim) ValidateBasic added in v0.1.0

func (msg MsgRevokeClaim) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

Directories

Path Synopsis
client

Jump to

Keyboard shortcuts

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