Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SelectCredentials ¶
func SelectCredentials(vcJWTs []string, pd PresentationDefinition) ([]string, error)
SelectCredentials selects vcJWTs based on the constraints defined in the presentation definition
Types ¶
type Constraints ¶
type Constraints struct {
Fields []Field `json:"fields,omitempty"`
}
Constraints contains the requirements for a given Input Descriptor.
type Field ¶
type Field struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Path []string `json:"path,omitempty"` Purpose string `json:"purpose,omitempty"` Filter *Filter `json:"filter,omitempty"` Optional bool `json:"optional,omitempty"` Predicate *Optionality `json:"predicate,omitempty"` }
Field contains the requirements for a given field within a proof
type Filter ¶
type Filter struct { Type string `json:"type,omitempty"` Pattern string `json:"pattern,omitempty"` Const string `json:"const,omitempty"` Contains *Filter `json:"contains,omitempty"` }
Filter is a JSON Schema that is applied against the value of a field.
type InputDescriptor ¶
type InputDescriptor struct { ID string `json:"id"` Name string `json:"name,omitempty"` Purpose string `json:"purpose,omitempty"` Constraints Constraints `json:"constraints"` }
InputDescriptor represents a DIF Input Descriptor defined here. Input Descriptors are used to describe the information a Verifier requires of a Holder.
func (InputDescriptor) SelectCredentials ¶
func (ind InputDescriptor) SelectCredentials(vcJWTs []string) ([]string, error)
SelectCredentials selects vcJWTs based on the constraints defined in the input descriptor
type JSONSchema ¶
type JSONSchema struct { Schema string `json:"$schema"` Type string `json:"type"` Properties map[string]Filter `json:"properties"` Required []string `json:"required"` }
JSONSchema represents a minimal JSON Schema
func (*JSONSchema) AddProperty ¶
func (j *JSONSchema) AddProperty(name string, value Filter, required bool)
AddProperty adds the provided Filter with the provided name to the JsonSchema
type Optionality ¶
type Optionality string
Optionality is a type alias for the possible values of the predicate field
const ( Required Optionality = "required" Preferred Optionality = "preferred" )
Constants for Optionality values
type PresentationDefinition ¶
type PresentationDefinition struct { ID string `json:"id"` Name string `json:"name,omitempty"` Purpose string `json:"purpose,omitempty"` InputDescriptors []InputDescriptor `json:"input_descriptors"` }
PresentationDefinition represents a DIF Presentation Definition defined here. Presentation Definitions are objects that articulate what proofs a Verifier requires