This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-jbang-examples.git
The following commit(s) were added to refs/heads/main by this push:
new 246a1d6 CAMEL-23610: Normalize YAML DSL to canonical form (#64)
246a1d6 is described below
commit 246a1d6f47478398c1d486385769ef4714faee95
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue May 26 07:16:05 2026 +0200
CAMEL-23610: Normalize YAML DSL to canonical form (#64)
Normalize 57 shorthand YAML DSL instances across 8 files:
- Shorthand log/to expanded to canonical nested form
- Inline simple expressions wrapped with expression wrapper
- URI query params extracted to parameters block
Co-authored-by: Claude Opus 4.6 <[email protected]>
---
aws/aws-sqs/http-to-aws-sqs.camel.yaml | 4 +-
ibm/ibm-cos/ibm-cos-sink.kamelet.yaml | 24 +-
ibm/ibm-cos/ibm-cos-source.kamelet.yaml | 3 +-
ibm/ibm-cos/kafka-to-ibm-cos.camel.yaml | 4 +-
.../text-analysis-api.camel.yaml | 12 +-
kubernetes/secrets/news-service.camel.yaml | 4 +-
kubernetes/service/news-service.camel.yaml | 4 +-
pqc-document-signing/pqc-document-signing.yaml | 295 +++++++++++++--------
8 files changed, 227 insertions(+), 123 deletions(-)
diff --git a/aws/aws-sqs/http-to-aws-sqs.camel.yaml
b/aws/aws-sqs/http-to-aws-sqs.camel.yaml
index c09e76b..a0998da 100644
--- a/aws/aws-sqs/http-to-aws-sqs.camel.yaml
+++ b/aws/aws-sqs/http-to-aws-sqs.camel.yaml
@@ -17,7 +17,9 @@
- route:
from:
- uri: "platform-http:/news?httpMethodRestrict=POST"
+ uri: platform-http:/news
+ parameters:
+ httpMethodRestrict: POST
steps:
- to:
uri: "kamelet:aws-sqs-sink"
diff --git a/ibm/ibm-cos/ibm-cos-sink.kamelet.yaml
b/ibm/ibm-cos/ibm-cos-sink.kamelet.yaml
index bf0918b..3dbc5b6 100644
--- a/ibm/ibm-cos/ibm-cos-sink.kamelet.yaml
+++ b/ibm/ibm-cos/ibm-cos-sink.kamelet.yaml
@@ -101,25 +101,37 @@ spec:
- choice:
precondition: true
when:
- - simple: '${propertiesExist:!keyName}'
+ - expression:
+ simple:
+ expression: '${propertiesExist:!keyName}'
steps:
- choice:
when:
- - simple: "${header[file]}"
+ - expression:
+ simple:
+ expression: "${header[file]}"
steps:
- setHeader:
name: CamelIbmCosKey
- simple: "${header[file]}"
- - simple: "${header[ce-file]}"
+ expression:
+ simple:
+ expression: "${header[file]}"
+ - expression:
+ simple:
+ expression: "${header[ce-file]}"
steps:
- setHeader:
name: CamelIbmCosKey
- simple: "${header[ce-file]}"
+ expression:
+ simple:
+ expression: "${header[ce-file]}"
otherwise:
steps:
- setHeader:
name: CamelIbmCosKey
- simple: "${exchangeId}"
+ expression:
+ simple:
+ expression: "${exchangeId}"
- to:
uri: "ibm-cos:{{bucketName}}"
parameters:
diff --git a/ibm/ibm-cos/ibm-cos-source.kamelet.yaml
b/ibm/ibm-cos/ibm-cos-source.kamelet.yaml
index f70dc34..3aea816 100644
--- a/ibm/ibm-cos/ibm-cos-source.kamelet.yaml
+++ b/ibm/ibm-cos/ibm-cos-source.kamelet.yaml
@@ -174,4 +174,5 @@ spec:
delay: "{{delay}}"
maxMessagesPerPoll: "{{maxMessagesPerPoll}}"
steps:
- - to: "kamelet:sink"
+ - to:
+ uri: kamelet:sink
diff --git a/ibm/ibm-cos/kafka-to-ibm-cos.camel.yaml
b/ibm/ibm-cos/kafka-to-ibm-cos.camel.yaml
index 46d0eca..339e143 100644
--- a/ibm/ibm-cos/kafka-to-ibm-cos.camel.yaml
+++ b/ibm/ibm-cos/kafka-to-ibm-cos.camel.yaml
@@ -26,7 +26,9 @@
steps:
- setHeader:
name: CamelIbmCosKey
- simple: "kafka-${date:now:yyyyMMdd-HHmmss-SSS}.txt"
+ expression:
+ simple:
+ expression: "kafka-${date:now:yyyyMMdd-HHmmss-SSS}.txt"
- log:
message: "Uploading to IBM COS: ${header.CamelIbmCosKey} with body:
${body}"
- to:
diff --git a/ibm/ibm-watson-language/text-analysis-api.camel.yaml
b/ibm/ibm-watson-language/text-analysis-api.camel.yaml
index d1b9284..e072fb5 100644
--- a/ibm/ibm-watson-language/text-analysis-api.camel.yaml
+++ b/ibm/ibm-watson-language/text-analysis-api.camel.yaml
@@ -18,7 +18,9 @@
- route:
id: "analyze-sentiment-api"
from:
- uri: "platform-http:/analyze/sentiment?httpMethodRestrict=POST"
+ uri: platform-http:/analyze/sentiment
+ parameters:
+ httpMethodRestrict: POST
steps:
- log:
message: "Received text for sentiment analysis: ${body}"
@@ -41,7 +43,9 @@
- route:
id: "analyze-entities-api"
from:
- uri: "platform-http:/analyze/entities?httpMethodRestrict=POST"
+ uri: platform-http:/analyze/entities
+ parameters:
+ httpMethodRestrict: POST
steps:
- log:
message: "Received text for entity extraction: ${body}"
@@ -64,7 +68,9 @@
- route:
id: "analyze-comprehensive-api"
from:
- uri: "platform-http:/analyze/all?httpMethodRestrict=POST"
+ uri: platform-http:/analyze/all
+ parameters:
+ httpMethodRestrict: POST
steps:
- log:
message: "Received text for comprehensive analysis: ${body}"
diff --git a/kubernetes/secrets/news-service.camel.yaml
b/kubernetes/secrets/news-service.camel.yaml
index 750dbe8..1705c4d 100644
--- a/kubernetes/secrets/news-service.camel.yaml
+++ b/kubernetes/secrets/news-service.camel.yaml
@@ -17,7 +17,9 @@
- route:
from:
- uri: "platform-http:/news?httpMethodRestrict=GET"
+ uri: platform-http:/news
+ parameters:
+ httpMethodRestrict: GET
steps:
- setBody:
constant: "{{news.headline}}"
diff --git a/kubernetes/service/news-service.camel.yaml
b/kubernetes/service/news-service.camel.yaml
index f91a5b3..289d0b1 100644
--- a/kubernetes/service/news-service.camel.yaml
+++ b/kubernetes/service/news-service.camel.yaml
@@ -17,7 +17,9 @@
- route:
from:
- uri: "platform-http:/news?httpMethodRestrict=GET"
+ uri: platform-http:/news
+ parameters:
+ httpMethodRestrict: GET
steps:
- setBody:
constant: "Hello from Camel"
diff --git a/pqc-document-signing/pqc-document-signing.yaml
b/pqc-document-signing/pqc-document-signing.yaml
index c47813c..d1e680a 100644
--- a/pqc-document-signing/pqc-document-signing.yaml
+++ b/pqc-document-signing/pqc-document-signing.yaml
@@ -54,11 +54,13 @@
parameters:
repeatCount: 1
steps:
- - log: "Initializing PQC signing key in Vault..."
+ - log:
+ message: "Initializing PQC signing key in Vault..."
- bean:
ref: keyLifecycleManager
method: "generateKeyPair('DILITHIUM', 'document-signing-key')"
- - log: "PQC signing key initialized successfully"
+ - log:
+ message: "PQC signing key initialized successfully"
- script:
groovy: |
// Register the KeyPair bean
@@ -66,17 +68,21 @@
org.apache.camel.component.pqc.lifecycle.HashicorpVaultKeyLifecycleManager.class)
def keyPair = keyManager.getKey('document-signing-key')
camelContext.registry.bind('signingKey', keyPair)
- - to: direct:get-key-metadata
+ - to:
+ uri: direct:get-key-metadata
- route:
id: sign-document-api
from:
uri: platform-http:/api/sign
steps:
- - log: "Received document signing request: ${body}"
+ - log:
+ message: "Received document signing request: ${body}"
- setHeader:
name: originalBody
- simple: "${body}"
+ expression:
+ simple:
+ expression: "${body}"
- toD:
"pqc:sign?operation=sign&signatureAlgorithm=DILITHIUM&keyPair=#signingKey"
- script:
groovy: |
@@ -86,30 +92,37 @@
def base64Signature =
java.util.Base64.encoder.encodeToString(signature)
exchange.message.setHeader('CamelPQCSignature',
base64Signature)
}
- - log: "Document signed with quantum-resistant signature"
- - to: direct:update-key-usage
- - to: direct:check-key-expiration
+ - log:
+ message: "Document signed with quantum-resistant signature"
+ - to:
+ uri: direct:update-key-usage
+ - to:
+ uri: direct:check-key-expiration
- setBody:
- simple: |
- {
- "status": "signed",
- "document": "${header.originalBody}",
- "signature": "${header.CamelPQCSignature}",
- "signatureAlgorithm": "DILITHIUM",
- "keyId": "document-signing-key",
- "keyMetadata": ${body}
- }
+ expression:
+ simple:
+ expression: |
+ {
+ "status": "signed",
+ "document": "${header.originalBody}",
+ "signature": "${header.CamelPQCSignature}",
+ "signatureAlgorithm": "DILITHIUM",
+ "keyId": "document-signing-key",
+ "keyMetadata": ${body}
+ }
- setHeader:
name: Content-Type
constant: "application/json"
- - log: "Response: ${body}"
+ - log:
+ message: "Response: ${body}"
- route:
id: verify-document-api
from:
uri: platform-http:/api/verify
steps:
- - log: "Received document verification request: ${body}"
+ - log:
+ message: "Received document verification request: ${body}"
- script:
groovy: |
// Get signature from X-Signature header
@@ -120,91 +133,113 @@
def signature = java.util.Base64.decoder.decode(base64Signature)
exchange.getIn().setHeader('CamelPQCSignature', signature)
exchange.getIn().setHeader('signatureLength', signature.length)
- - log: "Verifying signature of length: ${header.signatureLength} bytes"
+ - log:
+ message: "Verifying signature of length: ${header.signatureLength}
bytes"
- doTry:
steps:
- toD:
"pqc:verify?operation=verify&signatureAlgorithm=DILITHIUM&keyPair=#signingKey"
- - log: "Verification completed. Result:
${header.CamelPQCVerification}"
+ - log:
+ message: "Verification completed. Result:
${header.CamelPQCVerification}"
doCatch:
- exception:
- "java.lang.Exception"
steps:
- - log: "ERROR during verification: ${exception.message}"
+ - log:
+ message: "ERROR during verification:
${exception.message}"
- setHeader:
name: CamelPQCVerification
constant: false
- choice:
when:
- - simple: "${header.CamelPQCVerification} == true"
+ - expression:
+ simple:
+ expression: "${header.CamelPQCVerification} == true"
steps:
- setBody:
- simple: |
- {
- "status": "verified",
- "valid": true,
- "message": "Document signature is valid",
- "signatureAlgorithm": "DILITHIUM"
- }
- - simple: "${header.CamelPQCVerification} == false"
+ expression:
+ simple:
+ expression: |
+ {
+ "status": "verified",
+ "valid": true,
+ "message": "Document signature is valid",
+ "signatureAlgorithm": "DILITHIUM"
+ }
+ - expression:
+ simple:
+ expression: "${header.CamelPQCVerification} == false"
steps:
- setBody:
- simple: |
- {
- "status": "verified",
- "valid": false,
- "message": "Document signature is invalid",
- "signatureAlgorithm": "DILITHIUM"
- }
+ expression:
+ simple:
+ expression: |
+ {
+ "status": "verified",
+ "valid": false,
+ "message": "Document signature is invalid",
+ "signatureAlgorithm": "DILITHIUM"
+ }
- setHeader:
name: Content-Type
constant: "application/json"
- - log: "Verification result: ${body}"
+ - log:
+ message: "Verification result: ${body}"
- route:
id: get-key-metadata-api
from:
uri: platform-http:/api/key/metadata
steps:
- - log: "Fetching key metadata..."
- - to: direct:get-key-metadata
+ - log:
+ message: "Fetching key metadata..."
+ - to:
+ uri: direct:get-key-metadata
- route:
id: list-keys-api
from:
uri: platform-http:/api/keys
steps:
- - log: "Listing all PQC keys..."
+ - log:
+ message: "Listing all PQC keys..."
- bean:
ref: keyLifecycleManager
method: "listKeys"
- setBody:
- simple: |
- {
- "keys": ${body}
- }
+ expression:
+ simple:
+ expression: |
+ {
+ "keys": ${body}
+ }
- setHeader:
name: Content-Type
constant: "application/json"
- - log: "Keys listed: ${body}"
+ - log:
+ message: "Keys listed: ${body}"
- route:
id: rotate-key-api
from:
uri: platform-http:/api/key/rotate
steps:
- - log: "Rotating signing key..."
+ - log:
+ message: "Rotating signing key..."
- bean:
ref: keyLifecycleManager
method: "rotateKey('document-signing-key', 'document-signing-key',
'DILITHIUM')"
- - log: "Key rotated successfully: old key deprecated, new key active"
+ - log:
+ message: "Key rotated successfully: old key deprecated, new key
active"
- setBody:
- simple: |
- {
- "status": "rotated",
- "oldKey": "document-signing-key",
- "newKey": "document-signing-key",
- "message": "Key rotation completed successfully"
- }
+ expression:
+ simple:
+ expression: |
+ {
+ "status": "rotated",
+ "oldKey": "document-signing-key",
+ "newKey": "document-signing-key",
+ "message": "Key rotation completed successfully"
+ }
- setHeader:
name: Content-Type
constant: "application/json"
@@ -216,20 +251,27 @@
parameters:
period: "{{key.rotation.check.period}}"
steps:
- - log: "Checking if key needs rotation..."
+ - log:
+ message: "Checking if key needs rotation..."
- bean:
ref: keyLifecycleManager
method: "needsRotation('document-signing-key',
'P{{key.max.age.days}}D', {{key.max.usage.count}})"
- choice:
when:
- - simple: "${body} == true"
+ - expression:
+ simple:
+ expression: "${body} == true"
steps:
- - log: "WARNING: Key 'document-signing-key' needs rotation!"
- - to: direct:get-key-metadata
- - log: "Current key metadata: ${body}"
+ - log:
+ message: "WARNING: Key 'document-signing-key' needs
rotation!"
+ - to:
+ uri: direct:get-key-metadata
+ - log:
+ message: "Current key metadata: ${body}"
otherwise:
steps:
- - log: "Key rotation not needed yet"
+ - log:
+ message: "Key rotation not needed yet"
- route:
id: update-key-usage
@@ -241,7 +283,9 @@
method: "getKeyMetadata('document-signing-key')"
- setProperty:
name: metadata
- simple: "${body}"
+ expression:
+ simple:
+ expression: "${body}"
- script:
groovy: |
// Update last used timestamp and increment usage count
@@ -253,7 +297,8 @@
- bean:
ref: keyLifecycleManager
method: "updateKeyMetadata('document-signing-key', ${body})"
- - log: "Key usage updated. Usage count: ${body.usageCount}"
+ - log:
+ message: "Key usage updated. Usage count: ${body.usageCount}"
- route:
id: get-key-metadata-helper
@@ -264,24 +309,27 @@
ref: keyLifecycleManager
method: "getKeyMetadata('document-signing-key')"
- setBody:
- simple: |
- {
- "keyId": "${body.keyId}",
- "algorithm": "${body.algorithm}",
- "status": "${body.status}",
- "createdAt": "${body.createdAt}",
- "lastUsedAt": "${body.lastUsedAt}",
- "usageCount": ${body.usageCount},
- "ageInDays": ${body.ageInDays},
- "expiresAt": "${body.expiresAt}",
- "nextRotationAt": "${body.nextRotationAt}",
- "expired": ${body.expired},
- "needsRotation": ${body.needsRotation}
- }
+ expression:
+ simple:
+ expression: |
+ {
+ "keyId": "${body.keyId}",
+ "algorithm": "${body.algorithm}",
+ "status": "${body.status}",
+ "createdAt": "${body.createdAt}",
+ "lastUsedAt": "${body.lastUsedAt}",
+ "usageCount": ${body.usageCount},
+ "ageInDays": ${body.ageInDays},
+ "expiresAt": "${body.expiresAt}",
+ "nextRotationAt": "${body.nextRotationAt}",
+ "expired": ${body.expired},
+ "needsRotation": ${body.needsRotation}
+ }
- setHeader:
name: Content-Type
constant: "application/json"
- - log: "Key metadata: ${body}"
+ - log:
+ message: "Key metadata: ${body}"
- route:
id: check-key-expiration
@@ -293,61 +341,90 @@
method: "getKeyMetadata('document-signing-key')"
- choice:
when:
- - simple: "${body.usageCount} >= {{key.max.usage.count}}"
+ - expression:
+ simple:
+ expression: "${body.usageCount} >= {{key.max.usage.count}}"
steps:
- - log: "WARNING: Key has reached maximum usage count
(${body.usageCount} >= {{key.max.usage.count}})"
+ - log:
+ message: "WARNING: Key has reached maximum usage count
(${body.usageCount} >= {{key.max.usage.count}})"
- setProperty:
name: expirationReason
- simple: "usage count (${body.usageCount} uses)"
- - to: direct:auto-rotate-key
- - simple: "${body.ageInDays} >= {{key.max.age.days}}"
+ expression:
+ simple:
+ expression: "usage count (${body.usageCount} uses)"
+ - to:
+ uri: direct:auto-rotate-key
+ - expression:
+ simple:
+ expression: "${body.ageInDays} >= {{key.max.age.days}}"
steps:
- - log: "WARNING: Key has reached maximum age
(${body.ageInDays} >= {{key.max.age.days}} days)"
+ - log:
+ message: "WARNING: Key has reached maximum age
(${body.ageInDays} >= {{key.max.age.days}} days)"
- setProperty:
name: expirationReason
- simple: "age (${body.ageInDays} days)"
- - to: direct:auto-rotate-key
+ expression:
+ simple:
+ expression: "age (${body.ageInDays} days)"
+ - to:
+ uri: direct:auto-rotate-key
otherwise:
steps:
- setBody:
- simple: "Key is valid (usage:
${body.usageCount}/{{key.max.usage.count}}, age:
${body.ageInDays}/{{key.max.age.days}} days)"
+ expression:
+ simple:
+ expression: "Key is valid (usage:
${body.usageCount}/{{key.max.usage.count}}, age:
${body.ageInDays}/{{key.max.age.days}} days)"
- route:
id: auto-rotate-key
from:
uri: direct:auto-rotate-key
steps:
- - log: ">>> AUTOMATIC KEY ROTATION TRIGGERED <<<"
- - log: "Reason: Key expired due to
${exchangeProperty.expirationReason}"
+ - log:
+ message: ">>> AUTOMATIC KEY ROTATION TRIGGERED <<<"
+ - log:
+ message: "Reason: Key expired due to
${exchangeProperty.expirationReason}"
- setProperty:
name: timestamp
- simple: "${date:now:yyyyMMdd-HHmmss}"
+ expression:
+ simple:
+ expression: "${date:now:yyyyMMdd-HHmmss}"
- setProperty:
name: newKeyId
- simple: "document-signing-key"
- - log: "Rotating key from 'document-signing-key' to
'${exchangeProperty.newKeyId}'"
+ expression:
+ simple:
+ expression: "document-signing-key"
+ - log:
+ message: "Rotating key from 'document-signing-key' to
'${exchangeProperty.newKeyId}'"
- bean:
ref: keyLifecycleManager
method: "rotateKey('document-signing-key',
'${exchangeProperty.newKeyId}', 'DILITHIUM')"
- - log: ">>> KEY ROTATION COMPLETED <<<"
- - log: "Old key 'document-signing-key' status: DEPRECATED"
- - log: "New key '${exchangeProperty.newKeyId}' status: ACTIVE"
+ - log:
+ message: ">>> KEY ROTATION COMPLETED <<<"
+ - log:
+ message: "Old key 'document-signing-key' status: DEPRECATED"
+ - log:
+ message: "New key '${exchangeProperty.newKeyId}' status: ACTIVE"
- setProperty:
name: activeKeyId
- simple: "${exchangeProperty.newKeyId}"
+ expression:
+ simple:
+ expression: "${exchangeProperty.newKeyId}"
- bean:
ref: keyLifecycleManager
method: "getKeyMetadata('${exchangeProperty.newKeyId}')"
- setBody:
- simple: |
- {
- "rotationTriggered": true,
- "reason": "${exchangeProperty.expirationReason}",
- "oldKey": "document-signing-key",
- "oldKeyStatus": "DEPRECATED",
- "newKey": "${exchangeProperty.newKeyId}",
- "newKeyStatus": "ACTIVE",
- "newKeyCreatedAt": "${body.createdAt}",
- "message": "Key automatically rotated due to
${exchangeProperty.expirationReason}"
- }
- - log: "Rotation details: ${body}"
+ expression:
+ simple:
+ expression: |
+ {
+ "rotationTriggered": true,
+ "reason": "${exchangeProperty.expirationReason}",
+ "oldKey": "document-signing-key",
+ "oldKeyStatus": "DEPRECATED",
+ "newKey": "${exchangeProperty.newKeyId}",
+ "newKeyStatus": "ACTIVE",
+ "newKeyCreatedAt": "${body.createdAt}",
+ "message": "Key automatically rotated due to
${exchangeProperty.expirationReason}"
+ }
+ - log:
+ message: "Rotation details: ${body}"