attributes

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: BSD-2-Clause Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package attributes implements the TS11 §2 Catalogue of Attributes. It infers Attribute objects from VCTM claim definitions and supports optional manual overrides via *.attr.json files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSchemas

func GenerateSchemas(attrs []Attribute) map[string]json.RawMessage

GenerateSchemas generates a minimal JSON Schema for each attribute. Returns a map from schema filename to JSON content.

Types

type AttestationRef

type AttestationRef struct {
	SchemaID string `json:"schemaId"`
	Org      string `json:"org"`
	Slug     string `json:"slug"`
	Name     string `json:"name,omitempty"`
}

AttestationRef links an attribute back to an attestation that uses it. This is a SIROS extension (x-usedBy) not in the TS11 spec.

type Attribute

type Attribute struct {
	Identifier                string               `json:"identifier"`
	Name                      []LangValue          `json:"name"`
	Description               []LangValue          `json:"description,omitempty"`
	NameSpace                 string               `json:"nameSpace,omitempty"`
	Distributions             []SchemaDistribution `json:"distributions"`
	ContactInfo               []string             `json:"contactInfo,omitempty"`
	LegalBasis                []string             `json:"legalBasis,omitempty"`
	SemanticDataSpecification string               `json:"semanticDataSpecification,omitempty"`
	AuthenticSources          []DataService        `json:"authenticSources,omitempty"`
	UsedBy                    []AttestationRef     `json:"x-usedBy,omitempty"` // cross-reference to attestations
}

Attribute represents a TS11 §2.1 Attribute object.

func InferFromCredentials

func InferFromCredentials(credentials []CredentialInput, baseURL string) []Attribute

InferFromCredentials builds a catalogue of attributes by extracting claims from credentials and deduplicating by identifier. Claims with the same namespace+path produce a single Attribute with multiple UsedBy references.

type ClaimInput

type ClaimInput struct {
	Path        []string // claim path segments
	DisplayName string   // first non-empty display name (any locale)
	DisplayLang string   // locale of the display name
}

ClaimInput is the minimal claim information needed to infer an Attribute.

type CredentialInput

type CredentialInput struct {
	SchemaID string       // SchemaMeta UUID
	Org      string       // organization slug
	Slug     string       // credential slug
	Name     string       // credential display name
	VCT      string       // vct URI from VCTM (used to derive namespace)
	Claims   []ClaimInput // claims extracted from VCTM
}

CredentialInput is the minimal credential information needed for inference.

type DataService

type DataService struct {
	Country             string `json:"country"`
	NationalSubID       string `json:"nationalSubID,omitempty"`
	EndpointURL         string `json:"endpointURL"`
	EndpointDescription string `json:"endpointDescription,omitempty"`
}

DataService holds a TS11 §2.1 authentic source endpoint.

type LangValue

type LangValue struct {
	Value string `json:"value"`
	Lang  string `json:"lang"`
}

LangValue holds a language-tagged string value.

type SchemaDistribution

type SchemaDistribution struct {
	AccessURL string `json:"accessURL"`
	MediaType string `json:"mediaType"`
}

SchemaDistribution holds a TS11 §2.1 distribution reference.

Jump to

Keyboard shortcuts

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