signatures

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 7 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateSignatureRequest

type CreateSignatureRequest struct {
	DocID   string  `json:"docId"`
	Referer *string `json:"referer,omitempty"`
}

CreateSignatureRequest represents the request body for creating a signature

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles signature-related requests

func NewHandler

func NewHandler(signatureService signatureService) *Handler

NewHandler creates a new signature handler Backward-compatible base constructor

func NewHandlerWithDeps

func NewHandlerWithDeps(signatureService signatureService, expectedRepo expectedSignerStatsRepo, publisher webhookPublisher) *Handler

Extended constructor to inject expected signers repo and webhook publisher

func (*Handler) HandleCreateSignature

func (h *Handler) HandleCreateSignature(w http.ResponseWriter, r *http.Request)

HandleCreateSignature handles POST /api/v1/signatures

func (*Handler) HandleGetDocumentSignatures

func (h *Handler) HandleGetDocumentSignatures(w http.ResponseWriter, r *http.Request)

HandleGetDocumentSignatures handles GET /api/v1/documents/{docId}/signatures

func (*Handler) HandleGetSignatureStatus

func (h *Handler) HandleGetSignatureStatus(w http.ResponseWriter, r *http.Request)

HandleGetSignatureStatus handles GET /api/v1/documents/{docId}/signatures/status

func (*Handler) HandleGetUserSignatures

func (h *Handler) HandleGetUserSignatures(w http.ResponseWriter, r *http.Request)

HandleGetUserSignatures handles GET /api/v1/signatures

type ServiceInfoResult

type ServiceInfoResult struct {
	Name     string `json:"name"`
	Icon     string `json:"icon"`
	Type     string `json:"type"`
	Referrer string `json:"referrer"`
}

ServiceInfoResult represents service detection information

type SignatureResponse

type SignatureResponse struct {
	ID           int64              `json:"id"`
	DocID        string             `json:"docId"`
	UserSub      string             `json:"userSub"`
	UserEmail    string             `json:"userEmail"`
	UserName     string             `json:"userName,omitempty"`
	SignedAt     string             `json:"signedAt"`
	PayloadHash  string             `json:"payloadHash"`
	Signature    string             `json:"signature"`
	Nonce        string             `json:"nonce"`
	CreatedAt    string             `json:"createdAt"`
	Referer      *string            `json:"referer,omitempty"`
	PrevHash     *string            `json:"prevHash,omitempty"`
	ServiceInfo  *ServiceInfoResult `json:"serviceInfo,omitempty"`
	DocDeletedAt *string            `json:"docDeletedAt,omitempty"`
	// Document metadata
	DocTitle *string `json:"docTitle,omitempty"`
	DocUrl   *string `json:"docUrl,omitempty"`
}

SignatureResponse represents a signature in API responses

type SignatureStatusResponse

type SignatureStatusResponse struct {
	DocID     string  `json:"docId"`
	UserEmail string  `json:"userEmail"`
	IsSigned  bool    `json:"isSigned"`
	SignedAt  *string `json:"signedAt,omitempty"`
}

SignatureStatusResponse represents the signature status for a document

Jump to

Keyboard shortcuts

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