Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DT-898 Defaulting to binary HTTP body payloads #66

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

gj0dcsa
Copy link
Collaborator

@gj0dcsa gj0dcsa commented Feb 8, 2024

No description provided.

@gj0dcsa gj0dcsa requested a review from nt-gt February 8, 2024 09:41
public ConformanceMessageBody(byte[] byteArrayBody) {
this.isRawByteArray = true;
this.byteArrayBody = byteArrayBody == null ? new byte[0] : byteArrayBody;
this.stringBody = new String(this.byteArrayBody, StandardCharsets.UTF_8);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work if the content is not valid UTF-8 (which is likely for the use-cases that need raw byte transfers)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my understanding, we're not allowed to change things like indentation or newline type, but the content type of these messages must remain UTF-8 even when they use JWS/JWE -- in fact the latter elements are Base64-encoded as ASCII, which is a subset of UTF-8.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I specifically need support for https://app.swaggerhub.com/apis/dcsaorg/DCSA_EBL_PINT/3.0.0-Beta-1#/Transfer%20additional%20document/put_v3_envelopes__envelopeReference__additional_documents__documentChecksum_, which is about transferring additional documentation.

Said documentation can be any file including but not limited to PDF and will be transferred in the application/octet-stream stream. The validation will need to assert this stream matches the expected checksum, which is why we need binary transfers. However, there is no rule stating that the content will be a valid UTF-8 byte sequence. In fact, for a PDF, a zip file, scanned images, it will very likely not be valid UTF-8.

@gj0dcsa gj0dcsa marked this pull request as draft February 12, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants