Skip to content

Commit

Permalink
Fixed platfoprm-http and axs2
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriOndrusek committed Aug 16, 2024
1 parent 5814b23 commit 121aa03
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ public Map<String, Object> collectHeaders() {
if (getMessageStructure() != null) {
retVal.put(getMessageStructureKey(), getMessageStructure());
}
retVal.put("CamelAS2.ediMessageContentType",
retVal.put("CamelAs2.ediMessageContentType",
ContentType.create(AS2MediaType.APPLICATION_EDIFACT, StandardCharsets.US_ASCII.name()));
if (getEncryptionAlgorithm() != null) {
retVal.put("CamelAS2.encryptingCertificateChain", As2CertificateHelper.getCertList());
retVal.put("CamelAS2.encryptingAlgorithm", getEncryptionAlgorithm());
retVal.put("CamelAs2.encryptingCertificateChain", As2CertificateHelper.getCertList());
retVal.put("CamelAs2.encryptingAlgorithm", getEncryptionAlgorithm());
}
if (getSigningAlgorithm() != null) {
// parameter type is java.security.cert.Certificate[]
retVal.put("CamelAS2.signingCertificateChain", As2CertificateHelper.getCertList().toArray(new Certificate[0]));
retVal.put("CamelAs2.signingCertificateChain", As2CertificateHelper.getCertList().toArray(new Certificate[0]));
// parameter type is java.security.PrivateKey
retVal.put("CamelAS2.signingPrivateKey", As2CertificateHelper.getSigningKP().getPrivate());
retVal.put("CamelAs2.signingPrivateKey", As2CertificateHelper.getSigningKP().getPrivate());
// parameter type is org.apache.camel.component.as2.api.AS2SignatureAlgorithm
retVal.put("CamelAS2.signingAlgorithm", getSigningAlgorithm());
retVal.put("CamelAs2.signingAlgorithm", getSigningAlgorithm());
}
return retVal;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static Request createEncryptedRequest() {
public static Request createMultipartSignedRequest() {
final Map<String, Object> headers = createBaseHeaders(AS2MessageStructure.SIGNED);
// parameter type is String[]
headers.put("CamelAS2.signedReceiptMicAlgorithms", SIGNED_RECEIPT_MIC_ALGORITHMS);
headers.put("CamelAs2.signedReceiptMicAlgorithms", SIGNED_RECEIPT_MIC_ALGORITHMS);

return new Request()
.withHeaders(headers)
Expand All @@ -99,24 +99,24 @@ public static Request createMultipartSignedRequest() {
private static Map<String, Object> createBaseHeaders(AS2MessageStructure plain) {
final Map<String, Object> headers = new HashMap<>();
// parameter type is String
headers.put("CamelAS2.requestUri", REQUEST_URI);
headers.put("CamelAs2.requestUri", REQUEST_URI);
// parameter type is String
headers.put("CamelAS2.subject", SUBJECT);
headers.put("CamelAs2.subject", SUBJECT);
// parameter type is String
headers.put("CamelAS2.from", FROM);
headers.put("CamelAs2.from", FROM);
// parameter type is String
headers.put("CamelAS2.as2From", AS2_NAME);
headers.put("CamelAs2.as2From", AS2_NAME);
// parameter type is String
headers.put("CamelAS2.as2To", AS2_NAME);
headers.put("CamelAs2.as2To", AS2_NAME);
// parameter type is org.apache.camel.component.as2.api.AS2MessageStructure
headers.put("CamelAS2.as2MessageStructure", plain);
headers.put("CamelAs2.as2MessageStructure", plain);
// parameter type is org.apache.http.entity.ContentType
headers.put("CamelAS2.ediMessageContentType",
headers.put("CamelAs2.ediMessageContentType",
ContentType.create(AS2MediaType.APPLICATION_EDIFACT, StandardCharsets.US_ASCII.name()));
// parameter type is String
headers.put("CamelAS2.ediMessageTransferEncoding", EDI_MESSAGE_CONTENT_TRANSFER_ENCODING);
headers.put("CamelAs2.ediMessageTransferEncoding", EDI_MESSAGE_CONTENT_TRANSFER_ENCODING);
// parameter type is String
headers.put("CamelAS2.dispositionNotificationTo", DISPOSITION_NOTIFICATION_TO);
headers.put("CamelAs2.dispositionNotificationTo", DISPOSITION_NOTIFICATION_TO);
return headers;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void configure() {
.transform(body().prepend("Hello "));

// Basic auth security tests
from("platform-http:/platform-http/secure/basic")
from("platform-http:/platform-http/secure/basic?returnHttpRequestHeaders=true")
.process(exchange -> {
Message message = exchange.getMessage();
QuarkusHttpUser user = message.getHeader(VertxPlatformHttpConstants.AUTHENTICATED_USER,
Expand Down

0 comments on commit 121aa03

Please sign in to comment.