forked from TrueCloudLab/frostfs-api-go
service: support broken apart signable payload of the requests
In previous implementation service package provided types and functions that wrapped signing/verification of data with session token. This allowed us to use these functions for signing / verification of service requests of other packages. To support the expansion of messages with additional parts that need to be signed, you must be able to easily expand the signed data with new parts. To achieve the described goal, this commit makes the following changes: * adds GroupSignedPayloads and GroupVerifyPayloads functions; * renames SignedDataWithToken to RequestData, DataWithTokenSignAccumulator to RequestSignedData, DataWithTokenSignSource to RequestVerifyData; * renames SignDataWithSessionToken/VerifyAccumulatedSignaturesWithToken function to SignRequestData/VerifyRequestData and makes it to use GroupSignedPayloads/GroupVerifyPayloads internally.
This commit is contained in:
parent
8dbd65132d
commit
74e917810a
12 changed files with 260 additions and 103 deletions
|
@ -36,14 +36,18 @@ const ErrEmptyDataWithSignature = internal.Error("empty data with signature")
|
|||
// negative length for slice allocation.
|
||||
const ErrNegativeLength = internal.Error("negative slice length")
|
||||
|
||||
// ErrNilDataWithTokenSignAccumulator is returned by functions that expect
|
||||
// a non-nil DataWithTokenSignAccumulator, but received nil.
|
||||
const ErrNilDataWithTokenSignAccumulator = internal.Error("signed data with token is nil")
|
||||
// ErrNilRequestSignedData is returned by functions that expect
|
||||
// a non-nil RequestSignedData, but received nil.
|
||||
const ErrNilRequestSignedData = internal.Error("request signed data is nil")
|
||||
|
||||
// ErrNilSignatureKeySourceWithToken is returned by functions that expect
|
||||
// a non-nil SignatureKeySourceWithToken, but received nil.
|
||||
const ErrNilSignatureKeySourceWithToken = internal.Error("key-signature source with token is nil")
|
||||
// ErrNilRequestVerifyData is returned by functions that expect
|
||||
// a non-nil RequestVerifyData, but received nil.
|
||||
const ErrNilRequestVerifyData = internal.Error("request verification data is nil")
|
||||
|
||||
// ErrNilSignedDataReader is returned by functions that expect
|
||||
// a non-nil SignedDataReader, but received nil.
|
||||
const ErrNilSignedDataReader = internal.Error("signed data reader is nil")
|
||||
|
||||
// ErrNilSignKeyPairAccumulator is returned by functions that expect
|
||||
// a non-nil SignKeyPairAccumulator, but received nil.
|
||||
const ErrNilSignKeyPairAccumulator = internal.Error("signature-key pair accumulator is nil")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue