pexv2

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectCredentials added in v0.17.0

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 added in v0.17.0

func (ind InputDescriptor) SelectCredentials(vcJWTs []string) ([]string, error)

SelectCredentials selects vcJWTs based on the constraints defined in the input descriptor

type JSONSchema added in v0.17.0

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 added in v0.17.0

func (j *JSONSchema) AddProperty(name string, value Filter, required bool)

AddProperty adds the provided Filter with the provided name to the JsonSchema

type Optionality added in v0.17.0

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

Jump to

Keyboard shortcuts

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