Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions ci/harness.compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,33 @@ services:
# Merged into whichever configuration is being run, so every stack seeds the same
# admin password instead of generating a random one the harness cannot know.
oie:
depends_on:
s3:
condition: service_healthy
environment:
_MP_SERVER_INITIALADMINPASSWORD: ${OIE_ADMIN_PASSWORD}
AWS_ENDPOINT_URL_S3: http://s3:9000
AWS_ACCESS_KEY_ID: oie-smoke
AWS_SECRET_ACCESS_KEY: oie-smoke-secret

# RustFS stands in for S3. The SDK puts the bucket in the host name, so it answers to
# <bucket>.s3 too. The healthcheck creates the bucket; repeating that is harmless.
s3:
image: rustfs/rustfs:1.0.3@sha256:9ca9559533b537d10482fe923288b676ad08f92a7069d9a17327fbae3cab688b
environment:
RUSTFS_ACCESS_KEY: oie-smoke
RUSTFS_SECRET_KEY: oie-smoke-secret
RUSTFS_SERVER_DOMAINS: s3:9000
networks:
default:
aliases:
- oie-smoke.s3
healthcheck:
test: curl -fsS --aws-sigv4 aws:amz:us-east-1:s3 --user oie-smoke:oie-smoke-secret -X PUT http://s3:9000/oie-smoke
interval: 3s
timeout: 5s
retries: 15
start_period: 5s

