Documentation
¶
Index ¶
- Variables
- func ValidatorErrorToUser(err validator.ValidationErrors) string
- type APIStatistics
- type ApiError
- type DIDApi
- type DIDMtpApi
- type DomainApi
- type HandshakeApi
- type HandshakeMTPApi
- type HealthCheckAPI
- type MailReceiveWebhook
- type MessagingApi
- type MessagingMTPApi
- type S3Api
- type UserAccountApi
- func (ua *UserAccountApi) ChallengeNonce(c *gin.Context)
- func (ua *UserAccountApi) DeleteEncryptedPasswordForDeviceTransfer(c *gin.Context)
- func (ua *UserAccountApi) DeleteNonce(c *gin.Context)
- func (ua *UserAccountApi) FindUsersAddressByEmail(c *gin.Context)
- func (ua *UserAccountApi) GetEncryptedPasswordForDeviceTransfer(c *gin.Context)
- func (ua *UserAccountApi) Login(c *gin.Context)
- func (ua *UserAccountApi) Logout(c *gin.Context)
- func (ua *UserAccountApi) Register(c *gin.Context)
- func (ua *UserAccountApi) StoreEncryptedPasswordForDeviceTransfer(c *gin.Context)
- func (ua *UserAccountApi) VerifyCookie(c *gin.Context)
- type UserProfileApi
- type VC
- type WebAuthnApi
- func (a *WebAuthnApi) LoginOptions(c *gin.Context)
- func (a *WebAuthnApi) LoginVerify(c *gin.Context)
- func (a *WebAuthnApi) RegistrationOptions(c *gin.Context)
- func (a *WebAuthnApi) VerifyRegistration(c *gin.Context)
- func (a *WebAuthnApi) WebauthnUserHandler(rawID, userHandle []byte) (webauthn.User, error)
Constants ¶
This section is empty.
Variables ¶
var DENIED_FILE_EXTENSIONS = map[string]string{"ade": "ade", "adp": "adp", "apk": "apk", "appx": "appx", "appxbundle": "appxbundle", "bat": "bat", "cab": "cab", "chm": "chm", "cmd": "cmd", "com": "com", "cpl": "cpl", "dll": "dll", "dmg": "dmg", "ex": "ex", "ex_": "ex_", "exe": "exe", "hta": "hta", "ins": "ins", "isp": "isp", "iso": "iso", "jar": "jar", "js": "js", "jse": "jse", "lib": "lib", "lnk": "lnk", "mde": "mde", "msc": "msc", "msi": "msi", "msix": "msix", "msixbundle": "msixbundle", "msp": "msp", "mst": "mst", "nsh": "nsh", "pif": "pif", "ps1": "ps1", "scr": "scr", "sct": "sct", "shb": "shb", "sys": "sys", "vb": "vb", "vbe": "vbe", "vbs": "vbs", "vxd": "vxd", "wsc": "wsc", "wsf": "wsf", "wsh": "wsh"}
Functions ¶
func ValidatorErrorToUser ¶
func ValidatorErrorToUser(err validator.ValidationErrors) string
Types ¶
type APIStatistics ¶
type APIStatistics struct {
// contains filtered or unexported fields
}
APIStatistics is the API for checking number of received emails from sender and an interest recipient showed for the senders emails
func NewAPIStatistics ¶
func NewAPIStatistics(statisticsService *services.StatisticsService) *APIStatistics
func (*APIStatistics) GetEmailStatistics ¶
func (a *APIStatistics) GetEmailStatistics(c *gin.Context)
Get Email statistics @Security Bearer @Summary Get Email statistics @Description Returns number of sent emails, received emails and interest shown by the recipient @Tags Statistics @Param sender query string true "Sender email address or Mailio address" @Success 200 {object} types.EmailStatisticsOutput @Failure 429 {object} api.ApiError "rate limit exceeded" @Accept json @Produce json @Router /api/v1/emailstatistics [get]
func (*APIStatistics) ReportInterest ¶
func (a *APIStatistics) ReportInterest(c *gin.Context)
Reporting interest shown by the recipient @Security Bearer @Summary Report Interest @Description Report interest shown by the recipient (e.g. clicking on a link in the email, reading an email, archiving it, ...) @Tags Statistics @Param interest body types.InterestInput true "interest shown by the recipient" @Success 200 {object} types.InterestOuput @Failure 400 {object} api.ApiError "bad request" @Failure 429 {object} api.ApiError "rate limit exceeded" @Accept json @Produce json @Router /api/v1/emailstatistics/interest [put]
type ApiError ¶
type DIDApi ¶
type DIDApi struct {
// contains filtered or unexported fields
}
func NewDIDApi ¶
func NewDIDApi(ssiService *services.SelfSovereignService, mtpService *services.MtpService) *DIDApi
func (*DIDApi) CreateServerDID ¶
Server DID @Summary Mailio Server DID Document (public keys) @Description Returns a DID Document @Tags Decentralized Identifiers @Success 200 {object} did.Document @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "error creating server did" @Accept json @Produce json @Router /.well-known/did.json [get]
func (*DIDApi) CreateServerDIDConfiguration ¶
Server DID Configuration @Summary Mailio Server DID Configuration @Description Returns a DID Configuration @Tags Decentralized Identifiers @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "error creating server did configuration" @Accept json @Produce json @Router /.well-known/did-configuration.json [get]
func (*DIDApi) FetchDIDByWebDID ¶
@Summary Fetch all DID documents by Web DID (local and remote) @Description Fetch all DID documents by Web DID (local and remote) @Security Bearer @Tags Messaging @Accept json @Produce json @Param webdid body types.InputWebDIDLookup true "InputWebDIDLookup" @Success 200 {object} types.OutputDIDLookup @Failure 404 {object} api.ApiError "DID not found" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 400 {object} api.ApiError "invalid DID resolution" @Failure 500 {object} api.ApiError "server error" @Router /api/v1/resolve/webdid [post]
func (*DIDApi) FetchDIDDocumentsByEmailHash ¶
@Summary Fetch all DID documents by email hash (local and remote) @Description Fetch all DID documents by email hash (local and remote) @Security Bearer @Tags Messaging @Accept json @Produce json @Param lookups body types.InputDIDLookup true "InputDIDLookup" @Success 200 {object} types.OutputDIDLookup @Failure 404 {object} api.ApiError "DID not found" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 400 {object} api.ApiError "invalid email address" @Failure 500 {object} api.ApiError "error fetching did documents" @Router /api/v1/resolve/did [post]
func (*DIDApi) GetDIDDocument ¶
Returns users DID document based on the mailio address @Summary Resolve users DID document @Description Returns users DID document based on mailio address @Tags Decentralized Identifiers @Accept json @Produce json @Param address path string true "Mailio address" @Success 200 {object} did.Document @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 404 {object} api.ApiError "DID not found" @Failure 400 {object} api.ApiError "Invalid DID" @Router /{address}/did.json [get]
type DIDMtpApi ¶
type DIDMtpApi struct {
// contains filtered or unexported fields
}
func NewDIDMtpApi ¶
func NewDIDMtpApi(mtpService *services.MtpService, env *types.Environment) *DIDMtpApi
func (*DIDMtpApi) GetLocalDIDDocuments ¶
Request DID Documents from local database by email hash (digitally signed) The request is typically make from remote server method FetchDIDDocuments (above) @Summary Request did docouments from this server (must be digitally signed by senders Mailio server) @Description Request did documents from this server by email hash (must be digitally signed bny senders Mailio server) @Tags Mailio Transfer Protocol @Accept json @Produce json @Param did body types.DIDDocumentSignedRequest true "DIDDocumentSignedRequest" @Success 200 {object} types.DIDDocumentSignedResponse @Failure 401 {object} api.ApiError "invalid signature" @Failure 400 {object} api.ApiError "bad request" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/mtp/did [post]
type DomainApi ¶
type DomainApi struct {
// contains filtered or unexported fields
}
func NewDomainApi ¶
func NewDomainApi(domainService *services.DomainService) *DomainApi
func (*DomainApi) List ¶
List of supported domains @Summary List all domains @Description Returns a list of all supported domains @Tags Domains @Success 200 {object} []types.UserDomain @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "error creating server did" @Accept json @Produce json @Router /api/v1/domains [get]
func (*DomainApi) ResolveDomainForEmail ¶
Resolve domain from email address @Summary Resolve domain from email address (smtp or mailio) @Security Bearer @Description Identify if an email is a DIDcomm/Mailio or SMTP address, and resolve the DID if it’s from a Mailio server. @Tags Messaging @Accept json @Produce json @Param email query string true "valid email address" @Param force query boolean false "force DNS update" default(false) @Success 200 {object} types.Domain @Failure 400 {object} api.ApiError "bad request" @Failure 401 {object} api.ApiError "invalid signature or unauthorized to send messages" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/resolve/domain [get]
type HandshakeApi ¶
type HandshakeApi struct {
// contains filtered or unexported fields
}
func NewHandshakeApi ¶
func NewHandshakeApi(nonceService *services.NonceService, mtpService *services.MtpService, userService *services.UserService, userProfileService *services.UserProfileService) *HandshakeApi
func (*HandshakeApi) PersonalHandshakeLink ¶
func (ha *HandshakeApi) PersonalHandshakeLink(c *gin.Context)
Personal Handshake link @Security Bearer @Summary Create personal handshake link @Description Create personal handshake link @Tags Handshake @Success 200 {object} types.HandshakeLink @Failure 401 {object} api.ApiError "not authorized" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/handshakeoffer [get]
type HandshakeMTPApi ¶
type HandshakeMTPApi struct {
// contains filtered or unexported fields
}
func NewHandshakeMTPApi ¶
func NewHandshakeMTPApi(mtpService *services.MtpService, env *types.Environment) *HandshakeMTPApi
func (*HandshakeMTPApi) GetLocalHandshakes ¶
func (hs *HandshakeMTPApi) GetLocalHandshakes(c *gin.Context)
Request handshake from local database (digitally signed) @Summary Request handshake from this server (must be digitally signed by senders Mailio server) @Description Request handshake from this server (must be digitally signed by senders Mailio server) @Tags Mailio Transfer Protocol @Accept json @Produce json @Param handshake body types.HandshakeSignedRequest true "HandshakeSignedRequest" @Success 200 {object} types.HandshakeSignedResponse @Failure 401 {object} api.ApiError "invalid signature" @Failure 400 {object} api.ApiError "bad request" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/mtp/handshake [post]
type HealthCheckAPI ¶
type HealthCheckAPI struct {
}
func NewHealthCheckAPI ¶
func NewHealthCheckAPI() *HealthCheckAPI
func (*HealthCheckAPI) HealthCheck ¶
func (ha *HealthCheckAPI) HealthCheck(c *gin.Context)
type MailReceiveWebhook ¶
type MailReceiveWebhook struct {
// contains filtered or unexported fields
}
func NewMailReceiveWebhook ¶
func NewMailReceiveWebhook(userService *services.UserService, userProfileService *services.UserProfileService, env *types.Environment) *MailReceiveWebhook
func (*MailReceiveWebhook) ReceiveMail ¶
func (m *MailReceiveWebhook) ReceiveMail(c *gin.Context)
ReceiveMail webhook implementations @Summary Receive a new SMTP email @Description Receive a new SMTP email @Tags Smtp Webhook Handler @Accept json @Produce json @Success 200 @Failure 401 {object} api.ApiError "invalid signature/not authorized" @Failure 400 {object} api.ApiError "bad request" @Failure 500 {object} api.ApiError "internal error" @Router /webhook/mailgun_mime [post]
type MessagingApi ¶
type MessagingApi struct {
// contains filtered or unexported fields
}
func NewMessagingApi ¶
func NewMessagingApi(ssiService *services.SelfSovereignService, userService *services.UserService, userProfileService *services.UserProfileService, domainService *services.DomainService, statsService *services.StatisticsService, env *types.Environment) *MessagingApi
func (*MessagingApi) CancelSend ¶
func (ma *MessagingApi) CancelSend(c *gin.Context)
Cancel send (SMTP or DIDComm) @Summary Cancel send (SMTP or DIDComm) @Security Bearer @Description Cancel send (SMTP or DIDComm) @Tags Messaging @Accept json @Produce json @Param email body types.DIDCommApiResponse true "task ids to cancel" @Success 202 {object} types.DIDCommApiResponse @Failure 400 {object} api.ApiError "bad request" @Failure 401 {object} api.ApiError "invalid signature or unauthorized to cancel messages" @Failure 403 {object} api.ApiError "user not authorized" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/sendcancel [post]
func (*MessagingApi) SendDIDMessage ¶
func (ma *MessagingApi) SendDIDMessage(c *gin.Context)
Send end-to-end encrypted message to a DID recipients @Summary Send end-to-end encrypted message to DID recipients @Security Bearer @Description Send end-to-end encrypted message to DID recipients @Tags Messaging @Accept json @Produce json @Param message body types.DIDCommMessage true "didcomm-encrypted+json" @Success 202 {object} types.DIDCommApiResponse @Failure 400 {object} api.ApiError "bad request" @Failure 401 {object} api.ApiError "invalid signature or unauthorized to send messages" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/senddid [post]
func (*MessagingApi) SendSmtpMessage ¶
func (ma *MessagingApi) SendSmtpMessage(c *gin.Context)
Send SMTP email @Summary Send SMTP email @Security Bearer @Description Send SMTP email @Tags Messaging @Accept json @Produce json @Param email body mailiosmtp.Mail true "smtp email" @Success 202 {object} mailiosmtp.Mail @Failure 400 {object} api.ApiError "bad request" @Failure 401 {object} api.ApiError "invalid signature or unauthorized to send messages" @Failure 403 {object} api.ApiError "user not authorized" @Failure 413 {object} api.ApiError "message too large" @Failure 422 {object} api.ApiError "no recipient/no subject body/too many attachments" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/sendsmtp [post]
type MessagingMTPApi ¶
type MessagingMTPApi struct {
// contains filtered or unexported fields
}
func NewMessagingMTPApi ¶
func NewMessagingMTPApi(mtpService *services.MtpService, env *types.Environment) *MessagingMTPApi
func (*MessagingMTPApi) ReceiveMessage ¶
func (ms *MessagingMTPApi) ReceiveMessage(c *gin.Context)
Receive end-to-end encrypted message (signed by senders Mailio server) @Summary Receive end-to-end encrypted message (signed by senders Mailio server) @Description Receive end-to-end encrypted message (signed by senders Mailio server) @Tags Mailio Transfer Protocol @Accept json @Produce json @Param handshake body types.DIDCommSignedRequest true "didcomm signed request" @Success 200 {object} types.DIDCommApiResponse @Failure 401 {object} api.ApiError "invalid signature" @Failure 400 {object} api.ApiError "bad request" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/mtp/message [post]
type S3Api ¶
type S3Api struct {
// contains filtered or unexported fields
}
func (*S3Api) DeleteObjects ¶
Delete s3 object @Summary Delete object from s3 bucket @Description Delete object from s3 bucket (only in logged in users folder) @Tags S3 @Param objectKeys body types.ArrayOfStrings true "list of ObjectKeys" @Success 200 {array} types.PresignedUrl @Failure 400 {object} api.ApiError "invalid api call" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "error deletin object" @Accept json @Produce json @Router /api/v1/s3 [delete]
func (*S3Api) DeleteProfilePhoto ¶
GetPresignedUrlGet @Summary Delete object from s3 bucket @Description Deletes user profile photo @Tags S3 @Success 200 {object} types.PresignedUrl @Failure 400 {object} api.ApiError "invalid api call" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "failed to delete object" @Accept json @Produce json @Router /api/v1/s3deleteprofilephoto [delete]
func (*S3Api) GetPresignedUrlPut ¶
GetPresignedUrlPut @Summary GetObject makes a presigned request that can be used to get an object from a bucket. @Description The presigned request is valid for the specified number of seconds. @Tags S3 @Param objectKey query string true "objectKey" @Param method query string true "method" @Success 200 {object} types.PresignedUrl @Failure 400 {object} api.ApiError "invalid api call" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "error creating presigned url" @Accept json @Produce json @Router /api/v1/s3presign [get]
func (*S3Api) UploadProfilePhoto ¶
UploadPhoto @Summary Upload a profile photo @Description Upload a profile photo to the users folder @Tags S3 @Success 200 {object} types.PresignedUrl @Failure 400 {object} api.ApiError "invalid api call" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "server error uploading photo" @Accept json @Produce json @Router /api/v1/s3uploadprofilephoto [post]
type UserAccountApi ¶
type UserAccountApi struct {
// contains filtered or unexported fields
}
func NewUserAccountApi ¶
func NewUserAccountApi(userService *services.UserService, userProfileService *services.UserProfileService, nonceService *services.NonceService, ssiService *services.SelfSovereignService, smartKeyService *services.SmartKeyService, webauthnService *services.WebAuthnService) *UserAccountApi
func (*UserAccountApi) ChallengeNonce ¶
func (ua *UserAccountApi) ChallengeNonce(c *gin.Context)
Login and Registration challenge nonce @Summary Login and Registration challenge nonce @Description Returns a nonce which client needs to sign with their private key @Tags User Account @Success 200 {object} types.NonceResponse @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "Internal server error" @Accept json @Produce json @Router /api/v1/nonce [get]
func (*UserAccountApi) DeleteEncryptedPasswordForDeviceTransfer ¶
func (ua *UserAccountApi) DeleteEncryptedPasswordForDeviceTransfer(c *gin.Context)
Delete password for device transfer @Summary delete password for device transfer @Description delete passord for device transfer @Tags User Account @Param id path string true "nonce" @Success 200 @Failure 400 {object} api.ApiError "invalid api call" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "error deletin object" @Accept json @Produce json @Router /api/v1/devicetransfer/{id} [delete]
func (*UserAccountApi) DeleteNonce ¶
func (ua *UserAccountApi) DeleteNonce(c *gin.Context)
Deletes nonce if it exists @Summary Deletes nonce if it exists @Description Deletes nonce if it exists @Tags User Account @Param id path string true "nonce id" @Success 200 {object} types.NonceResponse @Failure 404 {object} api.ApiError "not found" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "Internal server error" @Accept json @Produce json @Router /api/v1/nonce/{id} [delete]
func (*UserAccountApi) FindUsersAddressByEmail ¶
func (ua *UserAccountApi) FindUsersAddressByEmail(c *gin.Context)
Find user by email address @Summary Find user by base64 scrypt email address @Description Returns a mailio address @Tags User Account @Param emailHash query string true "Base64 formatted Scrypt of email address" @Param email query string true "hashed email in clear text" @Success 200 {object} types.OutputUserAddress @Failure 429 {object} api.ApiError "rate limit exceeded" @Accept json @Produce json @Router /api/v1/findaddress [get]
func (*UserAccountApi) GetEncryptedPasswordForDeviceTransfer ¶
func (ua *UserAccountApi) GetEncryptedPasswordForDeviceTransfer(c *gin.Context)
Get encrypted password for device transfer @Security Bearer @Summary Get encrypted password for device transfer @Description Returns the encrypted shared password @Tags User Account @Param id path string true "nonce" @Success 200 {object} types.DeviceKeyTransfer @Failure 401 {object} api.ApiError "Unauthorized" @Failure 404 {object} ApiError "Invalid input parameters" @Failure 409 {object} ApiError "User already exists" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} ApiError "Internal server error" @Accept json @Produce json @Router /api/v1/devicetransfer/{id} [get]
func (*UserAccountApi) Login ¶
func (ua *UserAccountApi) Login(c *gin.Context)
Login method @Summary Login with username and password @Description Returns a JWS token @Tags User Account @Param login body types.InputLogin true "login input" @Success 200 {object} types.JwsToken @Failure 401 {object} api.ApiError "Invalid signature" @Failure 403 {object} api.ApiError "Failed to login (valid signature, no valid VC)" @Failure 404 {object} api.ApiError "Failed to login (user not registered)" @Failure 400 {object} api.ApiError "Invalid or missing input parameters" @Failure 429 {object} api.ApiError "rate limit exceeded" @Accept json @Produce json @Router /api/v1/login [post]
func (*UserAccountApi) Logout ¶
func (ua *UserAccountApi) Logout(c *gin.Context)
Logout user by removing httpOnly cookie @Security Bearer @Summary Logout user @Description Logout user @Tags User Account @Failure 429 {object} api.ApiError "rate limit exceeded" @Accept json @Produce json @Router /api/v1/logout [get]
func (*UserAccountApi) Register ¶
func (ua *UserAccountApi) Register(c *gin.Context)
Register user method @Summary Register user @Description Returns a JWS token @Tags User Account @Param registration body types.InputRegister true "registration input" @Success 200 {object} types.JwsToken @Failure 401 {object} api.ApiError "Invalid signature" @Failure 404 {object} ApiError "Invalid input parameters" @Failure 409 {object} ApiError "User already exists" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} ApiError "Internal server error" @Accept json @Produce json @Router /api/v1/register [post]
func (*UserAccountApi) StoreEncryptedPasswordForDeviceTransfer ¶
func (ua *UserAccountApi) StoreEncryptedPasswordForDeviceTransfer(c *gin.Context)
Transfer 1/3 password for smartkey to another device @Security Bearer @Summary Transfer 1/3 password for smartkey to another device @Description Returns a nonce for constructing url for QR Code @Tags User Account @Param transferKey body types.DeviceKeyTransferInput true "encrypted shared password" @Success 200 {object} types.DeviceKeyTransferOutput @Failure 401 {object} api.ApiError "Invalid signature" @Failure 404 {object} ApiError "Invalid input parameters" @Failure 409 {object} ApiError "User already exists" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} ApiError "Internal server error" @Accept json @Produce json @Router /api/v1/devicetransfer [post]
func (*UserAccountApi) VerifyCookie ¶
func (ua *UserAccountApi) VerifyCookie(c *gin.Context)
Get logged in users smartkey based on a JWS token @Security Bearer @Summary Get logged in users smartkey based on a JWS token @Description Get logged in users smartkey based on a JWS token @Tags User Account @Success 200 {object} types.JwsTokenWithSmartKey @Failure 429 {object} api.ApiError "rate limit exceeded" @Accept json @Produce json @Router /api/v1/verify_cookie [get]
type UserProfileApi ¶
type UserProfileApi struct {
// contains filtered or unexported fields
}
func NewUserProfileApi ¶
func NewUserProfileApi(userService *services.UserService, userProfileService *services.UserProfileService, webauthnService *services.WebAuthnService) *UserProfileApi
func (*UserProfileApi) GetFromCache ¶
func (a *UserProfileApi) GetFromCache(address string) *types.UserProfile
func (*UserProfileApi) GetUserProfile ¶
func (a *UserProfileApi) GetUserProfile(c *gin.Context)
Get logged in users basic information @Security Bearer @Summary Get logged inusers basic information @Description Get logged in users basic information @Tags User Account @Success 200 {object} types.OutputBasicUserInfo @Failure 429 {object} api.ApiError "rate limit exceeded" @Accept json @Produce json @Router /api/v1/user/me [get]
func (*UserProfileApi) UpdateUserProfile ¶
func (a *UserProfileApi) UpdateUserProfile(c *gin.Context)
Update logged in users profile @Security Bearer @Summary Update logged in users profile @Description Update logged in users profile @Tags User Account @Accept json @Produce json @Param input body types.UserProfile true "User Profile" @Success 200 {object} types.UserProfile @Failure 400 {object} api.ApiError "invalid input" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "failed to save user profile" @Router /api/v1/user/me [put]
type VC ¶
type VC struct {
// contains filtered or unexported fields
}
func NewVCApi ¶
func NewVCApi(ssiService *services.SelfSovereignService) *VC
new verifiable credential api
func (*VC) GetVC ¶
Get a verifiable credential by id @Security Bearer @Summary Get verifiable credential by id @Description Returns a single verifiable credential by id @Tags Verifiable Credentials @Param id path string true "VC ID" @Success 200 {object} did.VerifiableCredential @Failure 404 {object} api.ApiError "VC not found" @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "error creating server did" @Accept json @Produce json @Router /api/v1/credentials/{id} [get]
func (*VC) ListVCs ¶
List of VCs @Summary List all VCs for a specific mailio address @Description Retruns a list of VCs by mailio address @Tags Verifiable Credentials @Security Bearer @Param address path string true "Mailio address" @Param limit query int false "Limit of VCs to return" @Param pageToken query string false "Page token" @Success 200 {object} did.Document @Failure 429 {object} api.ApiError "rate limit exceeded" @Failure 500 {object} api.ApiError "error creating server did" @Accept json @Produce json @Router /api/v1/credentials/list/{address} [get]
func (*VC) VerifyVC ¶
Verify a verifiable credential @Security Bearer @Summary Verify a verifiable credential @Description Checks if signature is valid and returns a boolean object @Tags Verifiable Credentials @Param requestId path string true "Reference ID (request ID, could be anything)" @Param vc body did.VerifiableCredential true "Verifiable credential to verify" @Success 200 {object} types.VCValidationResponse @Failure 429 {object} api.ApiError "rate limit exceeded" @Accept json @Produce json @Router /api/v1/credentials/{requestId}/verify [post]
type WebAuthnApi ¶
type WebAuthnApi struct {
// contains filtered or unexported fields
}
func NewWebAuthnApi ¶
func NewWebAuthnApi(nonceService *services.NonceService, webAuthnService *services.WebAuthnService, userService *services.UserService, userProfileService *services.UserProfileService, smartKeyService *services.SmartKeyService, ssi *services.SelfSovereignService, env *types.Environment) *WebAuthnApi
func (*WebAuthnApi) LoginOptions ¶
func (a *WebAuthnApi) LoginOptions(c *gin.Context)
LoginOptions godoc @Summary LoginOptions return login options @Description LoginOptions return WebAuthN login options @Tags WebAuthn @Accept json @Produce json @Success 200 {object} protocol.PublicKeyCredentialRequestOptions @Failure 400 {object} api.ApiError "invalid input parameters" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/webauthn/login_options [get]
func (*WebAuthnApi) LoginVerify ¶
func (a *WebAuthnApi) LoginVerify(c *gin.Context)
LoginVerify godoc @Summary LoginOptions return login options @Description LoginOptions return WebAuthN login options @Tags WebAuthn @Accept json @Produce json @Param body body protocol.ParsedCredentialAssertionData true "Credential Assertion Data" @Success 200 {object} protocol.PublicKeyCredentialRequestOptions @Failure 400 {object} api.ApiError "invalid input parameters" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/webauthn/login_verify [post]
func (*WebAuthnApi) RegistrationOptions ¶
func (a *WebAuthnApi) RegistrationOptions(c *gin.Context)
WebAuthnRegister godoc @Summary Registration options for a new WebAuthn device @Description Registration options for a new WebAuthn device @Tags WebAuthn @Accept json @Produce json @Param email query string true "Email address to register" @Success 200 {object} protocol.PublicKeyCredentialCreationOptions @Failure 400 {object} api.ApiError "invalid email address" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/webauthn/registration_options [get]
func (*WebAuthnApi) VerifyRegistration ¶
func (a *WebAuthnApi) VerifyRegistration(c *gin.Context)
WebAuthnVerifyRegistration godoc @Summary WebAuthnVerifyRegistration check the validity of the registration @Description WebAuthnVerifyRegistration check the signed digital challenge @Tags WebAuthn @Accept json @Produce json @Param body body types.WebauthRegistrationVerify true "Attestation object + Encrypted SmartKey payload" @Success 200 {object} string "JWS" @Failure 400 {object} api.ApiError "invalid input parameters" @Failure 429 {object} api.ApiError "rate limit exceeded" @Router /api/v1/webauthn/registration_verify [post]
func (*WebAuthnApi) WebauthnUserHandler ¶
func (a *WebAuthnApi) WebauthnUserHandler(rawID, userHandle []byte) (webauthn.User, error)