From d6c88bc4ea3cb25c1cfd396c5cee7e93e692ddcb Mon Sep 17 00:00:00 2001 From: nicolaferraro Date: Thu, 29 Apr 2021 15:29:27 +0200 Subject: [PATCH] Fix #178: fix password definitions and enforce rules --- aws-ddb-streams-source.kamelet.yaml | 2 ++ aws-kinesis-firehose-sink.kamelet.yaml | 2 ++ aws-kinesis-sink.kamelet.yaml | 2 ++ aws-kinesis-source.kamelet.yaml | 2 ++ aws-lambda-sink.kamelet.yaml | 2 ++ aws-s3-sink.kamelet.yaml | 4 +++ aws-s3-source.kamelet.yaml | 2 ++ aws-sns-fifo-sink.kamelet.yaml | 4 +++ aws-sns-sink.kamelet.yaml | 2 ++ aws-sqs-batch-sink.kamelet.yaml | 2 ++ aws-sqs-fifo-sink.kamelet.yaml | 4 +++ aws-sqs-sink.kamelet.yaml | 2 ++ aws-sqs-source.kamelet.yaml | 2 ++ azure-eventhubs-sink.kamelet.yaml | 1 + azure-eventhubs-source.kamelet.yaml | 2 ++ azure-storage-blob-sink.kamelet.yaml | 1 + azure-storage-blob-source.kamelet.yaml | 1 + azure-storage-queue-sink.kamelet.yaml | 1 + cassandra-sink.kamelet.yaml | 1 + cassandra-source.kamelet.yaml | 1 + dropbox-sink.kamelet.yaml | 1 + dropbox-source.kamelet.yaml | 1 + elasticsearch-search-source.kamelet.yaml | 2 ++ fhir-source.kamelet.yaml | 2 ++ file-watch-source.kamelet.yaml | 2 +- ftp-source.kamelet.yaml | 9 +++++- ftps-source.kamelet.yaml | 7 +++++ github-source.kamelet.yaml | 1 + google-calendar-source.kamelet.yaml | 4 +++ google-mail-source.kamelet.yaml | 4 +++ google-sheets-source.kamelet.yaml | 4 +++ infinispan-source.kamelet.yaml | 2 ++ jira-source.kamelet.yaml | 1 + mail-imap-source.kamelet.yaml | 1 + minio-sink.kamelet.yaml | 2 ++ minio-source.kamelet.yaml | 2 ++ rabbitmq-source.kamelet.yaml | 1 + salesforce-source.kamelet.yaml | 2 ++ script/validator/validator.go | 36 ++++++++++++++++++++++++ sftp-source.kamelet.yaml | 7 +++++ slack-source.kamelet.yaml | 1 + ssh-source.kamelet.yaml | 2 ++ telegram-sink.kamelet.yaml | 1 + telegram-source.kamelet.yaml | 1 + 44 files changed, 134 insertions(+), 2 deletions(-) diff --git a/aws-ddb-streams-source.kamelet.yaml b/aws-ddb-streams-source.kamelet.yaml index ba2db5831..637de34a8 100644 --- a/aws-ddb-streams-source.kamelet.yaml +++ b/aws-ddb-streams-source.kamelet.yaml @@ -27,12 +27,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/aws-kinesis-firehose-sink.kamelet.yaml b/aws-kinesis-firehose-sink.kamelet.yaml index 753f06bff..9b0479a12 100644 --- a/aws-kinesis-firehose-sink.kamelet.yaml +++ b/aws-kinesis-firehose-sink.kamelet.yaml @@ -27,12 +27,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/aws-kinesis-sink.kamelet.yaml b/aws-kinesis-sink.kamelet.yaml index 8f8e5e38a..cbe0da454 100644 --- a/aws-kinesis-sink.kamelet.yaml +++ b/aws-kinesis-sink.kamelet.yaml @@ -39,12 +39,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/aws-kinesis-source.kamelet.yaml b/aws-kinesis-source.kamelet.yaml index e01db7ee5..d4d656d10 100644 --- a/aws-kinesis-source.kamelet.yaml +++ b/aws-kinesis-source.kamelet.yaml @@ -27,12 +27,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/aws-lambda-sink.kamelet.yaml b/aws-lambda-sink.kamelet.yaml index 5bfde8830..e4676981d 100644 --- a/aws-lambda-sink.kamelet.yaml +++ b/aws-lambda-sink.kamelet.yaml @@ -27,12 +27,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/aws-s3-sink.kamelet.yaml b/aws-s3-sink.kamelet.yaml index faa4ee32b..c4330f946 100644 --- a/aws-s3-sink.kamelet.yaml +++ b/aws-s3-sink.kamelet.yaml @@ -33,12 +33,14 @@ spec: title: Access Key description: The access key obtained from AWS. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: @@ -51,6 +53,8 @@ spec: description: Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride. type: boolean default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' uriEndpointOverride: title: Override Endpoint URI description: Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option. diff --git a/aws-s3-source.kamelet.yaml b/aws-s3-source.kamelet.yaml index 7d80db429..71a219532 100644 --- a/aws-s3-source.kamelet.yaml +++ b/aws-s3-source.kamelet.yaml @@ -34,12 +34,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/aws-sns-fifo-sink.kamelet.yaml b/aws-sns-fifo-sink.kamelet.yaml index 224e25173..8acd9c284 100644 --- a/aws-sns-fifo-sink.kamelet.yaml +++ b/aws-sns-fifo-sink.kamelet.yaml @@ -27,12 +27,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: @@ -45,6 +47,8 @@ spec: description: Use content-based deduplication (should be enabled in the SQS FIFO queue first) type: boolean default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' autoCreateTopic: title: Autocreate Topic description: Setting the autocreation of the SNS topic. diff --git a/aws-sns-sink.kamelet.yaml b/aws-sns-sink.kamelet.yaml index 36e88a2cb..88c3b81fa 100644 --- a/aws-sns-sink.kamelet.yaml +++ b/aws-sns-sink.kamelet.yaml @@ -27,12 +27,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/aws-sqs-batch-sink.kamelet.yaml b/aws-sqs-batch-sink.kamelet.yaml index 2625ec1a1..a1100a894 100644 --- a/aws-sqs-batch-sink.kamelet.yaml +++ b/aws-sqs-batch-sink.kamelet.yaml @@ -28,12 +28,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/aws-sqs-fifo-sink.kamelet.yaml b/aws-sqs-fifo-sink.kamelet.yaml index 7ef56293c..2b736e54d 100644 --- a/aws-sqs-fifo-sink.kamelet.yaml +++ b/aws-sqs-fifo-sink.kamelet.yaml @@ -27,12 +27,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: @@ -45,6 +47,8 @@ spec: description: Use content-based deduplication (should be enabled in the SQS FIFO queue first) type: boolean default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' autoCreateQueue: title: Autocreate Queue description: Setting the autocreation of the SQS queue. diff --git a/aws-sqs-sink.kamelet.yaml b/aws-sqs-sink.kamelet.yaml index 4230cb115..94e7b8921 100644 --- a/aws-sqs-sink.kamelet.yaml +++ b/aws-sqs-sink.kamelet.yaml @@ -27,12 +27,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/aws-sqs-source.kamelet.yaml b/aws-sqs-source.kamelet.yaml index 856d7e696..df46b6dea 100644 --- a/aws-sqs-source.kamelet.yaml +++ b/aws-sqs-source.kamelet.yaml @@ -34,12 +34,14 @@ spec: title: Access Key description: The access key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from AWS type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password region: diff --git a/azure-eventhubs-sink.kamelet.yaml b/azure-eventhubs-sink.kamelet.yaml index 462e00889..3b9a2d9c5 100644 --- a/azure-eventhubs-sink.kamelet.yaml +++ b/azure-eventhubs-sink.kamelet.yaml @@ -41,6 +41,7 @@ spec: title: Share Access Key description: The key for EventHubs SAS key name type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password dependencies: diff --git a/azure-eventhubs-source.kamelet.yaml b/azure-eventhubs-source.kamelet.yaml index 1ae0f51ac..bb7b2cfed 100644 --- a/azure-eventhubs-source.kamelet.yaml +++ b/azure-eventhubs-source.kamelet.yaml @@ -38,6 +38,7 @@ spec: title: Share Access Key description: The key for EventHubs SAS key name type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password blobAccountName: @@ -52,6 +53,7 @@ spec: title: Azure Storage Blob Access Key description: The key for Azure Storage Blob service associated with the Blob account name type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password types: diff --git a/azure-storage-blob-sink.kamelet.yaml b/azure-storage-blob-sink.kamelet.yaml index c78659f66..fa3b4e87e 100644 --- a/azure-storage-blob-sink.kamelet.yaml +++ b/azure-storage-blob-sink.kamelet.yaml @@ -36,6 +36,7 @@ spec: title: Access Key description: The Azure Storage Blob access Key. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password operation: diff --git a/azure-storage-blob-source.kamelet.yaml b/azure-storage-blob-source.kamelet.yaml index 87d94e4c1..062020879 100644 --- a/azure-storage-blob-source.kamelet.yaml +++ b/azure-storage-blob-source.kamelet.yaml @@ -36,6 +36,7 @@ spec: title: Access Key description: The Azure Storage Blob access Key. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password flow: diff --git a/azure-storage-queue-sink.kamelet.yaml b/azure-storage-queue-sink.kamelet.yaml index 89c08a0f7..0c4015ad2 100644 --- a/azure-storage-queue-sink.kamelet.yaml +++ b/azure-storage-queue-sink.kamelet.yaml @@ -38,6 +38,7 @@ spec: title: Access Key description: The Azure Storage Queue access Key. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password flow: diff --git a/cassandra-sink.kamelet.yaml b/cassandra-sink.kamelet.yaml index 13f627a9c..d02e52bef 100644 --- a/cassandra-sink.kamelet.yaml +++ b/cassandra-sink.kamelet.yaml @@ -46,6 +46,7 @@ spec: title: Password description: The password to use for accessing a secured Cassandra Cluster type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password consistencyLevel: diff --git a/cassandra-source.kamelet.yaml b/cassandra-source.kamelet.yaml index d22478b67..4e11d0f7d 100644 --- a/cassandra-source.kamelet.yaml +++ b/cassandra-source.kamelet.yaml @@ -44,6 +44,7 @@ spec: title: Password description: The password to use for accessing a secured Cassandra Cluster type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password resultStrategy: diff --git a/dropbox-sink.kamelet.yaml b/dropbox-sink.kamelet.yaml index 1f25d5e9b..4df8d7423 100644 --- a/dropbox-sink.kamelet.yaml +++ b/dropbox-sink.kamelet.yaml @@ -29,6 +29,7 @@ spec: title: Dropbox Access Token description: The access Token to use to access Dropbox type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password clientIdentifier: diff --git a/dropbox-source.kamelet.yaml b/dropbox-source.kamelet.yaml index f8098f98f..0565a3002 100644 --- a/dropbox-source.kamelet.yaml +++ b/dropbox-source.kamelet.yaml @@ -29,6 +29,7 @@ spec: title: Dropbox Access Token description: The access Token to use to access Dropbox type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password clientIdentifier: diff --git a/elasticsearch-search-source.kamelet.yaml b/elasticsearch-search-source.kamelet.yaml index 40cac66b0..f398ac7c0 100755 --- a/elasticsearch-search-source.kamelet.yaml +++ b/elasticsearch-search-source.kamelet.yaml @@ -51,6 +51,8 @@ spec: description: Do we want to connect using SSL? type: boolean default: true + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' hostAddresses: title: Host Addresses description: Comma separated list with ip:port formatted remote transport addresses to use. diff --git a/fhir-source.kamelet.yaml b/fhir-source.kamelet.yaml index 2ba963eff..1cf5a8e17 100644 --- a/fhir-source.kamelet.yaml +++ b/fhir-source.kamelet.yaml @@ -41,12 +41,14 @@ spec: title: Username description: The username to access the Fhir server type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password password: title: Password description: The password to access the Fhir server type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password prettyPrint: diff --git a/file-watch-source.kamelet.yaml b/file-watch-source.kamelet.yaml index 8871ac4e2..6a6b50591 100644 --- a/file-watch-source.kamelet.yaml +++ b/file-watch-source.kamelet.yaml @@ -24,7 +24,7 @@ spec: events: title: Events description: The type of events to consume - type: boolean + type: string default: "CREATE,MODIFY,DELETE" types: out: diff --git a/ftp-source.kamelet.yaml b/ftp-source.kamelet.yaml index 349f497c4..db29b9a29 100644 --- a/ftp-source.kamelet.yaml +++ b/ftp-source.kamelet.yaml @@ -38,6 +38,7 @@ spec: title: Password description: The password to access the FTP server type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password directoryName: @@ -49,16 +50,22 @@ spec: description: Sets passive mode connection type: boolean default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' recursive: title: Recursive description: If a directory, will look for files in all the sub-directories as well. type: boolean default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' idempotent: title: Idempotency description: Skip already processed files. type: boolean - default: true + default: true + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' flow: from: uri: "ftp:{{username}}@{{host}}:{{port}}/{{directoryName}}" diff --git a/ftps-source.kamelet.yaml b/ftps-source.kamelet.yaml index 90e262e41..5a94cde23 100644 --- a/ftps-source.kamelet.yaml +++ b/ftps-source.kamelet.yaml @@ -38,6 +38,7 @@ spec: title: Password description: The password to access the FTPS server type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password directoryName: @@ -49,16 +50,22 @@ spec: description: Sets passive mode connection type: boolean default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' recursive: title: Recursive description: If a directory, will look for files in all the sub-directories as well. type: boolean default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' idempotent: title: Idempotency description: Skip already processed files. type: boolean default: true + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' flow: from: uri: "ftps:{{username}}@{{host}}:{{port}}/{{directoryName}}" diff --git a/github-source.kamelet.yaml b/github-source.kamelet.yaml index d97d6f7a6..7978a078b 100644 --- a/github-source.kamelet.yaml +++ b/github-source.kamelet.yaml @@ -31,6 +31,7 @@ spec: title: OAuth Token description: Oauth token type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password type: diff --git a/google-calendar-source.kamelet.yaml b/google-calendar-source.kamelet.yaml index 4b4dabc04..da59190fe 100644 --- a/google-calendar-source.kamelet.yaml +++ b/google-calendar-source.kamelet.yaml @@ -34,24 +34,28 @@ spec: title: Client Id description: Client ID of the calendar application type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password clientSecret: title: Client Secret description: Client Secret of the calendar application type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password accessToken: title: Access Token description: OAuth 2 access token for google calendar application. This typically expires after an hour so refreshToken is recommended for long term usage. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password refreshToken: title: Refresh Token description: OAuth 2 refresh token for google calendar application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password delay: diff --git a/google-mail-source.kamelet.yaml b/google-mail-source.kamelet.yaml index ee4252b68..ce4a7a849 100644 --- a/google-mail-source.kamelet.yaml +++ b/google-mail-source.kamelet.yaml @@ -29,24 +29,28 @@ spec: title: Client ID description: Client ID of the gmail application type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password clientSecret: title: Client Secret description: Client Secret of the gmail application type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password accessToken: title: Access Token description: OAuth 2 access token for google mail application. This typically expires after an hour so refreshToken is recommended for long term usage. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password refreshToken: title: Refresh Token description: OAuth 2 refresh token for google mail application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password delay: diff --git a/google-sheets-source.kamelet.yaml b/google-sheets-source.kamelet.yaml index 876765c68..45bb50c90 100644 --- a/google-sheets-source.kamelet.yaml +++ b/google-sheets-source.kamelet.yaml @@ -34,24 +34,28 @@ spec: title: Client Id description: Client ID of the sheets application type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password clientSecret: title: Client Secret description: Client Secret of the sheets application type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password accessToken: title: Access Token description: OAuth 2 access token for google sheets application. This typically expires after an hour so refreshToken is recommended for long term usage. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password refreshToken: title: Refresh Token description: OAuth 2 refresh token for google sheets application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password delay: diff --git a/infinispan-source.kamelet.yaml b/infinispan-source.kamelet.yaml index 1daed46cb..8479f83a2 100755 --- a/infinispan-source.kamelet.yaml +++ b/infinispan-source.kamelet.yaml @@ -37,6 +37,8 @@ spec: description: If the Infinispan instance is secured or not type: boolean default: true + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' username: title: Username description: Username to connect to Infinispan. diff --git a/jira-source.kamelet.yaml b/jira-source.kamelet.yaml index 8839994b8..7c14b1bef 100644 --- a/jira-source.kamelet.yaml +++ b/jira-source.kamelet.yaml @@ -31,6 +31,7 @@ spec: title: Password description: The password to access Jira type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password jql: diff --git a/mail-imap-source.kamelet.yaml b/mail-imap-source.kamelet.yaml index 32f06ba7d..a1e1947cd 100644 --- a/mail-imap-source.kamelet.yaml +++ b/mail-imap-source.kamelet.yaml @@ -37,6 +37,7 @@ spec: title: Password description: The password to access the mail box type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password fetchSize: diff --git a/minio-sink.kamelet.yaml b/minio-sink.kamelet.yaml index 8694b1ff0..75c6431c8 100644 --- a/minio-sink.kamelet.yaml +++ b/minio-sink.kamelet.yaml @@ -33,12 +33,14 @@ spec: title: Access Key description: The access key obtained from Minio type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from Minio type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password endpoint: diff --git a/minio-source.kamelet.yaml b/minio-source.kamelet.yaml index b8540d80a..5990bf041 100644 --- a/minio-source.kamelet.yaml +++ b/minio-source.kamelet.yaml @@ -34,12 +34,14 @@ spec: title: Access Key description: The access key obtained from Minio type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password secretKey: title: Secret Key description: The secret key obtained from Minio type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password endpoint: diff --git a/rabbitmq-source.kamelet.yaml b/rabbitmq-source.kamelet.yaml index 762c62221..d2e31dbae 100644 --- a/rabbitmq-source.kamelet.yaml +++ b/rabbitmq-source.kamelet.yaml @@ -36,6 +36,7 @@ spec: title: Password description: The password to access the RabbitMQ server type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password exchangeName: diff --git a/salesforce-source.kamelet.yaml b/salesforce-source.kamelet.yaml index 2bd95763f..910b74b31 100644 --- a/salesforce-source.kamelet.yaml +++ b/salesforce-source.kamelet.yaml @@ -44,6 +44,7 @@ spec: title: Consumer Secret description: The Salesforce application consumer secret type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password userName: @@ -54,6 +55,7 @@ spec: title: Password description: The Salesforce user password type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password types: diff --git a/script/validator/validator.go b/script/validator/validator.go index 882007ae9..21637c621 100644 --- a/script/validator/validator.go +++ b/script/validator/validator.go @@ -37,6 +37,7 @@ func main() { errors = append(errors, verifyAnnotations(kamelets)...) errors = append(errors, verifyParameters(kamelets)...) errors = append(errors, verifyInvalidContent(kamelets)...) + errors = append(errors, verifyDescriptors(kamelets)...) for _, err := range errors { fmt.Printf("ERROR: %v\n", err) @@ -46,6 +47,41 @@ func main() { } } +func verifyDescriptors(kamelets []KameletInfo) (errors []error) { + for _, kamelet := range kamelets { + if kamelet.Spec.Definition == nil { + errors = append(errors, fmt.Errorf("kamelet %q does not contain the JSON schema definition", kamelet.Name)) + continue + } + for k, p := range kamelet.Spec.Definition.Properties { + pwdDescriptor := "urn:alm:descriptor:com.tectonic.ui:password" + if hasXDescriptor(p, pwdDescriptor) && p.Format != "password" { + errors = append(errors, fmt.Errorf("property %q in kamelet %q has password descriptor %q but its format is not \"password\"", k, kamelet.Name, pwdDescriptor)) + } else if !hasXDescriptor(p, pwdDescriptor) && p.Format == "password" { + errors = append(errors, fmt.Errorf("property %q in kamelet %q has \"password\" format but misses descriptor %q (for better compatibility with tectonic UIs)", k, kamelet.Name, pwdDescriptor)) + } + } + for k, p := range kamelet.Spec.Definition.Properties { + checkboxDescriptor := "urn:alm:descriptor:com.tectonic.ui:checkbox" + if hasXDescriptor(p, checkboxDescriptor) && p.Type != "boolean" { + errors = append(errors, fmt.Errorf("property %q in kamelet %q has checkbox descriptor %q but its type is not \"boolean\"", k, kamelet.Name, checkboxDescriptor)) + } else if !hasXDescriptor(p, checkboxDescriptor) && p.Type == "boolean" { + errors = append(errors, fmt.Errorf("property %q in kamelet %q has \"boolean\" type but misses descriptor %q (for better compatibility with tectonic UIs)", k, kamelet.Name, checkboxDescriptor)) + } + } + } + return errors +} + +func hasXDescriptor(p camel.JSONSchemaProp, desc string) bool { + for _, d := range p.XDescriptors { + if d == desc { + return true + } + } + return false +} + func verifyInvalidContent(kamelets []KameletInfo) (errors []error) { for _, kamelet := range kamelets { ser, err := json.Marshal(&kamelet.Kamelet) diff --git a/sftp-source.kamelet.yaml b/sftp-source.kamelet.yaml index 6b9c5fdf0..07c19dc1d 100644 --- a/sftp-source.kamelet.yaml +++ b/sftp-source.kamelet.yaml @@ -38,6 +38,7 @@ spec: title: Password description: The password to access the SFTP server type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password directoryName: @@ -49,16 +50,22 @@ spec: description: Sets passive mode connection type: boolean default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' recursive: title: Recursive description: If a directory, will look for files in all the sub-directories as well. type: boolean default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' idempotent: title: Idempotency description: Skip already processed files. type: boolean default: true + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' flow: from: uri: "sftp:{{username}}@{{host}}:{{port}}/{{directoryName}}" diff --git a/slack-source.kamelet.yaml b/slack-source.kamelet.yaml index c16895a58..ca36734ab 100644 --- a/slack-source.kamelet.yaml +++ b/slack-source.kamelet.yaml @@ -26,6 +26,7 @@ spec: title: Token description: The token to access Slack. A Slack app is needed. This app needs to have channels:history and channels:read permissions. The Bot User OAuth Access Token is the kind of token needed. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password types: diff --git a/ssh-source.kamelet.yaml b/ssh-source.kamelet.yaml index d3937dd37..79c36a7e8 100644 --- a/ssh-source.kamelet.yaml +++ b/ssh-source.kamelet.yaml @@ -33,12 +33,14 @@ spec: title: Username description: The SSH username to use type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password password: title: Password description: The SSH password to use type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password delay: diff --git a/telegram-sink.kamelet.yaml b/telegram-sink.kamelet.yaml index 02cadaa86..2ebbbd98e 100755 --- a/telegram-sink.kamelet.yaml +++ b/telegram-sink.kamelet.yaml @@ -34,6 +34,7 @@ spec: title: Token description: The token to access your bot on Telegram. You you can obtain it from the Telegram @botfather. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password chatId: diff --git a/telegram-source.kamelet.yaml b/telegram-source.kamelet.yaml index 7dd95c150..1788fde33 100644 --- a/telegram-source.kamelet.yaml +++ b/telegram-source.kamelet.yaml @@ -23,6 +23,7 @@ spec: title: Token description: The token to access your bot on Telegram. You you can obtain it from the Telegram @botfather. type: string + format: password x-descriptors: - urn:alm:descriptor:com.tectonic.ui:password types: