Documentation ¶
Index ¶
- Variables
- func CreateEvent(eventType spi.EventType, transactionID TxID, ep *EventPayload) (*spi.Event, error)
- func GetSupportedVPFormats(kmsSupportedKeyTypes []kmsapi.KeyType, ...) *presexch.Format
- type AuthorizationResponseParsed
- type ClaimData
- type Claims
- type Config
- type CredentialMetadata
- type EventPayload
- type Filter
- type InteractionInfo
- type JWSSigner
- type ProcessedVPToken
- type ReceivedClaims
- type ReceivedClaimsRaw
- type RequestObject
- type RequestObjectClaims
- type RequestObjectRegistration
- type Service
- func (s *Service) DeleteClaims(_ context.Context, claimsID string) error
- func (s *Service) GetTx(_ context.Context, id TxID) (*Transaction, error)
- func (s *Service) InitiateOidcInteraction(ctx context.Context, presentationDefinition *presexch.PresentationDefinition, ...) (*InteractionInfo, error)
- func (s *Service) RetrieveClaims(ctx context.Context, tx *Transaction, profile *profileapi.Verifier) map[string]CredentialMetadata
- func (s *Service) VerifyOIDCVerifiablePresentation(ctx context.Context, txID TxID, authResponse *AuthorizationResponseParsed) error
- type ServiceInterface
- type Transaction
- type TransactionUpdate
- type TxClaimsStore
- type TxID
- type TxManager
- func (tm *TxManager) ClaimsToClaimsRaw(data *ReceivedClaims) (*ReceivedClaimsRaw, error)
- func (tm *TxManager) CreateTx(pd *presexch.PresentationDefinition, profileID, profileVersion string, ...) (*Transaction, string, error)
- func (tm *TxManager) DecryptClaims(ctx context.Context, data *ClaimData) (*ReceivedClaims, error)
- func (tm *TxManager) DeleteReceivedClaims(claimsID string) error
- func (tm *TxManager) EncryptClaims(ctx context.Context, data *ReceivedClaims) (*ClaimData, error)
- func (tm *TxManager) Get(txID TxID) (*Transaction, error)
- func (tm *TxManager) GetByOneTimeToken(nonce string) (*Transaction, bool, error)
- func (tm *TxManager) StoreReceivedClaims(txID TxID, claims *ReceivedClaims) error
- type TxNonceStore
- type TxStore
- type VPToken
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDataNotFound = errors.New("data not found")
Functions ¶
func CreateEvent ¶ added in v1.5.0
func GetSupportedVPFormats ¶ added in v1.1.0
Types ¶
type AuthorizationResponseParsed ¶ added in v1.6.0
type AuthorizationResponseParsed struct { // CustomScopeClaims stores additional claims provided by Holder // caused by custom scope as a part of Initiate Credential Presentation request. CustomScopeClaims map[string]Claims VPTokens []*ProcessedVPToken }
type ClaimData ¶
type ClaimData struct {
EncryptedData *dataprotect.EncryptedData `json:"encrypted_data"`
}
type Config ¶
type Config struct { TransactionManager transactionManager RequestObjectPublicStore requestObjectPublicStore KMSRegistry kmsRegistry DocumentLoader ld.DocumentLoader ProfileService profileService EventSvc eventService EventTopic string PresentationVerifier presentationVerifier VDR vdrapi.Registry RedirectURL string TokenLifetime time.Duration Metrics metricsProvider }
type CredentialMetadata ¶
type CredentialMetadata struct { Format vcsverifiable.Format `json:"format,omitempty"` Type []string `json:"type,omitempty"` SubjectData interface{} `json:"subjectData,omitempty"` Issuer interface{} `json:"issuer,omitempty"` IssuanceDate *util.TimeWrapper `json:"issuanceDate,omitempty"` ExpirationDate *util.TimeWrapper `json:"expirationDate,omitempty"` CustomClaims map[string]Claims `json:"customClaims,omitempty"` }
type EventPayload ¶ added in v1.5.0
type EventPayload struct { WebHook string `json:"webHook,omitempty"` ProfileID string `json:"profileID,omitempty"` ProfileVersion string `json:"profileVersion,omitempty"` OrgID string `json:"orgID,omitempty"` PresentationDefinitionID string `json:"presentationDefinitionID,omitempty"` Filter *Filter `json:"filter,omitempty"` AuthorizationRequest string `json:"authorizationRequest,omitempty"` Error string `json:"error,omitempty"` ErrorCode string `json:"errorCode,omitempty"` ErrorComponent string `json:"errorComponent,omitempty"` }
type InteractionInfo ¶
type JWSSigner ¶
type JWSSigner struct {
// contains filtered or unexported fields
}
func NewJWSSigner ¶
func NewJWSSigner(keyID string, signer vc.SignerAlgorithm) *JWSSigner
func (*JWSSigner) Headers ¶
Headers provides JWS headers. "alg" header must be provided (see https://tools.ietf.org/html/rfc7515#section-4.1)
type ProcessedVPToken ¶
type ProcessedVPToken struct { Nonce string ClientID string SignerDIDID string VpTokenFormat vcsverifiable.Format Presentation *verifiable.Presentation }
type ReceivedClaims ¶
type ReceivedClaims struct { CustomScopeClaims map[string]Claims Credentials map[string]*verifiable.Credential }
type ReceivedClaimsRaw ¶
type ReceivedClaimsRaw struct { Credentials map[string][]byte `json:"credentials"` CustomScopeClaims map[string][]byte `json:"customScopeClaims,omitempty"` }
ReceivedClaimsRaw is temporary struct for parsing to ReceivedClaims, as we need to unmarshal credentials separately.
type RequestObject ¶
type RequestObject struct { JTI string `json:"jti"` IAT int64 `json:"iat"` ISS string `json:"iss"` ResponseType string `json:"response_type"` ResponseMode string `json:"response_mode"` Scope string `json:"scope"` Nonce string `json:"nonce"` ClientID string `json:"client_id"` RedirectURI string `json:"redirect_uri"` State string `json:"state"` Exp int64 `json:"exp"` Registration RequestObjectRegistration `json:"registration"` Claims RequestObjectClaims `json:"claims"` }
RequestObject represents the request object sent to the wallet. It contains the presentation definition that specifies what verifiable credentials should be sent back by the wallet.
type RequestObjectClaims ¶
type RequestObjectClaims struct {
VPToken VPToken `json:"vp_token"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) DeleteClaims ¶
func (*Service) InitiateOidcInteraction ¶
func (s *Service) InitiateOidcInteraction( ctx context.Context, presentationDefinition *presexch.PresentationDefinition, purpose string, customScopes []string, profile *profileapi.Verifier, ) (*InteractionInfo, error)
func (*Service) RetrieveClaims ¶
func (s *Service) RetrieveClaims( ctx context.Context, tx *Transaction, profile *profileapi.Verifier, ) map[string]CredentialMetadata
func (*Service) VerifyOIDCVerifiablePresentation ¶
type ServiceInterface ¶
type ServiceInterface interface { InitiateOidcInteraction( ctx context.Context, presentationDefinition *presexch.PresentationDefinition, purpose string, customScopes []string, profile *profileapi.Verifier, ) (*InteractionInfo, error) VerifyOIDCVerifiablePresentation(ctx context.Context, txID TxID, authResponse *AuthorizationResponseParsed) error GetTx(ctx context.Context, id TxID) (*Transaction, error) RetrieveClaims(ctx context.Context, tx *Transaction, profile *profileapi.Verifier) map[string]CredentialMetadata DeleteClaims(ctx context.Context, receivedClaimsID string) error }
type Transaction ¶
type Transaction struct { ID TxID ProfileID string ProfileVersion string PresentationDefinition *presexch.PresentationDefinition ReceivedClaims *ReceivedClaims ReceivedClaimsID string CustomScopes []string }
type TransactionUpdate ¶
type TxClaimsStore ¶
type TxClaimsStore txClaimsStore
type TxManager ¶
type TxManager struct {
// contains filtered or unexported fields
}
TxManager used to manage oidc transactions.
func NewTxManager ¶
func NewTxManager( store txNonceStore, txStore txStore, txClaimsStore txClaimsStore, dataProtector dataProtector, docLoader ld.DocumentLoader, ) *TxManager
NewTxManager creates TxManager.
func (*TxManager) ClaimsToClaimsRaw ¶
func (tm *TxManager) ClaimsToClaimsRaw(data *ReceivedClaims) (*ReceivedClaimsRaw, error)
func (*TxManager) CreateTx ¶
func (tm *TxManager) CreateTx( pd *presexch.PresentationDefinition, profileID, profileVersion string, customScopes []string, ) (*Transaction, string, error)
CreateTx creates transaction and generate one time access token.
func (*TxManager) DecryptClaims ¶
func (*TxManager) DeleteReceivedClaims ¶
func (*TxManager) EncryptClaims ¶
func (*TxManager) Get ¶
func (tm *TxManager) Get(txID TxID) (*Transaction, error)
Get transaction id.
func (*TxManager) GetByOneTimeToken ¶
func (tm *TxManager) GetByOneTimeToken(nonce string) (*Transaction, bool, error)
GetByOneTimeToken get transaction by nonce and then delete nonce.
func (*TxManager) StoreReceivedClaims ¶
func (tm *TxManager) StoreReceivedClaims(txID TxID, claims *ReceivedClaims) error
type TxNonceStore ¶
type TxNonceStore txNonceStore
type VPToken ¶
type VPToken struct {
PresentationDefinition *presexch.PresentationDefinition `json:"presentation_definition"`
}
Click to show internal directories.
Click to hide internal directories.