attr

package
v0.0.0-...-0082fc6 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
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"
)

Attribute names

Variables

This section is empty.

Functions

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.

Types

type AttributeControl

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

AttributeControl interface gets the attributes associated with an identity

Jump to

Keyboard shortcuts

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