gnodet-bot commented on code in PR #26564:
URL: https://github.com/apache/camel/pull/26564#discussion_r4040619758
##########
components/camel-aws/camel-aws-secrets-manager/src/main/docs/aws-secrets-manager-component.adoc:
##########
@@ -526,6 +526,216 @@ Camel-AWS-Secrets-manager component provides the
following operation on the prod
- batchGetSecret
- updateSecret
- replicateSecretToRegions
+- restoreSecret
+- putSecretValue
+
+The `operation` option selects what to do (the
`CamelAwsSecretsManagerOperation` header overrides it per
+message), and the secret to work on comes from a header:
`CamelAwsSecretsManagerSecretName` when creating a
+secret, `CamelAwsSecretsManagerSecretId` (the name or the ARN) for the other
operations. The path of the
+endpoint is a logical name for the client, not a secret. With
`pojoRequest=true` the message body is the AWS
+SDK request object instead.
+
+==== Creating a secret
+
+The message body is the value of the secret, as a string (with
`binaryPayload=true` it is stored as binary):
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+from("direct:createSecret")
+ .setHeader(SecretsManagerConstants.SECRET_NAME, constant("database"))
+ .setBody(constant("{\"username\":\"camel\",\"password\":\"secret\"}"))
+
.to("aws-secrets-manager:secrets?operation=createSecret®ion=eu-west-1&useDefaultCredentialsProvider=true");
+----
+
+XML::
++
+[source,xml]
+----
+<camelContext>
+ <route>
+ <from uri="direct:createSecret"/>
+ <setHeader name="CamelAwsSecretsManagerSecretName">
+ <constant>database</constant>
+ </setHeader>
+ <setBody>
+ <constant>{"username":"camel","password":"secret"}</constant>
+ </setBody>
+ <to
uri="aws-secrets-manager:secrets?operation=createSecret&region=eu-west-1&useDefaultCredentialsProvider=true"/>
+ </route>
+</camelContext>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:createSecret
+ steps:
+ - setHeader:
+ name: CamelAwsSecretsManagerSecretName
+ expression:
+ constant:
+ expression: database
+ - setBody:
+ expression:
+ constant:
+ expression: '{"username":"camel","password":"secret"}'
+ - to:
+ uri:
aws-secrets-manager:secrets?operation=createSecret®ion=eu-west-1&useDefaultCredentialsProvider=true
+----
+====
+
+==== Getting a secret
+
+The message body becomes the value of the secret, and the
`CamelAwsSecretsManagerSecretVersionId` header its
+version:
Review Comment:
**Ambiguous header direction — clarify it's a response header.**
The current wording reads as if `CamelAwsSecretsManagerSecretVersionId`
could be set by the caller to request a specific version. The
`SecretsManagerProducer` never reads this header on input — it only writes it
on output (set from `result.versionId()`). A user following this doc might set
the header expecting to pin a version, then wonder why it has no effect.
Suggest:
```suggestion
The message body becomes the value of the secret, and the
`CamelAwsSecretsManagerSecretVersionId` response
header is set to the version id of the retrieved secret:
```
--
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]