middleware

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAliasAvailable

func CheckAliasAvailable(email string) (bool, error)

CheckAliasAvailable checks if an alias is already registered

func CheckAliasUnavailable

func CheckAliasUnavailable(email string) (bool, error)

CheckAliasUnavailable checks if an alias is already registered

func CreateOrganizationRecord

func CreateOrganizationRecord(name string, origin string, admin string, controller *controller.SonrController) error

CreateOrganizationRecord creates a new organization record and publishes it to the blockchain

func GetControllerAccount

func GetControllerAccount(address string) (*identitytypes.ControllerAccount, error)

GetControllerAccount returns the DIDDocument of a given DID or Alias

func GetDID

func GetDID(alias string) (*identitytypes.DIDDocument, error)

GetDID returns the DIDDocument of a given DID or Alias

func GetEmailRecordCreator

func GetEmailRecordCreator(email string) (string, error)

GetEmailRecordCreator returns the creator of a given email

func GetServiceRecord

func GetServiceRecord(origin string) (*servicetypes.ServiceRecord, error)

GetServiceRecord returns the ServiceRecord of a given origin

func IssueCredentialAssertionOptions

func IssueCredentialAssertionOptions(email string, record *servicetypes.ServiceRecord) (string, protocol.URLEncodedBase64, string, error)

IssueCredentialAssertionOptions takes a didDocument and serviceRecord in order to create a credential options.

func IssueCredentialAttestationOptions

func IssueCredentialAttestationOptions(alias string, record *servicetypes.ServiceRecord) (string, protocol.URLEncodedBase64, error)

IssueCredentialAttestationOptions takes a ucwId alias, and random unclaimed address and returns a token with the credential options.

func IssueEmailAssertionOptions

func IssueEmailAssertionOptions(email string, ucwDid string) (string, error)

IssueEmailAssertionOptions takes a didDocument and serviceRecord in order to create a credential options.

func PublishControllerAccount

func PublishControllerAccount(alias string, cred *servicetypes.WebauthnCredential, origin string) (*controller.SonrController, *types.TxResponse, error)

PublishControllerAccount creates a new controller account and publishes it to the blockchain

func StoreAuthCookies

func StoreAuthCookies(c *gin.Context, res *types.AuthenticationResult, origin string) gin.H

StoreAuthCookies function stores authentication cookies in the context.

func UseControllerAccount

func UseControllerAccount(token string) (*controller.SonrController, error)

UseControllerAccount takes a jwt token and returns a controller account.

Types

This section is empty.

Jump to

Keyboard shortcuts

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