harness:
image: oie-ci-harness:local
Expand Down
290 changes: 290 additions & 0 deletions ci/tests/140-s3-file-writer/channels/01-s3-file-writer/channel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
<channel version="4.7.0">
<id>b7c1f2a4-5d0e-4c36-9a8b-2f6e1d7c4059</id>
<nextMetaDataId>3</nextMetaDataId>
<name>S3 File Writer</name>
<description>03-own-credentials needs both Use Default Credential Provider Chain and the username and password. With the chain off, it passes even without the fix in #512.</description>
<revision>1</revision>
<sourceConnector version="4.7.0">
<metaDataId>0</metaDataId>
<name>sourceConnector</name>
<properties class="com.mirth.connect.connectors.vm.VmReceiverProperties" version="4.7.0">
<pluginProperties/>
<sourceConnectorProperties version="4.7.0">
<responseVariable>None</responseVariable>
<respondAfterProcessing>true</respondAfterProcessing>
<processBatch>false</processBatch>
<firstResponse>false</firstResponse>
<processingThreads>1</processingThreads>
<resourceIds class="linked-hash-map">
<entry>
<string>Default Resource</string>
<string>[Default Resource]</string>
</entry>
</resourceIds>
<queueBufferSize>1000</queueBufferSize>
</sourceConnectorProperties>
</properties>
<transformer version="4.7.0">
<elements/>
<inboundDataType>RAW</inboundDataType>
<outboundDataType>RAW</outboundDataType>
<inboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</inboundProperties>
<outboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</outboundProperties>
</transformer>
<filter version="4.7.0">
<elements/>
</filter>
<transportName>Channel Reader</transportName>
<mode>SOURCE</mode>
<enabled>true</enabled>
<waitForPrevious>true</waitForPrevious>
</sourceConnector>
<destinationConnectors>
<connector version="4.7.0">
<metaDataId>1</metaDataId>
<name>Write object</name>
<properties class="com.mirth.connect.connectors.file.FileDispatcherProperties" version="4.7.0">
<pluginProperties/>
<destinationConnectorProperties version="4.7.0">
<queueEnabled>false</queueEnabled>
<sendFirst>false</sendFirst>
<retryIntervalMillis>10000</retryIntervalMillis>
<regenerateTemplate>false</regenerateTemplate>
<retryCount>0</retryCount>
<rotate>false</rotate>
<includeFilterTransformer>false</includeFilterTransformer>
<threadCount>1</threadCount>
<threadAssignmentVariable></threadAssignmentVariable>
<validateResponse>false</validateResponse>
<resourceIds class="linked-hash-map">
<entry>
<string>Default Resource</string>
<string>[Default Resource]</string>
</entry>
</resourceIds>
<queueBufferSize>1000</queueBufferSize>
<reattachAttachments>true</reattachAttachments>
</destinationConnectorProperties>
<scheme>S3</scheme>
<schemeProperties class="com.mirth.connect.connectors.file.S3SchemeProperties">
<useDefaultCredentialProviderChain>true</useDefaultCredentialProviderChain>
<useTemporaryCredentials>false</useTemporaryCredentials>
<duration>7200</duration>
<region>us-east-1</region>
<customHeaders class="linked-hash-map">
<entry>
<string>x-amz-meta-clinic</string>
<list>
<string>${clinic}</string>
</list>
</entry>
</customHeaders>
</schemeProperties>
<host>oie-smoke</host>
<outputPattern>${message.messageId}.txt</outputPattern>
<anonymous>false</anonymous>
<username>oie-smoke</username>
<password>${secretKey}</password>
<timeout>10000</timeout>
<keepConnectionOpen>true</keepConnectionOpen>
<maxIdleTime>0</maxIdleTime>
<secure>true</secure>
<passive>true</passive>
<validateConnection>true</validateConnection>
<outputAppend>false</outputAppend>
<errorOnExists>false</errorOnExists>
<temporary>false</temporary>
<binary>false</binary>
<charsetEncoding>DEFAULT_ENCODING</charsetEncoding>
<template>${message.encodedData}</template>
</properties>
<transformer version="4.7.0">
<elements/>
<inboundDataType>RAW</inboundDataType>
<outboundDataType>RAW</outboundDataType>
<inboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</inboundProperties>
<outboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</outboundProperties>
</transformer>
<responseTransformer version="4.7.0">
<elements/>
<inboundDataType>RAW</inboundDataType>
<outboundDataType>RAW</outboundDataType>
<inboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</inboundProperties>
<outboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</outboundProperties>
</responseTransformer>
<filter version="4.7.0">
<elements/>
</filter>
<transportName>File Writer</transportName>
<mode>DESTINATION</mode>
<enabled>true</enabled>
<waitForPrevious>true</waitForPrevious>
</connector>
<connector version="4.7.0">
<metaDataId>2</metaDataId>
<name>Read metadata</name>
<properties class="com.mirth.connect.connectors.js.JavaScriptDispatcherProperties" version="4.7.0">
<pluginProperties/>
<destinationConnectorProperties version="4.7.0">
<queueEnabled>false</queueEnabled>
<sendFirst>false</sendFirst>
<retryIntervalMillis>10000</retryIntervalMillis>
<regenerateTemplate>false</regenerateTemplate>
<retryCount>0</retryCount>
<rotate>false</rotate>
<includeFilterTransformer>false</includeFilterTransformer>
<threadCount>1</threadCount>
<threadAssignmentVariable></threadAssignmentVariable>
<validateResponse>false</validateResponse>
<resourceIds class="linked-hash-map">
<entry>
<string>Default Resource</string>
<string>[Default Resource]</string>
</entry>
</resourceIds>
<queueBufferSize>1000</queueBufferSize>
<reattachAttachments>true</reattachAttachments>
</destinationConnectorProperties>
<script>// Return the custom metadata of the object the File Writer stored
var s3 = Packages.software.amazon.awssdk.services.s3;
var client = s3.S3Client.builder().region(Packages.software.amazon.awssdk.regions.Region.US_EAST_1).build();
try {
var request = s3.model.HeadObjectRequest.builder().bucket(&apos;oie-smoke&apos;).key(connectorMessage.getMessageId() + &apos;.txt&apos;).build();
return String(client.headObject(request).metadata());
} finally {
client.close();
}</script>
</properties>
<transformer version="4.7.0">
<elements/>
<inboundDataType>RAW</inboundDataType>
<outboundDataType>RAW</outboundDataType>
<inboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</inboundProperties>
<outboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</outboundProperties>
</transformer>
<responseTransformer version="4.7.0">
<elements/>
<inboundDataType>RAW</inboundDataType>
<outboundDataType>RAW</outboundDataType>
<inboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</inboundProperties>
<outboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="4.7.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="4.7.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</outboundProperties>
</responseTransformer>
<filter version="4.7.0">
<elements/>
</filter>
<transportName>JavaScript Writer</transportName>
<mode>DESTINATION</mode>
<enabled>true</enabled>
<waitForPrevious>true</waitForPrevious>
</connector>
</destinationConnectors>
<preprocessingScript>// Modify the message variable below to pre process data
return message;</preprocessingScript>
<postprocessingScript>// This script executes once after a message has been processed
// Responses returned from here will be stored as &quot;Postprocessor&quot; in the response map
return;</postprocessingScript>
<deployScript>// This script executes once when the channel is deployed
// You only have access to the globalMap and globalChannelMap here to persist data
return;</deployScript>
<undeployScript>// This script executes once when the channel is undeployed
// You only have access to the globalMap and globalChannelMap here to persist data
return;</undeployScript>
<properties version="4.7.0">
<clearGlobalChannelMap>true</clearGlobalChannelMap>
<messageStorageMode>DEVELOPMENT</messageStorageMode>
<encryptData>false</encryptData>
<encryptAttachments>false</encryptAttachments>
<encryptCustomMetaData>false</encryptCustomMetaData>
<removeContentOnCompletion>false</removeContentOnCompletion>
<removeOnlyFilteredOnCompletion>false</removeOnlyFilteredOnCompletion>
<removeAttachmentsOnCompletion>false</removeAttachmentsOnCompletion>
<initialState>STARTED</initialState>
<storeAttachments>true</storeAttachments>
<metaDataColumns>
<metaDataColumn>
<name>SOURCE</name>
<type>STRING</type>
<mappingName>mirth_source</mappingName>
</metaDataColumn>
<metaDataColumn>
<name>TYPE</name>
<type>STRING</type>
<mappingName>mirth_type</mappingName>
</metaDataColumn>
</metaDataColumns>
<attachmentProperties version="4.7.0">
<type>None</type>
<properties/>
</attachmentProperties>
<resourceIds class="linked-hash-map">
<entry>
<string>Default Resource</string>
<string>[Default Resource]</string>
</entry>
</resourceIds>
</properties>
<exportData>
<metadata>
<enabled>true</enabled>
<lastModified>
<time>1775955953073</time>
<timezone>America/Chicago</timezone>
</lastModified>
<pruningSettings>
<archiveEnabled>true</archiveEnabled>
<pruneErroredMessages>false</pruneErroredMessages>
</pruningSettings>
<userId>1</userId>
</metadata>
</exportData>
</channel>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{clinic=A}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
clinic: A
secretKey: oie-smoke-secret
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{clinic=B}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
clinic: B
secretKey: oie-smoke-secret
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ERROR
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
clinic: C
secretKey: wrong-secret
Loading