common

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Overview

Package common provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func MapToVCFormat added in v1.12.0

func MapToVCFormat(format vcsverifiable.Format) (vcsverifiable.OIDCFormat, error)

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func ValidateDIDMethod

func ValidateDIDMethod(method DIDMethod) (profileapi.Method, error)

func ValidateKMSConfig

func ValidateKMSConfig(config *KMSConfig) (*kms.Config, error)

func ValidateKMSType

func ValidateKMSType(kmsType KMSConfigType) (kms.Type, error)

func ValidateVCFormat

func ValidateVCFormat(format VCFormat) (vcsverifiable.Format, error)

func ValidateVPFormat

func ValidateVPFormat(format VPFormat) (vcsverifiable.Format, error)

Types

type AuthorizationDetails

type AuthorizationDetails struct {
	// CredentialConfigurationId REQUIRED when Format parameter is not present. String specifying a unique identifier of the Credential being described in the credential_configurations_supported map in the Credential Issuer Metadata. The referenced object in the credential_configurations_supported map conveys the details, such as the format, for issuance of the requested Credential. It MUST NOT be present if format parameter is present.
	CredentialConfigurationId *string `json:"credential_configuration_id,omitempty"`

	// CredentialDefinition Object containing the detailed description of the credential type.
	CredentialDefinition *CredentialDefinition `json:"credential_definition,omitempty"`

	// CredentialIdentifiers For Token response only. Array of strings, each uniquely identifying a Credential that can be issued using the Access Token returned in this response. Each of these Credentials corresponds to the same entry in the credential_configurations_supported Credential Issuer metadata but can contain different claim values or a different subset of claims within the claims set identified by that Credential type.
	CredentialIdentifiers *[]string `json:"credential_identifiers,omitempty"`

	// Format REQUIRED when CredentialConfigurationId parameter is not present. String identifying the format of the Credential the Wallet needs. This Credential format identifier determines further claims in the authorization details object needed to identify the Credential type in the requested format. It MUST NOT be present if credential_configuration_id parameter is present.
	Format *string `json:"format,omitempty"`

	// Locations An array of strings that allows a client to specify the location of the resource server(s) allowing the Authorization Server to mint audience restricted access tokens.
	Locations *[]string `json:"locations,omitempty"`

	// Type String that determines the authorization details type. MUST be set to "openid_credential" for OIDC4VC.
	Type string `json:"type"`
}

AuthorizationDetails Model to convey the details about the Credentials the Client wants to obtain.

type CredentialDefinition added in v1.8.0

type CredentialDefinition struct {
	// Context For ldp_vc only. Array as defined in https://www.w3.org/TR/vc-data-model/#contexts.
	Context *[]string `json:"@context,omitempty"`

	// CredentialSubject An object containing a list of name/value pairs, where each name identifies a claim offered in the Credential. The value can be another such object (nested data structures), or an array of such objects.
	CredentialSubject *map[string]interface{} `json:"credentialSubject,omitempty"`

	// Type Array designating the types a certain credential type supports
	Type []string `json:"type"`
}

CredentialDefinition Object containing the detailed description of the credential type.

type CredentialResponseCredentialObject added in v1.12.0

type CredentialResponseCredentialObject struct {
	Credential any `json:"credential"`
}

CredentialResponseCredentialObject Model for credentials field from credential response.

type DIDMethod

type DIDMethod string

DIDMethod DID method of the DID to be used for signing.

const (
	DIDMethodKey DIDMethod = "key"
	DIDMethodOrb DIDMethod = "orb"
	DIDMethodWeb DIDMethod = "web"
)

Defines values for DIDMethod.

func MapToDIDMethod

func MapToDIDMethod(method profileapi.Method) (DIDMethod, error)

type KMSConfig

type KMSConfig struct {
	// DbPrefix Prefix of database used by local kms.
	DbPrefix *string `json:"dbPrefix,omitempty"`

	// DbType Type of database used by local kms.
	DbType *string `json:"dbType,omitempty"`

	// DbURL URL to database used by local kms.
	DbURL *string `json:"dbURL,omitempty"`

	// Endpoint KMS endpoint.
	Endpoint *string `json:"endpoint,omitempty"`

	// SecretLockKeyPath Path to secret lock used by local kms.
	SecretLockKeyPath *string `json:"secretLockKeyPath,omitempty"`

	// Type Type of kms used to create and store DID keys.
	Type KMSConfigType `json:"type"`
}

KMSConfig Model for KMS configuration.

type KMSConfigType

type KMSConfigType string

KMSConfigType Type of kms used to create and store DID keys.

const (
	KMSConfigTypeAws   KMSConfigType = "aws"
	KMSConfigTypeLocal KMSConfigType = "local"
	KMSConfigTypeWeb   KMSConfigType = "web"
)

Defines values for KMSConfigType.

func MapToKMSConfigType

func MapToKMSConfigType(kmsType kms.Type) (KMSConfigType, error)

type VCFormat

type VCFormat string

VCFormat Supported VC formats.

const (
	CwtVcLd     VCFormat = "cwt_vc-ld"
	JwtVcJson   VCFormat = "jwt_vc_json"
	JwtVcJsonLd VCFormat = "jwt_vc_json-ld"
	LdpVc       VCFormat = "ldp_vc"
)

Defines values for VCFormat.

type VPFormat

type VPFormat string

VPFormat Supported VP formats.

const (
	CwtVp VPFormat = "cwt_vp"
	JwtVp VPFormat = "jwt_vp"
	LdpVp VPFormat = "ldp_vp"
)

Defines values for VPFormat.

func MapToVPFormat

func MapToVPFormat(format vcsverifiable.Format) (VPFormat, error)

type WalletInitiatedFlowData added in v1.2.0

type WalletInitiatedFlowData struct {
	ClaimEndpoint        string    `json:"claim_endpoint"`
	CredentialTemplateId string    `json:"credential_template_id"`
	OpState              string    `json:"op_state"`
	ProfileId            string    `json:"profile_id"`
	ProfileVersion       string    `json:"profile_version"`
	Scopes               *[]string `json:"scopes"`
}

WalletInitiatedFlowData defines model for WalletInitiatedFlowData.

Jump to

Keyboard shortcuts

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