Repository: redpanda-data/rp-connect-docs
Pull request #219: DOC-1233 Add private_key field to SFTP input and output
Author: login: asimms41
Created: 2025-04-14T14:30:19Z | Merged: 2025-04-15T13:13:11Z

## Description

Resolves [DOC-1233](https://redpandadata.atlassian.net/browse/DOC-1233)
Review deadline: 14th April

This pull request includes updates to the SFTP input and output documentation to improve clarity and provide additional details on configuration fields.

### Documentation Improvements:

* [`modules/components/pages/inputs/sftp.adoc`](diffhunk://#diff-756b688eae27f6173648729c5612ea14546edb32611c88f9732977fa3431dcd0L26-R36): Updated descriptions for configuration fields, including specifying that certain fields like `username`, `password`, `private_key_file`, `private_key`, and `private_key_pass` are optional and have no defaults. Enhanced descriptions for `address` and `credentials` fields to provide more clarity. [[1]](diffhunk://#diff-756b688eae27f6173648729c5612ea14546edb32611c88f9732977fa3431dcd0L26-R36) [[2]](diffhunk://#diff-756b688eae27f6173648729c5612ea14546edb32611c88f9732977fa3431dcd0L44-R45) [[3]](diffhunk://#diff-756b688eae27f6173648729c5612ea14546edb32611c88f9732977fa3431dcd0L53-R64) [[4]](diffhunk://#diff-756b688eae27f6173648729c5612ea14546edb32611c88f9732977fa3431dcd0L72-R74) [[5]](diffhunk://#diff-756b688eae27f6173648729c5612ea14546edb32611c88f9732977fa3431dcd0L90-R107) [[6]](diffhunk://#diff-756b688eae27f6173648729c5612ea14546edb32611c88f9732977fa3431dcd0L115-L140) [[7]](diffhunk://#diff-756b688eae27f6173648729c5612ea14546edb32611c88f9732977fa3431dcd0L149)

* [`modules/components/pages/outputs/sftp.adoc`](diffhunk://#diff-39c20a6044cd2201969a2d1d1a77b5daf4e69c330bd0f16d7304fd42e9a0e5f8L20-R32): Similar updates as the inputs documentation, including specifying that certain fields are optional and have no defaults, and providing more detailed descriptions for `address`, `credentials`, and related fields. [[1]](diffhunk://#diff-39c20a6044cd2201969a2d1d1a77b5daf4e69c330bd0f16d7304fd42e9a0e5f8L20-R32) [[2]](diffhunk://#diff-39c20a6044cd2201969a2d1d1a77b5daf4e69c330bd0f16d7304fd42e9a0e5f8L45-R52) [[3]](diffhunk://#diff-39c20a6044cd2201969a2d1d1a77b5daf4e69c330bd0f16d7304fd42e9a0e5f8L95-R100) [[4]](diffhunk://#diff-39c20a6044cd2201969a2d1d1a77b5daf4e69c330bd0f16d7304fd42e9a0e5f8L112-R138)

## Page previews

[`sftp` input](https://deploy-preview-219--redpanda-connect.netlify.app/redpanda-connect/components/inputs/sftp/)
[`sftp` output](https://deploy-preview-219--redpanda-connect.netlify.app/redpanda-connect/components/outputs/sftp/)

## Checks

- [ ] New feature
- [x] Content gap
- [ ] Support Follow-up
- [ ] Small fix (typos, links, copyedits, etc)

[DOC-1233]: https://redpandadata.atlassian.net/browse/DOC-1233?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


Diff:
diff --git a/modules/components/pages/inputs/sftp.adoc b/modules/components/pages/inputs/sftp.adoc
index d99741b5..f5195ec1 100644
--- a/modules/components/pages/inputs/sftp.adoc
+++ b/modules/components/pages/inputs/sftp.adoc
@@ -23,16 +23,17 @@ Common::
 --
 
 ```yml
-# Common config fields, showing default values
+# Common configuration fields, showing default values
 input:
   label: ""
   sftp:
     address: "" # No default (required)
     credentials:
-      username: ""
-      password: ""
-      private_key_file: ""
-      private_key_pass: ""
+      username: "" # No default (optional)
+      password: "" # No default (optional)
+      private_key_file: "" # No default (optional)
+      private_key: "" # No default (optional)
+      private_key_pass: "" # No default (optional)
     paths: [] # No default (required)
     auto_replay_nacks: true
     scanner:
@@ -41,7 +42,7 @@ input:
       enabled: false
       minimum_age: 1s
       poll_interval: 1s
-      cache: ""
+      cache: "" # No default (optional)
 ```
 
 --
@@ -50,16 +51,17 @@ Advanced::
 --
 
 ```yml
-# All config fields, showing default values
+# All configuration fields, showing default values
 input:
   label: ""
   sftp:
     address: "" # No default (required)
     credentials:
-      username: ""
-      password: ""
-      private_key_file: ""
-      private_key_pass: ""
+      username: "" # No default (optional)
+      password: "" # No default (optional)
+      private_key_file: "" # No default (optional)
+      private_key: "" # No default (optional)
+      private_key_pass: "" # No default (optional)
     paths: [] # No default (required)
     auto_replay_nacks: true
     scanner:
@@ -69,7 +71,7 @@ input:
       enabled: false
       minimum_age: 1s
       poll_interval: 1s
-      cache: ""
+      cache: "" # No default (optional)
 ```
 
 --
@@ -87,15 +89,14 @@ You can access these metadata fields using xref:configuration:interpolation.adoc
 
 === `address`
 
-The address of the server to connect to.
-
+The address (hostname or IP address) of the SFTP server to connect to. 
 
 *Type*: `string`
 
 
 === `credentials`
 
-The credentials to use to log into the target server.
+The credentials required to log in to the SFTP server. This can include a username and password, or a private key for secure access.
 
 
 *Type*: `object`
@@ -103,7 +104,7 @@ The credentials to use to log into the target server.
 
 === `credentials.username`
 
-The username to connect to the SFTP server.
+The username required to authenticate with the SFTP server.
 
 
 *Type*: `string`
@@ -112,20 +113,28 @@ The username to connect to the SFTP server.
 
 === `credentials.password`
 
-The password for the username to connect to the SFTP server.
+The password for the username used to authenticate with the SFTP server.
 
 include::components:partial$secret_warning.adoc[]
 
 
-
 *Type*: `string`
 
 *Default*: `""`
 
 === `credentials.private_key_file`
 
-The private key for the username to connect to the SFTP server.
+The path to a private key file used to authenticate with the SFTP server. You can also provide a private key using the <<credentials-private_key,`private_key`>> field.
+
+*Type*: `string`
+
+*Default*: `""`
 
+=== `credentials.private_key`
+
+The private key used to authenticate with the SFTP server. This field provides an alternative to the <<credentials-private_key_file, `private_key_file`>>.
+
+include::components:partial$secret_warning.adoc[]
 
 *Type*: `string`
 
@@ -133,11 +142,10 @@ The private key for the username to connect to the SFTP server.
 
 === `credentials.private_key_pass`
 
-Optional passphrase for private key.
+A passphrase for the private key.
 
 include::components:partial$secret_warning.adoc[]
 
-
 *Type*: `string`
 
 *Default*: `""`
@@ -146,7 +154,6 @@ include::components:partial$secret_warning.adoc[]
 
 A list of paths to consume sequentially. Glob patterns are supported.
 
-
 *Type*: `array`
 
 
diff --git a/modules/components/pages/outputs/sftp.adoc b/modules/components/pages/outputs/sftp.adoc
index cfae6702..674d76f8 100644
--- a/modules/components/pages/outputs/sftp.adoc
+++ b/modules/components/pages/outputs/sftp.adoc
@@ -17,7 +17,7 @@ Introduced in version 3.39.0.
 endif::[]
 
 ```yml
-# Config fields, showing default values
+# Configuration fields, showing default values
 output:
   label: ""
   sftp:
@@ -25,10 +25,11 @@ output:
     path: "" # No default (required)
     codec: all-bytes
     credentials:
-      username: ""
-      password: ""
-      private_key_file: ""
-      private_key_pass: ""
+      username: "" # No default (optional)
+      password: "" # No default (optional)
+      private_key_file: "" # No default (optional)
+      private_key: "" # No default (optional)
+      private_key_pass: "" # No default (optional)
     max_in_flight: 64
 ```
 
@@ -42,16 +43,13 @@ This output benefits from sending multiple messages in flight in parallel for im
 
 === `address`
 
-The address of the server to connect to.
-
+The address (hostname or IP address) of the SFTP server to connect to.
 
 *Type*: `string`
 
-
 === `path`
 
-The file to save the messages to on the server.
-This field supports xref:configuration:interpolation.adoc#bloblang-queries[interpolation functions].
+The file to save the messages to on the SFTP server. This field supports xref:configuration:interpolation.adoc#bloblang-queries[interpolation functions].
 
 
 *Type*: `string`
@@ -92,15 +90,14 @@ codec: delim:foobar
 
 === `credentials`
 
-The credentials to use to log into the target server.
-
+The credentials required to log in to the SFTP server. This can include a username and password, or a private key for secure access.
 
 *Type*: `object`
 
 
 === `credentials.username`
 
-The username to connect to the SFTP server.
+The username required to authenticate with the SFTP server.
 
 
 *Type*: `string`
@@ -109,28 +106,36 @@ The username to connect to the SFTP server.
 
 === `credentials.password`
 
-The password for the username to connect to the SFTP server.
+The password for the username used to authenticate with the SFTP server.
 
 include::components:partial$secret_warning.adoc[]
 
 
-
 *Type*: `string`
 
 *Default*: `""`
 
 === `credentials.private_key_file`
 
-The private key for the username to connect to the SFTP server.
-
+The path to a private key file used to authenticate with the SFTP server. You can also provide a private key using the <<credentials-private_key,`private_key`>> field.
 
 *Type*: `string`
 
 *Default*: `""`
 
+=== `credentials.private_key`
+
+The private key used to authenticate with the SFTP server. This field provides an alternative to the <<credentials-private_key_file, `private_key_file`>>.
+
+include::components:partial$secret_warning.adoc[]
+
+
+*Type*: `string`
+
+
 === `credentials.private_key_pass`
 
-Optional passphrase for private key.
+A passphrase for private key.
 
 include::components:partial$secret_warning.adoc[]
 


Reviews:
user: login: ooesili
state: APPROVED
author_association: NONE
submitted_at: 2025-04-14T15:12:37Z
user: login: Feediver1
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-14T17:24:19Z
user: login: asimms41
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T10:07:34Z
user: login: Feediver1
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T12:59:33Z

Review comments:
diff_hunk: @@ -112,32 +113,39 @@ The username to connect to the SFTP server.
 
 === `credentials.password`
 
-The password for the username to connect to the SFTP server.
+The password for the username used to authenticate with the SFTP server.
 
 include::components:partial$secret_warning.adoc[]
 
 
-
 *Type*: `string`
 
 *Default*: `""`
 
 === `credentials.private_key_file`
 
-The private key for the username to connect to the SFTP server.
+The path to a private key file used to authenticate with the SFTP server. You can also provide a private key using the <<credentials-private_key,`private_key`>> field.
+
+*Type*: `string`
+
+*Default*: `""`
 
+=== `credentials.private_key`
+
+The private key used to authenticate with the SFTP server. This field provides an alternative to the <<credentials-private_key_file, `private_key_file`>>.
path: modules/components/pages/inputs/sftp.adoc
user: login: Feediver1
body: This ref is not resolving correctly
created_at: 2025-04-14T17:24:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -112,32 +113,39 @@ The username to connect to the SFTP server.
 
 === `credentials.password`
 
-The password for the username to connect to the SFTP server.
+The password for the username used to authenticate with the SFTP server.
 
 include::components:partial$secret_warning.adoc[]
 
 
-
 *Type*: `string`
 
 *Default*: `""`
 
 === `credentials.private_key_file`
 
-The private key for the username to connect to the SFTP server.
+The path to a private key file used to authenticate with the SFTP server. You can also provide a private key using the <<credentials-private_key,`private_key`>> field.
+
+*Type*: `string`
+
+*Default*: `""`
 
+=== `credentials.private_key`
+
+The private key used to authenticate with the SFTP server. This field provides an alternative to the <<credentials-private_key_file, `private_key_file`>>.
path: modules/components/pages/inputs/sftp.adoc
user: login: asimms41
body: Updated.
created_at: 2025-04-15T10:07:34Z
author_association: CONTRIBUTOR

PR comments:
user: login: netlify[bot]
created_at: 2025-04-14T14:30:38Z
body: ### <span aria-hidden="true">✅</span> Deploy Preview for *redpanda-connect* ready!


|  Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit |  |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/sites/redpanda-connect/deploys/67fe5a329ce4a54c466f01f7 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-219--redpanda-connect.netlify.app](https://deploy-preview-219--redpanda-connect.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTIxOS0tcmVkcGFuZGEtY29ubmVjdC5uZXRsaWZ5LmFwcCJ9.oTx5kjsQxLFKm_iVK2kU5NMlf6dW0M9n0DpGeCpI4rI)<br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- [redpanda-connect Preview](https://deploy-preview-219--redpanda-connect.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify site configuration](https://app.netlify.com/sites/redpanda-connect/configuration/notifications#deploy-webhooks)._
author_association: NONE
user: login: Feediver1
created_at: 2025-04-14T17:22:01Z
body: Need to fix this unresolved reference:
![image](https://github.com/user-attachments/assets/ada29001-e3d7-4c57-a73a-73b6b8867f53)

author_association: CONTRIBUTOR