Allow signature requests only on current published version

Requesting a signature only validated that the version was PUBLISHED, so a
signature could be requested on a superseded (older) published version. Reject
versions that are not the document's current published major/minor, and hide
the request button in the console for non-current versions.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
This commit is contained in:
Sacha Al Himdani
2026-06-22 18:30:26 +02:00
parent 9093be79f4
commit a8e8e3e0e7
4 changed files with 34 additions and 1 deletions

View File

@@ -2456,6 +2456,10 @@ func (r *Resolver) RequestDocumentVersionSignatureTool(ctx context.Context, req
},
)
if err != nil {
if _, ok := errors.AsType[*probo.ErrDocumentVersionNotCurrent](err); ok {
return nil, types.RequestDocumentVersionSignatureOutput{}, fmt.Errorf("cannot request signature: %w", err)
}
panic(fmt.Errorf("cannot request signature: %w", err))
}