Spec

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim string

Claim is a string that represents a claim, it is usually an uri.

func NewClaim

func NewClaim(s string) Claim

func (Claim) String

func (c Claim) String() string

type ClaimMatchResult

type ClaimMatchResult struct {
	ServiceProvider ServiceProvider `json:"serviceProvider"`
	Claim           Claim           `json:"claim"`
	// MatchArray   []string
	ClaimProfile ClaimProfile `json:"claimProfile"`
}

ClaimMatchResult is the result of matching a claim, it contains the service provider, the claim, and the claim profile.

type ClaimProfile

type ClaimProfile struct {
	UserId      string `json:"userId"`
	Host        string `json:"host"`
	ProfileLink string `json:"profileLink"`
	ProofLink   string `json:"proofLink"`
}

ClaimProfile is the profile of a claim, it contains the user id, the profile link and the proof link(if I can generate it without web).

type ClaimResult

type ClaimResult struct {
	ClaimMatchResult ClaimMatchResult `json:"claimMatchResult"`
	ClaimVerify      ClaimVerify      `json:"claimVerify"`
}

ClaimResult is the result of a claim, it contains the claim match result and the claim verify result.

type ClaimVerify

type ClaimVerify struct {
	Verified         bool   `json:"verified"`
	ProxyDescription string `json:"proxyDescription"`
}

ClaimVerify is the result of verifying a claim, it contains whether the claim is verified and the proxy description(if used proxy).

type Proxy

type Proxy struct {
	P           interface{}
	Description string `json:"description"`
}

type Proxys

type Proxys map[string]Proxy

Proxys is a map of service provider ids to proxy values,about what type each proxy is, please see the documentation about the specific service provider.

type ServiceProvider

type ServiceProvider struct {
	Id string `json:"id"`
	// Host      mo.Option[string] `json:"host"`
	NeedProxy bool `json:"needProxy"`
	// Prefix               []string
	MatchHandler         func(Claim) bool                            `json:"-"`
	MakeClaimProfileFunc func(Claim) ClaimProfile                    `json:"-"`
	FetchFunc            func(ClaimProfile, Proxy) mo.Result[string] `json:"-"`
}

A ServiceProvider is a service provider, it contains the id, the display name,the host, whether it needs a proxy, the prefix of the claims it can verify, a function that fetches the proofString, and a function that makes a ClaimProfile from a Claim.

Jump to

Keyboard shortcuts

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