bcgov / common-object-management-service

A microservice for managing access control to S3 Objects
https://bcgov.github.io/common-object-management-service/
Apache License 2.0
6 stars 9 forks source link

Metadata documenation does not mention implemented limits on key and value lengths #119

Closed pbolduc closed 1 year ago

pbolduc commented 1 year ago

The metadata wiki page uses the same wording as the AWS: Working with object metadata documenation. This documenation only calls out that:

the user-defined metadata is limited to 2 KB in size. The size of user-defined metadata is measured by taking the sum of the number of bytes in the UTF-8 encoding of each key and value.

The database implementation puts a limit of 255 for each the key and value. These limits do seem reasonable for the kind of service COMS is used for. It would be good to ensure the documenation reflects this design point. You may want to consider increasing the value length to match the tag value length for consistency.

This issue does not impact our use of COMS.

jujaga commented 1 year ago

Thanks for the discrepancy catch. I've added a maximum length annotation to the OpenAPI spec discussing the x-amz-meta-* header so that it expects a maximum length value of 255 to align with database implementation. This will appear in the v0.4.0 COMS release.