Documentation
¶
Index ¶
- func ClaimDB() *kvdb.BoltDB
- func GetClaims(c Claims, id string) error
- func GetIdentity(i Identity, id string) error
- func GetPublicKey(pk PublicKey, id string) error
- func IdentityDataBase() kvdb.KVMethods
- func SetClaims(c Claims, id string) error
- func SetIdentity(id string, i Identity) error
- func SetPublicKey(id string, pk PublicKey) error
- type ClaimContent
- type ClaimHeader
- type Claims
- type Identity
- type PublicKey
- type StandardClaim
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIdentity ¶
GetIdentity - get publickey from database
func GetPublicKey ¶
GetPublicKey - get publickey from database
func IdentityDataBase ¶
IdentityDataBase - kv database of identity
func SetIdentity ¶
SetIdentity - set publickey from database
func SetPublicKey ¶
SetPublicKey - set publickey from database
Types ¶
type ClaimContent ¶
type ClaimContent struct {
Scope map[string]interface{} `json:"scp,omitempty"`
Contents map[string]interface{} `json:"cnt,omitempty"`
}
ClaimContent - Content of Claim
func FindContent ¶
func FindContent(page uint, check func(k, v []byte) (*ClaimContent, error)) ([]*ClaimContent, error)
FindContent - find some claim content
func NewContent ¶
func NewContent(scope, content map[string]interface{}) (*ClaimContent, string, error)
NewContent - Create a claim content
func (*ClaimContent) Get ¶
func (c *ClaimContent) Get(id string) error
Get - get content from database
func (*ClaimContent) Marshal ¶
func (c *ClaimContent) Marshal() ([]byte, error)
Marshal - convert json content to string ([]byte)
func (*ClaimContent) Unmarshal ¶
func (c *ClaimContent) Unmarshal(data []byte) error
Unmarshal - convert json string ([]byte) to content
type ClaimHeader ¶
type ClaimHeader struct {
Type string `json:"typ"`
Subject string `json:"sub"`
Issuer string `json:"iss"`
Arguments string `json:"arg,omitempty"`
Algorithm string `json:"alg,omitempty"`
}
ClaimHeader - header of claim. content of header identify the one claim to the others so ID of claim is symbol of this content
func FindHeader ¶
func FindHeader(page uint, check func(k, v []byte) (*ClaimHeader, error)) ([]*ClaimHeader, error)
FindHeader - find some claim header
func NewHeader ¶
func NewHeader(t, subject, issuer string) (*ClaimHeader, string, error)
NewHeader - Create a claim header
func (*ClaimHeader) Get ¶
func (hd *ClaimHeader) Get(id string) error
Get - get claimheader from database
func (*ClaimHeader) Marshal ¶
func (hd *ClaimHeader) Marshal() ([]byte, error)
Marshal - convert json claimheader to string ([]byte)
func (*ClaimHeader) Unmarshal ¶
func (hd *ClaimHeader) Unmarshal(data []byte) error
Unmarshal - convert json string ([]byte) to claimheader
type Claims ¶
type Claims interface {
Value
ID() string
Get(id string) error
Set() error
Hdr() (*ClaimHeader, error)
Cont() (*ClaimContent, error)
}
Claims - For a type to be a Claims object
type Identity ¶
type Identity interface {
Value
}
Identity - interface for any identity and document convert to/from value
type PublicKey ¶
type PublicKey interface {
Value
}
PublicKey - interface for any publickey convert to/from value
type StandardClaim ¶
type StandardClaim struct {
Header *ClaimHeader `json:"header"`
Content *ClaimContent `json:"content"`
Claim Claims `json:"status"`
}
StandardClaim - Basic elements for claim
func (*StandardClaim) Get ¶
func (s *StandardClaim) Get(c Claims, id string) error
Get - get status from database
func (*StandardClaim) Marshal ¶
func (s *StandardClaim) Marshal() ([]byte, error)
Marshal - convert json status to string ([]byte)
func (*StandardClaim) Unmarshal ¶
func (s *StandardClaim) Unmarshal(data []byte) error
Unmarshal - convert json string ([]byte) to status