Add UploadAttestationOccurrence() method in metadata client interface and all its implementations.
A helper method CreateOccurrenceFromAttestation() and its tests are added in the process to deduplicate code.
The existing CreateAttestationOccurrence() will now use UploadAttestationOccurrence() to upload attestation after creating it. In the long term, we consider deleting CreateAttestationOccurrence() altogether because attestation creation should be the caller's responsibility instead of the metadata client.
UploadAttestationOccurrence() also supports both GenericSignedAttestation and PgpSignedAttestation, while CreateAttestationOccurrence() only supports the latter.
Testing for UploadAttestationOccurrence() is covered by existing CreateAttestationOccurrence() tests, because CreateAttestationOccurrence() is the only caller of UploadAttestationOccurrence() as for now.
Add
UploadAttestationOccurrence()
method in metadata client interface and all its implementations.A helper method
CreateOccurrenceFromAttestation()
and its tests are added in the process to deduplicate code.The existing
CreateAttestationOccurrence()
will now useUploadAttestationOccurrence()
to upload attestation after creating it. In the long term, we consider deletingCreateAttestationOccurrence()
altogether because attestation creation should be the caller's responsibility instead of the metadata client.UploadAttestationOccurrence()
also supports bothGenericSignedAttestation
andPgpSignedAttestation
, whileCreateAttestationOccurrence()
only supports the latter.Testing for
UploadAttestationOccurrence()
is covered by existingCreateAttestationOccurrence()
tests, becauseCreateAttestationOccurrence()
is the only caller ofUploadAttestationOccurrence()
as for now.