Documentation
¶
Overview ¶
SPDX-License-Identifier: AGPL-3.0-or-later
Index ¶
- type CreateDocumentRequest
- type CreateDocumentResponse
- type DocumentDTO
- type FindOrCreateDocumentResponse
- type Handler
- func (h *Handler) HandleAddMyExpectedSigner(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleCreateDocument(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleDeleteMyDocument(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleFindOrCreateDocument(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleGetDocument(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleGetDocumentSignatures(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleGetExpectedSigners(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleGetMyDocumentStatus(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleListDocuments(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleListMyDocuments(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleRemoveMyExpectedSigner(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleUpdateMyDocumentMetadata(w http.ResponseWriter, r *http.Request)
- func (h *Handler) WithAdminService(adminService adminService, baseURL string) *Handler
- type MyDocumentDTO
- type PublicExpectedSigner
- type ReferenceType
- type SignatureDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateDocumentRequest ¶
type CreateDocumentRequest struct {
Reference string `json:"reference"`
Title string `json:"title,omitempty"`
}
CreateDocumentRequest represents the request body for creating a document
type CreateDocumentResponse ¶
type CreateDocumentResponse struct {
DocID string `json:"docId"`
URL string `json:"url,omitempty"`
Title string `json:"title"`
CreatedAt string `json:"createdAt"`
}
CreateDocumentResponse represents the response for creating a document
type DocumentDTO ¶
type DocumentDTO struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
SignatureCount int `json:"signatureCount"`
ExpectedSignerCount int `json:"expectedSignerCount"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
DocumentDTO represents a document data transfer object
type FindOrCreateDocumentResponse ¶
type FindOrCreateDocumentResponse struct {
DocID string `json:"docId"`
URL string `json:"url,omitempty"`
Title string `json:"title"`
Checksum string `json:"checksum,omitempty"`
ChecksumAlgorithm string `json:"checksumAlgorithm,omitempty"`
Description string `json:"description,omitempty"`
ReadMode string `json:"readMode"`
AllowDownload bool `json:"allowDownload"`
RequireFullRead bool `json:"requireFullRead"`
VerifyChecksum bool `json:"verifyChecksum"`
CreatedAt string `json:"createdAt"`
IsNew bool `json:"isNew"`
SignatureCount int `json:"signatureCount"`
// Storage fields for uploaded documents
StorageKey string `json:"storageKey,omitempty"`
MimeType string `json:"mimeType,omitempty"`
}
FindOrCreateDocumentResponse represents the response for finding or creating a document
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles document API requests
func NewHandler ¶
func NewHandler( signatureService signatureService, documentService documentService, publisher webhookPublisher, authorizer providers.Authorizer, ) *Handler
NewHandler creates a handler with all dependencies for full functionality
func (*Handler) HandleAddMyExpectedSigner ¶ added in v1.3.2
func (h *Handler) HandleAddMyExpectedSigner(w http.ResponseWriter, r *http.Request)
HandleAddMyExpectedSigner handles POST /api/v1/users/me/documents/{docId}/signers
func (*Handler) HandleCreateDocument ¶
func (h *Handler) HandleCreateDocument(w http.ResponseWriter, r *http.Request)
HandleCreateDocument handles POST /api/v1/documents
func (*Handler) HandleDeleteMyDocument ¶ added in v1.3.2
func (h *Handler) HandleDeleteMyDocument(w http.ResponseWriter, r *http.Request)
HandleDeleteMyDocument handles DELETE /api/v1/users/me/documents/{docId}
func (*Handler) HandleFindOrCreateDocument ¶
func (h *Handler) HandleFindOrCreateDocument(w http.ResponseWriter, r *http.Request)
HandleFindOrCreateDocument handles GET /api/v1/documents/find-or-create?doc={reference}
func (*Handler) HandleGetDocument ¶
func (h *Handler) HandleGetDocument(w http.ResponseWriter, r *http.Request)
HandleGetDocument handles GET /api/v1/documents/{docId}
func (*Handler) HandleGetDocumentSignatures ¶
func (h *Handler) HandleGetDocumentSignatures(w http.ResponseWriter, r *http.Request)
HandleGetDocumentSignatures handles GET /api/v1/documents/{docId}/signatures Returns the detailed signature list only for document owner or admin. For authenticated users who are not owner/admin, returns only their own signature (if they signed). Non-authenticated users receive an empty list (the count remains available via DocumentDTO).
func (*Handler) HandleGetExpectedSigners ¶
func (h *Handler) HandleGetExpectedSigners(w http.ResponseWriter, r *http.Request)
HandleGetExpectedSigners handles GET /api/v1/documents/{docId}/expected-signers Returns the expected signers list only for document owner or admin. Non-authorized users receive an empty list.
func (*Handler) HandleGetMyDocumentStatus ¶ added in v1.3.2
func (h *Handler) HandleGetMyDocumentStatus(w http.ResponseWriter, r *http.Request)
HandleGetMyDocumentStatus handles GET /api/v1/users/me/documents/{docId}/status
func (*Handler) HandleListDocuments ¶
func (h *Handler) HandleListDocuments(w http.ResponseWriter, r *http.Request)
HandleListDocuments handles GET /api/v1/documents
func (*Handler) HandleListMyDocuments ¶ added in v1.3.0
func (h *Handler) HandleListMyDocuments(w http.ResponseWriter, r *http.Request)
HandleListMyDocuments handles GET /api/v1/users/me/documents Returns documents created by the current authenticated user
func (*Handler) HandleRemoveMyExpectedSigner ¶ added in v1.3.2
func (h *Handler) HandleRemoveMyExpectedSigner(w http.ResponseWriter, r *http.Request)
HandleRemoveMyExpectedSigner handles DELETE /api/v1/users/me/documents/{docId}/signers/{email}
func (*Handler) HandleUpdateMyDocumentMetadata ¶ added in v1.3.2
func (h *Handler) HandleUpdateMyDocumentMetadata(w http.ResponseWriter, r *http.Request)
HandleUpdateMyDocumentMetadata handles PUT /api/v1/users/me/documents/{docId}/metadata
func (*Handler) WithAdminService ¶ added in v1.3.2
WithAdminService sets the admin service for owner-based document management.
type MyDocumentDTO ¶ added in v1.3.0
type MyDocumentDTO struct {
ID string `json:"id"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
Description string `json:"description"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
SignatureCount int `json:"signatureCount"`
ExpectedSignerCount int `json:"expectedSignerCount"`
}
MyDocumentDTO represents a document with stats for the current user's documents list
type PublicExpectedSigner ¶ added in v1.2.3
PublicExpectedSigner represents an expected signer in public API (minimal info)
type ReferenceType ¶
type ReferenceType string
type SignatureDTO ¶
type SignatureDTO struct {
ID string `json:"id"`
DocID string `json:"docId"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName,omitempty"`
SignedAt string `json:"signedAt"`
Signature string `json:"signature"`
PayloadHash string `json:"payloadHash"`
Nonce string `json:"nonce"`
PrevHash string `json:"prevHash,omitempty"`
}
SignatureDTO represents a signature data transfer object