...

Package attr

import "github.com/hyperledger/fabric-ca/lib/attr"
Overview
Index

Overview ▾

Constants

const (
    // BOOLEAN indicates that the attribute is of type boolean
    BOOLEAN attributeType = 1 + iota
    // LIST indicates that the attribute is of type list
    LIST
    // FIXED indicates that the attribute value is fixed and can't be modified
    FIXED
    // CUSTOM indicates that the attribute is a custom attribute
    CUSTOM
)

Attribute names

const (
    Roles          = "hf.Registrar.Roles"
    DelegateRoles  = "hf.Registrar.DelegateRoles"
    Revoker        = "hf.Revoker"
    IntermediateCA = "hf.IntermediateCA"
    GenCRL         = "hf.GenCRL"
    RegistrarAttr  = "hf.Registrar.Attributes"
    AffiliationMgr = "hf.AffiliationMgr"
    EnrollmentID   = "hf.EnrollmentID"
    Type           = "hf.Type"
    Affiliation    = "hf.Affiliation"
)

func CanRegisterAttribute

func CanRegisterAttribute(requestedAttr *api.Attribute, allRequestedAttrs []api.Attribute, user, registrar AttributeControl) error

CanRegisterAttribute will iterate through the values of registrar's 'hf.Registrar.Attributes' attribute to check if registrar can register the requested attributes

func CanRegisterRequestedAttributes

func CanRegisterRequestedAttributes(reqAttrs []api.Attribute, user, registrar AttributeControl) error

CanRegisterRequestedAttributes validates that the registrar can register the requested attributes

func ConvertAttrs

func ConvertAttrs(inAttrs map[string]string) ([]api.Attribute, error)

ConvertAttrs converts attribute string into an Attribute object array

func Exists

func Exists(attrs []api.Attribute, name string) bool

Exists searches 'attrs' for the attribute with name 'name' and returns true if found

func GetAttrValue

func GetAttrValue(attrs []api.Attribute, name string) string

GetAttrValue searches 'attrs' for the attribute with name 'name' and returns its value, or "" if not found.

type AttributeControl

AttributeControl interface gets the attributes associated with an identity

type AttributeControl interface {
    // GetAttribute returns the value for an attribute name
    GetAttribute(name string) (*api.Attribute, error)
}