davsclaus opened a new pull request, #3350:
URL: https://github.com/apache/camel-kamelets/pull/3350

   Follows the camel-smb fixes merged on Camel main for 4.24.0:
   
   - [CAMEL-27368](https://issues.apache.org/jira/browse/CAMEL-27368): `sortBy` 
takes `reverse:`, `ignoreCase:` and several orders separated by `;`, and `move` 
together with `delete` fails at startup.
   - [CAMEL-27361](https://issues.apache.org/jira/browse/CAMEL-27361): an 
optional `{{?x}}` placeholder in an endpoint path no longer drops the query 
options.
   - [CAMEL-27367](https://issues.apache.org/jira/browse/CAMEL-27367): a 
missing password logs in with an empty password.
   - [CAMEL-27369](https://issues.apache.org/jira/browse/CAMEL-27369): endpoint 
options for SMB encryption and timeouts.
   
   ## Changes to smb-source and smb-sink
   
   - `sortBy` (smb-source) is free text instead of an enum. It takes 
`reverse:`, `ignoreCase:` and `;` groups, such as 
`file:length;reverse:ignoreCase:file:name`.
   - The `move` description says the Kamelet fails to start when `delete` is 
true too. The original text had `: ` in a plain YAML scalar, which broke the 
catalog build; that is fixed here.
   - `directoryName` is optional. When it is not set, the Kamelet reads or 
writes at the top of the share. The template uses `path: "{{?directoryName}}"`, 
which works since CAMEL-27361. Before, the query options were lost.
   - `password` is optional. A `username` without a `password` logs in with an 
empty password. With `username: Guest`, that is a guest login on a share that 
allows guest access.
   - New `encryptData` option (default false). A share with `smb encrypt = 
required` refuses the connection without it.
   - New timeout options: smb-source gets `connectTimeout` and `readTimeout`; 
smb-sink gets `connectTimeout` and `writeTimeout`.
     - The sink only writes file content, so it gets `writeTimeout` and not 
`readTimeout`.
     - `transactTimeout` is left out: its default of 60 s for listing and 
renaming is fine for a Kamelet.
   - "Good to know" says that a `com.hierynomus.smbj.SmbConfig` bean in the 
application is used for the connection, and that the Kamelet then fails to 
start when `encryptData` is true or a timeout is set.
   
   ## Tests
   
   Local `SmbIT`: **3 tests, 3 passed** (dockurr/samba:4.23.10).
   
   - `smbServer.groovy` sets up the Samba container:
     - It turns on guest access: `map to guest = Bad User`, and `guest ok = 
yes` on the share.
     - It adds a share `secure` that requires encryption (`smb encrypt = 
required`).
     - It adds the files `0.txt`, `a.txt` and `B.txt` at the top of the share.
   - New `smb-source-guest-route` test:
     - It logs in as `Guest` with no password and no `directoryName`, and reads 
the top of the share.
     - It sorts with `file:length;reverse:ignoreCase:file:name` and gets 
`0.txt`, `B.txt`, `a.txt`. This covers `;`, `reverse:` and `ignoreCase:`: 
without `ignoreCase:` the order would be `a.txt`, `B.txt`.
     - The names in the headers have no leading `/`.
   - `smb-sink-route` test:
     - It writes `guest.csv` as a guest at the top of the share; 
`CamelFileNameProduced` is `guest.csv`.
     - It writes to the `secure` share: without `encryptData` the message fails 
with `STATUS_ACCESS_DENIED`, and with it the file is written.
     - It sets `connectTimeout` and `writeTimeout`.
   - `smb-source-route` test: it sets `encryptData: true` on a share that does 
not require encryption, plus `connectTimeout` and `readTimeout`.
   
   Checked by hand with `camel run` against a Samba container:
   
   - `move: .done` together with `delete: true`: `Failed to start route ... 
because: You cannot set both delete=true and move options`.
   - An `SmbConfig` bean (`factoryMethod: createDefaultConfig`):
     - With `encryptData: true` or with `connectTimeout`, the Kamelet fails to 
start with `The smbConfig option cannot be combined with the encryptData, 
connectTimeout, readTimeout, writeTimeout and transactTimeout options ...`.
     - Without them, the Kamelet starts.
   
   ## Upgrade note
   
   ```
   * `smb-source` and `smb-sink`: `directoryName` and `password` are optional 
(the top of the share; `username: Guest` with no password for guest access), 
there are new options `encryptData`, `connectTimeout` and `readTimeout` 
(source) or `writeTimeout` (sink), and `sortBy` of `smb-source` takes 
`reverse:`, `ignoreCase:` and `;` groups; `move` together with `delete` now 
fails at startup.
   ```
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to