From bcc7b8c334ebcfc6dbe66297a3bee57e4840e0ea Mon Sep 17 00:00:00 2001 From: Yonghui Ye <58474919+hui1110@users.noreply.github.com> Date: Tue, 17 May 2022 14:26:17 +0800 Subject: [PATCH] Modify the generation format of the appendix page configuration properties table (#922) --- docs/pom.xml | 178 ------------ .../main/asciidoc/_configprops_kv_secret.adoc | 66 ----- ...doc => _configuration-properties-all.adoc} | 87 +++++- ...roperties-azure-active-directory-b2c.adoc} | 0 ...on-properties-azure-active-directory.adoc} | 0 ...n-properties-azure-app-configuration.adoc} | 2 + ...iguration-properties-azure-cosmos-db.adoc} | 0 ...guration-properties-azure-event-hubs.adoc} | 2 + ...perties-azure-key-vault-certificates.adoc} | 2 + ...on-properties-azure-key-vault-secrets.adoc | 131 +++++++++ ...ion-properties-azure-service-bus-jms.adoc} | 0 ...uration-properties-azure-service-bus.adoc} | 8 +- ...ration-properties-azure-storage-blob.adoc} | 2 + ...-properties-azure-storage-file-share.adoc} | 2 + ...ation-properties-azure-storage-queue.adoc} | 2 + ... => _configuration-properties-global.adoc} | 2 + docs/src/main/asciidoc/appendix.adoc | 28 +- pom.xml | 189 +++++++++++++ .../pom.xml | 49 ++++ .../com/azure/spring/cloud/internal/Main.java | 265 ++++++++++++++++++ .../spring/cloud/internal/GeneratorTests.java | 100 +++++++ .../spring/cloud/internal/MainTests.java | 34 +++ .../configuration-properties-output.md | 13 + .../test/resources/with-azure-in-name.json | 27 ++ 24 files changed, 923 insertions(+), 266 deletions(-) delete mode 100644 docs/src/main/asciidoc/_configprops_kv_secret.adoc rename docs/src/main/asciidoc/{_configprops.adoc => _configuration-properties-all.adoc} (92%) rename docs/src/main/asciidoc/{_configprops_aadb2c.adoc => _configuration-properties-azure-active-directory-b2c.adoc} (100%) rename docs/src/main/asciidoc/{_configprops_aad.adoc => _configuration-properties-azure-active-directory.adoc} (100%) rename docs/src/main/asciidoc/{_configprops_appconf.adoc => _configuration-properties-azure-app-configuration.adoc} (97%) rename docs/src/main/asciidoc/{_configprops_cosmos.adoc => _configuration-properties-azure-cosmos-db.adoc} (100%) rename docs/src/main/asciidoc/{_configprops_eventhubs.adoc => _configuration-properties-azure-event-hubs.adoc} (99%) rename docs/src/main/asciidoc/{_configprops_kv_certificate.adoc => _configuration-properties-azure-key-vault-certificates.adoc} (97%) create mode 100644 docs/src/main/asciidoc/_configuration-properties-azure-key-vault-secrets.adoc rename docs/src/main/asciidoc/{_configprops_servicebus_jms.adoc => _configuration-properties-azure-service-bus-jms.adoc} (100%) rename docs/src/main/asciidoc/{_configprops_servicebus.adoc => _configuration-properties-azure-service-bus.adoc} (97%) rename docs/src/main/asciidoc/{_configprops_storage_blob.adoc => _configuration-properties-azure-storage-blob.adoc} (97%) rename docs/src/main/asciidoc/{_configprops_storage_fileshare.adoc => _configuration-properties-azure-storage-file-share.adoc} (97%) rename docs/src/main/asciidoc/{_configprops_storage_queue.adoc => _configuration-properties-azure-storage-queue.adoc} (97%) rename docs/src/main/asciidoc/{_configprops_global.adoc => _configuration-properties-global.adoc} (97%) create mode 100644 spring-cloud-azure-markdown-appdendix-generator/pom.xml create mode 100644 spring-cloud-azure-markdown-appdendix-generator/src/main/java/com/azure/spring/cloud/internal/Main.java create mode 100644 spring-cloud-azure-markdown-appdendix-generator/src/test/java/com/azure/spring/cloud/internal/GeneratorTests.java create mode 100644 spring-cloud-azure-markdown-appdendix-generator/src/test/java/com/azure/spring/cloud/internal/MainTests.java create mode 100644 spring-cloud-azure-markdown-appdendix-generator/src/test/resources/configuration-properties-output.md create mode 100644 spring-cloud-azure-markdown-appdendix-generator/src/test/resources/with-azure-in-name.json diff --git a/docs/pom.xml b/docs/pom.xml index 7e36c855..4088a471 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -105,184 +105,6 @@ org.codehaus.mojo exec-maven-plugin - - - generate-configprops - prepare-package - - java - - - - generate-global-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_global.adoc - spring.cloud.azure.(client|credential|profile|proxy|retry).* - - - - - generate-aad-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_aad.adoc - (?!spring.cloud.azure.active-directory.b2c.*)(spring.cloud.azure.active-directory.*) - - - - - generate-aadb2c-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_aadb2c.adoc - spring.cloud.azure.active-directory.b2c.* - - - - - generate-appconf-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_appconf.adoc - spring.cloud.azure.appconfiguration.* - - - - - generate-cosmos-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_cosmos.adoc - spring.cloud.azure.cosmos.* - - - - - generate-eventhubs-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_eventhubs.adoc - spring.cloud.azure.eventhubs.* - - - - - generate-kv-secret-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_kv_secret.adoc - spring.cloud.azure.keyvault.secret.* - - - - - generate-kv-certificate-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_kv_certificate.adoc - spring.cloud.azure.keyvault.certificate.* - - - - - generate-servicebus-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_servicebus.adoc - spring.cloud.azure.servicebus.* - - - - - generate-servicebus-jms-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_servicebus_jms.adoc - spring.jms.servicebus.* - - - - - generate-storage-blob-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_storage_blob.adoc - spring.cloud.azure.storage.blob.* - - - - - generate-storage-fileshare-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_storage_fileshare.adoc - spring.cloud.azure.storage.fileshare.* - - - - - generate-storage-queue-configprops - prepare-package - - java - - - - ${project.basedir}/src/main/asciidoc/_configprops_storage_queue.adoc - spring.cloud.azure.storage.queue.* - - - - org.asciidoctor diff --git a/docs/src/main/asciidoc/_configprops_kv_secret.adoc b/docs/src/main/asciidoc/_configprops_kv_secret.adoc deleted file mode 100644 index 4834dba8..00000000 --- a/docs/src/main/asciidoc/_configprops_kv_secret.adoc +++ /dev/null @@ -1,66 +0,0 @@ -|=== -|Name | Default | Description - -|spring.cloud.azure.keyvault.secret.client.application-id | | Represents current application and is used for telemetry/monitoring purposes. -|spring.cloud.azure.keyvault.secret.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. -|spring.cloud.azure.keyvault.secret.client.connection-idle-timeout | | Amount of time before an idle connection. -|spring.cloud.azure.keyvault.secret.client.headers | | Comma-delimited list of headers applied to each request sent with client. -|spring.cloud.azure.keyvault.secret.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. -|spring.cloud.azure.keyvault.secret.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. -|spring.cloud.azure.keyvault.secret.client.logging.level | | The level of detail to log on HTTP messages. -|spring.cloud.azure.keyvault.secret.client.logging.pretty-print-body | | Whether to pretty print the message bodies. -|spring.cloud.azure.keyvault.secret.client.maximum-connection-pool-size | | Maximum connection pool size used by the underlying HTTP client. -|spring.cloud.azure.keyvault.secret.client.read-timeout | | Amount of time used when reading the server response. -|spring.cloud.azure.keyvault.secret.client.response-timeout | | Amount of time used when waiting for a server to reply. -|spring.cloud.azure.keyvault.secret.client.write-timeout | | Amount of time each request being sent over the wire. -|spring.cloud.azure.keyvault.secret.credential.client-certificate-password | | Password of the certificate file. -|spring.cloud.azure.keyvault.secret.credential.client-certificate-path | | Path of a PEM certificate file to use when performing service principal authentication with Azure. -|spring.cloud.azure.keyvault.secret.credential.client-id | | Client id to use when performing service principal authentication with Azure. -|spring.cloud.azure.keyvault.secret.credential.client-secret | | Client secret to use when performing service principal authentication with Azure. -|spring.cloud.azure.keyvault.secret.credential.managed-identity-enabled | `false` | Whether to enable managed identity to authenticate with Azure. If true and the client-id is set, will use the client id as user assigned managed identity client id. -|spring.cloud.azure.keyvault.secret.credential.password | | Password to use when performing username/password authentication with Azure. -|spring.cloud.azure.keyvault.secret.credential.username | | Username to use when performing username/password authentication with Azure. -|spring.cloud.azure.keyvault.secret.enabled | `true` | Whether an Azure Service is enabled. -|spring.cloud.azure.keyvault.secret.endpoint | | Azure Key Vault endpoint. -|spring.cloud.azure.keyvault.secret.profile.cloud-type | | Name of the Azure cloud to connect to. -|spring.cloud.azure.keyvault.secret.profile.environment.active-directory-endpoint | | The Azure Active Directory endpoint to connect to. -|spring.cloud.azure.keyvault.secret.profile.environment.active-directory-graph-api-version | | The Azure Active Directory Graph API version. -|spring.cloud.azure.keyvault.secret.profile.environment.active-directory-graph-endpoint | | The Azure Active Directory Graph endpoint. -|spring.cloud.azure.keyvault.secret.profile.environment.active-directory-resource-id | | The Azure Active Directory resource id. -|spring.cloud.azure.keyvault.secret.profile.environment.azure-application-insights-endpoint | | The Azure Application Insights endpoint. -|spring.cloud.azure.keyvault.secret.profile.environment.azure-data-lake-analytics-catalog-and-job-endpoint-suffix | | The Data Lake analytics catalog and job endpoint suffix. -|spring.cloud.azure.keyvault.secret.profile.environment.azure-data-lake-store-file-system-endpoint-suffix | | The Data Lake storage file system endpoint suffix. -|spring.cloud.azure.keyvault.secret.profile.environment.azure-log-analytics-endpoint | | The Azure Log Analytics endpoint. -|spring.cloud.azure.keyvault.secret.profile.environment.data-lake-endpoint-resource-id | | The Data Lake endpoint. -|spring.cloud.azure.keyvault.secret.profile.environment.gallery-endpoint | | The gallery endpoint. -|spring.cloud.azure.keyvault.secret.profile.environment.key-vault-dns-suffix | | The Key Vault DNS suffix. -|spring.cloud.azure.keyvault.secret.profile.environment.management-endpoint | | The management service endpoint. -|spring.cloud.azure.keyvault.secret.profile.environment.microsoft-graph-endpoint | | The Microsoft Graph endpoint. -|spring.cloud.azure.keyvault.secret.profile.environment.portal | | The management portal URL. -|spring.cloud.azure.keyvault.secret.profile.environment.publishing-profile | | The publishing settings file URL. -|spring.cloud.azure.keyvault.secret.profile.environment.resource-manager-endpoint | | The resource management endpoint. -|spring.cloud.azure.keyvault.secret.profile.environment.sql-management-endpoint | | The SQL management endpoint. -|spring.cloud.azure.keyvault.secret.profile.environment.sql-server-hostname-suffix | | The SQL Server hostname suffix. -|spring.cloud.azure.keyvault.secret.profile.environment.storage-endpoint-suffix | | The Storage endpoint suffix. -|spring.cloud.azure.keyvault.secret.profile.subscription-id | | Subscription id to use when connecting to Azure resources. -|spring.cloud.azure.keyvault.secret.profile.tenant-id | | Tenant id for Azure resources. -|spring.cloud.azure.keyvault.secret.property-source-enabled | `true` | Whether to enable the Key Vault property source. -|spring.cloud.azure.keyvault.secret.property-sources | | Azure Key Vault property sources. -|spring.cloud.azure.keyvault.secret.proxy.hostname | | The host of the proxy. -|spring.cloud.azure.keyvault.secret.proxy.non-proxy-hosts | | A list of hosts or CIDR to not use proxy HTTP/HTTPS connections through. -|spring.cloud.azure.keyvault.secret.proxy.password | | Password used to authenticate with the proxy. -|spring.cloud.azure.keyvault.secret.proxy.port | | The port of the proxy. -|spring.cloud.azure.keyvault.secret.proxy.type | | Type of the proxy. -|spring.cloud.azure.keyvault.secret.proxy.username | | Username used to authenticate with the proxy. -|spring.cloud.azure.keyvault.secret.resource.region | | The region of an Azure resource. -|spring.cloud.azure.keyvault.secret.resource.resource-group | | The resource group holds an Azure resource. -|spring.cloud.azure.keyvault.secret.resource.resource-id | | ID of an Azure resource. -|spring.cloud.azure.keyvault.secret.retry.exponential.base-delay | | Amount of time to wait between retry attempts. -|spring.cloud.azure.keyvault.secret.retry.exponential.max-delay | | Maximum permissible amount of time between retry attempts. -|spring.cloud.azure.keyvault.secret.retry.exponential.max-retries | | The maximum number of attempts. -|spring.cloud.azure.keyvault.secret.retry.fixed.delay | | Amount of time to wait between retry attempts. -|spring.cloud.azure.keyvault.secret.retry.fixed.max-retries | | The maximum number of attempts. -|spring.cloud.azure.keyvault.secret.retry.mode | | Retry backoff mode. -|spring.cloud.azure.keyvault.secret.service-version | | Secret service version used when making API requests. - -|=== \ No newline at end of file diff --git a/docs/src/main/asciidoc/_configprops.adoc b/docs/src/main/asciidoc/_configuration-properties-all.adoc similarity index 92% rename from docs/src/main/asciidoc/_configprops.adoc rename to docs/src/main/asciidoc/_configuration-properties-all.adoc index fb576f00..5582077e 100644 --- a/docs/src/main/asciidoc/_configprops.adoc +++ b/docs/src/main/asciidoc/_configuration-properties-all.adoc @@ -46,6 +46,8 @@ |spring.cloud.azure.appconfiguration.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.appconfiguration.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.appconfiguration.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.appconfiguration.client.headers[0].name | | The name of the header. +|spring.cloud.azure.appconfiguration.client.headers[0].values | | List of values of the header. |spring.cloud.azure.appconfiguration.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.appconfiguration.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.appconfiguration.client.logging.level | | The level of detail to log on HTTP messages. @@ -110,6 +112,8 @@ |spring.cloud.azure.client.http.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.client.http.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.client.http.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.client.http.headers[0].name | | The name of the header. +|spring.cloud.azure.client.http.headers[0].values | | List of values of the header. |spring.cloud.azure.client.http.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.client.http.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.client.http.logging.level | | The level of detail to log on HTTP messages. @@ -278,6 +282,8 @@ |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.eventhubs.processor.checkpoint-store.client.headers[0].name | | The name of the header. +|spring.cloud.azure.eventhubs.processor.checkpoint-store.client.headers[0].values | | List of values of the header. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.logging.level | | The level of detail to log on HTTP messages. @@ -498,6 +504,8 @@ |spring.cloud.azure.keyvault.certificate.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.keyvault.certificate.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.keyvault.certificate.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.keyvault.certificate.client.headers[0].name | | The name of the header. +|spring.cloud.azure.keyvault.certificate.client.headers[0].values | | List of values of the header. |spring.cloud.azure.keyvault.certificate.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.keyvault.certificate.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.keyvault.certificate.client.logging.level | | The level of detail to log on HTTP messages. @@ -557,11 +565,14 @@ |spring.cloud.azure.keyvault.secret.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.keyvault.secret.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.keyvault.secret.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.keyvault.secret.client.headers[0].name | | The name of the header. +|spring.cloud.azure.keyvault.secret.client.headers[0].values | | List of values of the header. |spring.cloud.azure.keyvault.secret.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.keyvault.secret.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.keyvault.secret.client.logging.level | | The level of detail to log on HTTP messages. |spring.cloud.azure.keyvault.secret.client.logging.pretty-print-body | | Whether to pretty print the message bodies. |spring.cloud.azure.keyvault.secret.client.maximum-connection-pool-size | | Maximum connection pool size used by the underlying HTTP client. +|spring.cloud.azure.keyvault.secret.client.property-sources[0].response-timeout | | Amount of time used when waiting for a server to reply. |spring.cloud.azure.keyvault.secret.client.read-timeout | | Amount of time used when reading the server response. |spring.cloud.azure.keyvault.secret.client.response-timeout | | Amount of time used when waiting for a server to reply. |spring.cloud.azure.keyvault.secret.client.write-timeout | | Amount of time each request being sent over the wire. @@ -598,6 +609,68 @@ |spring.cloud.azure.keyvault.secret.profile.tenant-id | | Tenant id for Azure resources. |spring.cloud.azure.keyvault.secret.property-source-enabled | `true` | Whether to enable the Key Vault property source. |spring.cloud.azure.keyvault.secret.property-sources | | Azure Key Vault property sources. +|spring.cloud.azure.keyvault.secret.property-sources[0].case-sensitive | | Defines the constant for the property that enables/disables case-sensitive keys. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.application-id | | Represents current application and is used for telemetry/monitoring purposes. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.connection-idle-timeout | | Amount of time before an idle connection. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.headers[0].name | | The name of the header. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.headers[0].values | | List of values of the header. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.logging.level | | The level of detail to log on HTTP messages. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.logging.pretty-print-body | | Whether to pretty print the message bodies. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.maximum-connection-pool-size | | Maximum connection pool size used by the underlying HTTP client. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.read-timeout | | Amount of time used when reading the server response. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.write-timeout | | Amount of time each request being sent over the wire. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-certificate-password | | Password of the certificate file. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-certificate-path | | Path of a PEM certificate file to use when performing service principal authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-id | | Client id to use when performing service principal authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-secret | | Client secret to use when performing service principal authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.managed-identity-enabled | `false` | Whether to enable managed identity to authenticate with Azure. If true and the client-id is set, will use the client id as user assigned managed identity client id. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.password | | Password to use when performing username/password authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.username | | Username to use when performing username/password authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].enabled | `true` | Whether an Azure Service is enabled. +|spring.cloud.azure.keyvault.secret.property-sources[0].endpoint | | Azure Key Vault endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].name | | Name of this property source. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.cloud-type | | Name of the Azure cloud to connect to. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.active-directory-endpoint | | The Azure Active Directory endpoint to connect to. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.active-directory-graph-api-version | | The Azure Active Directory Graph API version. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.active-directory-graph-endpoint | | The Azure Active Directory Graph endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.active-directory-resource-id | | The Azure Active Directory resource id. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.azure-application-insights-endpoint | | The Azure Application Insights endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.azure-data-lake-analytics-catalog-and-job-endpoint-suffix | | The Data Lake analytics catalog and job endpoint suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.azure-data-lake-store-file-system-endpoint-suffix | | The Data Lake storage file system endpoint suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.azure-log-analytics-endpoint | | The Azure Log Analytics endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.data-lake-endpoint-resource-id | | The Data Lake endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.gallery-endpoint | | The gallery endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.key-vault-dns-suffix | | The Key Vault DNS suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.management-endpoint | | The management service endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.microsoft-graph-endpoint | | The Microsoft Graph endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.portal | | The management portal URL. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.publishing-profile | | The publishing settings file URL. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.resource-manager-endpoint | | The resource management endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.sql-management-endpoint | | The SQL management endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.sql-server-hostname-suffix | | The SQL Server hostname suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.storage-endpoint-suffix | | The Storage endpoint suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.subscription-id | | Subscription id to use when connecting to Azure resources. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.tenant-id | | Tenant id for Azure resources. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.hostname | | The host of the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.non-proxy-hosts | | A list of hosts or CIDR to not use proxy HTTP/HTTPS connections through. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.password | | Password used to authenticate with the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.port | | The port of the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.type | | Type of the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.username | | Username used to authenticate with the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].resource.region | | The region of an Azure resource. +|spring.cloud.azure.keyvault.secret.property-sources[0].resource.resource-group | | The resource group holds an Azure resource. +|spring.cloud.azure.keyvault.secret.property-sources[0].resource.resource-id | | ID of an Azure resource. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.exponential.base-delay | | Amount of time to wait between retry attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.exponential.max-delay | | Maximum permissible amount of time between retry attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.exponential.max-retries | | The maximum number of attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.fixed.delay | | Amount of time to wait between retry attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.fixed.max-retries | | The maximum number of attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.mode | | Retry backoff mode. +|spring.cloud.azure.keyvault.secret.property-sources[0].secret-keys | | The secret keys supported for this property source. +|spring.cloud.azure.keyvault.secret.property-sources[0].service-version | | Secret service version used when making API requests. |spring.cloud.azure.keyvault.secret.proxy.hostname | | The host of the proxy. |spring.cloud.azure.keyvault.secret.proxy.non-proxy-hosts | | A list of hosts or CIDR to not use proxy HTTP/HTTPS connections through. |spring.cloud.azure.keyvault.secret.proxy.password | | Password used to authenticate with the proxy. @@ -881,10 +954,10 @@ |spring.cloud.azure.servicebus.resource.resource-group | | The resource group holds an Azure resource. |spring.cloud.azure.servicebus.resource.resource-id | | ID of an Azure resource. |spring.cloud.azure.servicebus.retry-options.delay | | Amount of time to wait between retry attempts. This is a legacy property. -|spring.cloud.azure.servicebus.retry-options.maxDelay | | Maximum permissible amount of time between retry attempts. This is a legacy property. -|spring.cloud.azure.servicebus.retry-options.maxRetries | | The maximum number of attempts. This is a legacy property. -|spring.cloud.azure.servicebus.retry-options.retryMode | | The type of approach to apply when calculating the delay between retry attempts. This is a legacy property. -|spring.cloud.azure.servicebus.retry-options.tryTimeout | | Amount of time to wait until a timeout. This is a legacy property. +|spring.cloud.azure.servicebus.retry-options.max-delay | | Maximum permissible amount of time between retry attempts. This is a legacy property. +|spring.cloud.azure.servicebus.retry-options.max-retries | | The maximum number of attempts. This is a legacy property. +|spring.cloud.azure.servicebus.retry-options.retry-mode | | The type of approach to apply when calculating the delay between retry attempts. This is a legacy property. +|spring.cloud.azure.servicebus.retry-options.try-timeout | | Amount of time to wait until a timeout. This is a legacy property. |spring.cloud.azure.servicebus.retry.exponential.base-delay | | Amount of time to wait between retry attempts. |spring.cloud.azure.servicebus.retry.exponential.max-delay | | Maximum permissible amount of time between retry attempts. |spring.cloud.azure.servicebus.retry.exponential.max-retries | | The maximum number of attempts. @@ -902,6 +975,8 @@ |spring.cloud.azure.storage.blob.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.storage.blob.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.storage.blob.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.storage.blob.client.headers[0].name | | The name of the header. +|spring.cloud.azure.storage.blob.client.headers[0].values | | List of values of the header. |spring.cloud.azure.storage.blob.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.storage.blob.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.storage.blob.client.logging.level | | The level of detail to log on HTTP messages. @@ -970,6 +1045,8 @@ |spring.cloud.azure.storage.fileshare.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.storage.fileshare.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.storage.fileshare.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.storage.fileshare.client.headers[0].name | | The name of the header. +|spring.cloud.azure.storage.fileshare.client.headers[0].values | | List of values of the header. |spring.cloud.azure.storage.fileshare.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.storage.fileshare.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.storage.fileshare.client.logging.level | | The level of detail to log on HTTP messages. @@ -1038,6 +1115,8 @@ |spring.cloud.azure.storage.queue.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.storage.queue.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.storage.queue.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.storage.queue.client.headers[0].name | | The name of the header. +|spring.cloud.azure.storage.queue.client.headers[0].values | | List of values of the header. |spring.cloud.azure.storage.queue.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.storage.queue.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.storage.queue.client.logging.level | | The level of detail to log on HTTP messages. diff --git a/docs/src/main/asciidoc/_configprops_aadb2c.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-active-directory-b2c.adoc similarity index 100% rename from docs/src/main/asciidoc/_configprops_aadb2c.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-active-directory-b2c.adoc diff --git a/docs/src/main/asciidoc/_configprops_aad.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-active-directory.adoc similarity index 100% rename from docs/src/main/asciidoc/_configprops_aad.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-active-directory.adoc diff --git a/docs/src/main/asciidoc/_configprops_appconf.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-app-configuration.adoc similarity index 97% rename from docs/src/main/asciidoc/_configprops_appconf.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-app-configuration.adoc index e987f881..df919eb0 100644 --- a/docs/src/main/asciidoc/_configprops_appconf.adoc +++ b/docs/src/main/asciidoc/_configuration-properties-azure-app-configuration.adoc @@ -5,6 +5,8 @@ |spring.cloud.azure.appconfiguration.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.appconfiguration.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.appconfiguration.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.appconfiguration.client.headers[0].name | | The name of the header. +|spring.cloud.azure.appconfiguration.client.headers[0].values | | List of values of the header. |spring.cloud.azure.appconfiguration.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.appconfiguration.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.appconfiguration.client.logging.level | | The level of detail to log on HTTP messages. diff --git a/docs/src/main/asciidoc/_configprops_cosmos.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-cosmos-db.adoc similarity index 100% rename from docs/src/main/asciidoc/_configprops_cosmos.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-cosmos-db.adoc diff --git a/docs/src/main/asciidoc/_configprops_eventhubs.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-event-hubs.adoc similarity index 99% rename from docs/src/main/asciidoc/_configprops_eventhubs.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-event-hubs.adoc index b40aa854..c12214d5 100644 --- a/docs/src/main/asciidoc/_configprops_eventhubs.adoc +++ b/docs/src/main/asciidoc/_configuration-properties-azure-event-hubs.adoc @@ -80,6 +80,8 @@ |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.eventhubs.processor.checkpoint-store.client.headers[0].name | | The name of the header. +|spring.cloud.azure.eventhubs.processor.checkpoint-store.client.headers[0].values | | List of values of the header. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.eventhubs.processor.checkpoint-store.client.logging.level | | The level of detail to log on HTTP messages. diff --git a/docs/src/main/asciidoc/_configprops_kv_certificate.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-key-vault-certificates.adoc similarity index 97% rename from docs/src/main/asciidoc/_configprops_kv_certificate.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-key-vault-certificates.adoc index eb112a0e..1368d65e 100644 --- a/docs/src/main/asciidoc/_configprops_kv_certificate.adoc +++ b/docs/src/main/asciidoc/_configuration-properties-azure-key-vault-certificates.adoc @@ -5,6 +5,8 @@ |spring.cloud.azure.keyvault.certificate.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.keyvault.certificate.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.keyvault.certificate.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.keyvault.certificate.client.headers[0].name | | The name of the header. +|spring.cloud.azure.keyvault.certificate.client.headers[0].values | | List of values of the header. |spring.cloud.azure.keyvault.certificate.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.keyvault.certificate.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.keyvault.certificate.client.logging.level | | The level of detail to log on HTTP messages. diff --git a/docs/src/main/asciidoc/_configuration-properties-azure-key-vault-secrets.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-key-vault-secrets.adoc new file mode 100644 index 00000000..0b5c3efe --- /dev/null +++ b/docs/src/main/asciidoc/_configuration-properties-azure-key-vault-secrets.adoc @@ -0,0 +1,131 @@ +|=== +|Name | Default | Description + +|spring.cloud.azure.keyvault.secret.client.application-id | | Represents current application and is used for telemetry/monitoring purposes. +|spring.cloud.azure.keyvault.secret.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. +|spring.cloud.azure.keyvault.secret.client.connection-idle-timeout | | Amount of time before an idle connection. +|spring.cloud.azure.keyvault.secret.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.keyvault.secret.client.headers[0].name | | The name of the header. +|spring.cloud.azure.keyvault.secret.client.headers[0].values | | List of values of the header. +|spring.cloud.azure.keyvault.secret.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. +|spring.cloud.azure.keyvault.secret.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. +|spring.cloud.azure.keyvault.secret.client.logging.level | | The level of detail to log on HTTP messages. +|spring.cloud.azure.keyvault.secret.client.logging.pretty-print-body | | Whether to pretty print the message bodies. +|spring.cloud.azure.keyvault.secret.client.maximum-connection-pool-size | | Maximum connection pool size used by the underlying HTTP client. +|spring.cloud.azure.keyvault.secret.client.property-sources[0].response-timeout | | Amount of time used when waiting for a server to reply. +|spring.cloud.azure.keyvault.secret.client.read-timeout | | Amount of time used when reading the server response. +|spring.cloud.azure.keyvault.secret.client.response-timeout | | Amount of time used when waiting for a server to reply. +|spring.cloud.azure.keyvault.secret.client.write-timeout | | Amount of time each request being sent over the wire. +|spring.cloud.azure.keyvault.secret.credential.client-certificate-password | | Password of the certificate file. +|spring.cloud.azure.keyvault.secret.credential.client-certificate-path | | Path of a PEM certificate file to use when performing service principal authentication with Azure. +|spring.cloud.azure.keyvault.secret.credential.client-id | | Client id to use when performing service principal authentication with Azure. +|spring.cloud.azure.keyvault.secret.credential.client-secret | | Client secret to use when performing service principal authentication with Azure. +|spring.cloud.azure.keyvault.secret.credential.managed-identity-enabled | `false` | Whether to enable managed identity to authenticate with Azure. If true and the client-id is set, will use the client id as user assigned managed identity client id. +|spring.cloud.azure.keyvault.secret.credential.password | | Password to use when performing username/password authentication with Azure. +|spring.cloud.azure.keyvault.secret.credential.username | | Username to use when performing username/password authentication with Azure. +|spring.cloud.azure.keyvault.secret.enabled | `true` | Whether an Azure Service is enabled. +|spring.cloud.azure.keyvault.secret.endpoint | | Azure Key Vault endpoint. +|spring.cloud.azure.keyvault.secret.profile.cloud-type | | Name of the Azure cloud to connect to. +|spring.cloud.azure.keyvault.secret.profile.environment.active-directory-endpoint | | The Azure Active Directory endpoint to connect to. +|spring.cloud.azure.keyvault.secret.profile.environment.active-directory-graph-api-version | | The Azure Active Directory Graph API version. +|spring.cloud.azure.keyvault.secret.profile.environment.active-directory-graph-endpoint | | The Azure Active Directory Graph endpoint. +|spring.cloud.azure.keyvault.secret.profile.environment.active-directory-resource-id | | The Azure Active Directory resource id. +|spring.cloud.azure.keyvault.secret.profile.environment.azure-application-insights-endpoint | | The Azure Application Insights endpoint. +|spring.cloud.azure.keyvault.secret.profile.environment.azure-data-lake-analytics-catalog-and-job-endpoint-suffix | | The Data Lake analytics catalog and job endpoint suffix. +|spring.cloud.azure.keyvault.secret.profile.environment.azure-data-lake-store-file-system-endpoint-suffix | | The Data Lake storage file system endpoint suffix. +|spring.cloud.azure.keyvault.secret.profile.environment.azure-log-analytics-endpoint | | The Azure Log Analytics endpoint. +|spring.cloud.azure.keyvault.secret.profile.environment.data-lake-endpoint-resource-id | | The Data Lake endpoint. +|spring.cloud.azure.keyvault.secret.profile.environment.gallery-endpoint | | The gallery endpoint. +|spring.cloud.azure.keyvault.secret.profile.environment.key-vault-dns-suffix | | The Key Vault DNS suffix. +|spring.cloud.azure.keyvault.secret.profile.environment.management-endpoint | | The management service endpoint. +|spring.cloud.azure.keyvault.secret.profile.environment.microsoft-graph-endpoint | | The Microsoft Graph endpoint. +|spring.cloud.azure.keyvault.secret.profile.environment.portal | | The management portal URL. +|spring.cloud.azure.keyvault.secret.profile.environment.publishing-profile | | The publishing settings file URL. +|spring.cloud.azure.keyvault.secret.profile.environment.resource-manager-endpoint | | The resource management endpoint. +|spring.cloud.azure.keyvault.secret.profile.environment.sql-management-endpoint | | The SQL management endpoint. +|spring.cloud.azure.keyvault.secret.profile.environment.sql-server-hostname-suffix | | The SQL Server hostname suffix. +|spring.cloud.azure.keyvault.secret.profile.environment.storage-endpoint-suffix | | The Storage endpoint suffix. +|spring.cloud.azure.keyvault.secret.profile.subscription-id | | Subscription id to use when connecting to Azure resources. +|spring.cloud.azure.keyvault.secret.profile.tenant-id | | Tenant id for Azure resources. +|spring.cloud.azure.keyvault.secret.property-source-enabled | `true` | Whether to enable the Key Vault property source. +|spring.cloud.azure.keyvault.secret.property-sources | | Azure Key Vault property sources. +|spring.cloud.azure.keyvault.secret.property-sources[0].case-sensitive | | Defines the constant for the property that enables/disables case-sensitive keys. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.application-id | | Represents current application and is used for telemetry/monitoring purposes. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.connection-idle-timeout | | Amount of time before an idle connection. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.headers[0].name | | The name of the header. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.headers[0].values | | List of values of the header. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.logging.level | | The level of detail to log on HTTP messages. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.logging.pretty-print-body | | Whether to pretty print the message bodies. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.maximum-connection-pool-size | | Maximum connection pool size used by the underlying HTTP client. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.read-timeout | | Amount of time used when reading the server response. +|spring.cloud.azure.keyvault.secret.property-sources[0].client.write-timeout | | Amount of time each request being sent over the wire. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-certificate-password | | Password of the certificate file. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-certificate-path | | Path of a PEM certificate file to use when performing service principal authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-id | | Client id to use when performing service principal authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.client-secret | | Client secret to use when performing service principal authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.managed-identity-enabled | `false` | Whether to enable managed identity to authenticate with Azure. If true and the client-id is set, will use the client id as user assigned managed identity client id. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.password | | Password to use when performing username/password authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].credential.username | | Username to use when performing username/password authentication with Azure. +|spring.cloud.azure.keyvault.secret.property-sources[0].enabled | `true` | Whether an Azure Service is enabled. +|spring.cloud.azure.keyvault.secret.property-sources[0].endpoint | | Azure Key Vault endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].name | | Name of this property source. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.cloud-type | | Name of the Azure cloud to connect to. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.active-directory-endpoint | | The Azure Active Directory endpoint to connect to. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.active-directory-graph-api-version | | The Azure Active Directory Graph API version. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.active-directory-graph-endpoint | | The Azure Active Directory Graph endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.active-directory-resource-id | | The Azure Active Directory resource id. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.azure-application-insights-endpoint | | The Azure Application Insights endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.azure-data-lake-analytics-catalog-and-job-endpoint-suffix | | The Data Lake analytics catalog and job endpoint suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.azure-data-lake-store-file-system-endpoint-suffix | | The Data Lake storage file system endpoint suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.azure-log-analytics-endpoint | | The Azure Log Analytics endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.data-lake-endpoint-resource-id | | The Data Lake endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.gallery-endpoint | | The gallery endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.key-vault-dns-suffix | | The Key Vault DNS suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.management-endpoint | | The management service endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.microsoft-graph-endpoint | | The Microsoft Graph endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.portal | | The management portal URL. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.publishing-profile | | The publishing settings file URL. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.resource-manager-endpoint | | The resource management endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.sql-management-endpoint | | The SQL management endpoint. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.sql-server-hostname-suffix | | The SQL Server hostname suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.environment.storage-endpoint-suffix | | The Storage endpoint suffix. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.subscription-id | | Subscription id to use when connecting to Azure resources. +|spring.cloud.azure.keyvault.secret.property-sources[0].profile.tenant-id | | Tenant id for Azure resources. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.hostname | | The host of the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.non-proxy-hosts | | A list of hosts or CIDR to not use proxy HTTP/HTTPS connections through. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.password | | Password used to authenticate with the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.port | | The port of the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.type | | Type of the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].proxy.username | | Username used to authenticate with the proxy. +|spring.cloud.azure.keyvault.secret.property-sources[0].resource.region | | The region of an Azure resource. +|spring.cloud.azure.keyvault.secret.property-sources[0].resource.resource-group | | The resource group holds an Azure resource. +|spring.cloud.azure.keyvault.secret.property-sources[0].resource.resource-id | | ID of an Azure resource. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.exponential.base-delay | | Amount of time to wait between retry attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.exponential.max-delay | | Maximum permissible amount of time between retry attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.exponential.max-retries | | The maximum number of attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.fixed.delay | | Amount of time to wait between retry attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.fixed.max-retries | | The maximum number of attempts. +|spring.cloud.azure.keyvault.secret.property-sources[0].retry.mode | | Retry backoff mode. +|spring.cloud.azure.keyvault.secret.property-sources[0].secret-keys | | The secret keys supported for this property source. +|spring.cloud.azure.keyvault.secret.property-sources[0].service-version | | Secret service version used when making API requests. +|spring.cloud.azure.keyvault.secret.proxy.hostname | | The host of the proxy. +|spring.cloud.azure.keyvault.secret.proxy.non-proxy-hosts | | A list of hosts or CIDR to not use proxy HTTP/HTTPS connections through. +|spring.cloud.azure.keyvault.secret.proxy.password | | Password used to authenticate with the proxy. +|spring.cloud.azure.keyvault.secret.proxy.port | | The port of the proxy. +|spring.cloud.azure.keyvault.secret.proxy.type | | Type of the proxy. +|spring.cloud.azure.keyvault.secret.proxy.username | | Username used to authenticate with the proxy. +|spring.cloud.azure.keyvault.secret.resource.region | | The region of an Azure resource. +|spring.cloud.azure.keyvault.secret.resource.resource-group | | The resource group holds an Azure resource. +|spring.cloud.azure.keyvault.secret.resource.resource-id | | ID of an Azure resource. +|spring.cloud.azure.keyvault.secret.retry.exponential.base-delay | | Amount of time to wait between retry attempts. +|spring.cloud.azure.keyvault.secret.retry.exponential.max-delay | | Maximum permissible amount of time between retry attempts. +|spring.cloud.azure.keyvault.secret.retry.exponential.max-retries | | The maximum number of attempts. +|spring.cloud.azure.keyvault.secret.retry.fixed.delay | | Amount of time to wait between retry attempts. +|spring.cloud.azure.keyvault.secret.retry.fixed.max-retries | | The maximum number of attempts. +|spring.cloud.azure.keyvault.secret.retry.mode | | Retry backoff mode. +|spring.cloud.azure.keyvault.secret.service-version | | Secret service version used when making API requests. + +|=== \ No newline at end of file diff --git a/docs/src/main/asciidoc/_configprops_servicebus_jms.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-service-bus-jms.adoc similarity index 100% rename from docs/src/main/asciidoc/_configprops_servicebus_jms.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-service-bus-jms.adoc diff --git a/docs/src/main/asciidoc/_configprops_servicebus.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-service-bus.adoc similarity index 97% rename from docs/src/main/asciidoc/_configprops_servicebus.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-service-bus.adoc index 0b95e318..eb85a178 100644 --- a/docs/src/main/asciidoc/_configprops_servicebus.adoc +++ b/docs/src/main/asciidoc/_configuration-properties-azure-service-bus.adoc @@ -225,10 +225,10 @@ |spring.cloud.azure.servicebus.resource.resource-group | | The resource group holds an Azure resource. |spring.cloud.azure.servicebus.resource.resource-id | | ID of an Azure resource. |spring.cloud.azure.servicebus.retry-options.delay | | Amount of time to wait between retry attempts. This is a legacy property. -|spring.cloud.azure.servicebus.retry-options.maxDelay | | Maximum permissible amount of time between retry attempts. This is a legacy property. -|spring.cloud.azure.servicebus.retry-options.maxRetries | | The maximum number of attempts. This is a legacy property. -|spring.cloud.azure.servicebus.retry-options.retryMode | | The type of approach to apply when calculating the delay between retry attempts. This is a legacy property. -|spring.cloud.azure.servicebus.retry-options.tryTimeout | | Amount of time to wait until a timeout. This is a legacy property. +|spring.cloud.azure.servicebus.retry-options.max-delay | | Maximum permissible amount of time between retry attempts. This is a legacy property. +|spring.cloud.azure.servicebus.retry-options.max-retries | | The maximum number of attempts. This is a legacy property. +|spring.cloud.azure.servicebus.retry-options.retry-mode | | The type of approach to apply when calculating the delay between retry attempts. This is a legacy property. +|spring.cloud.azure.servicebus.retry-options.try-timeout | | Amount of time to wait until a timeout. This is a legacy property. |spring.cloud.azure.servicebus.retry.exponential.base-delay | | Amount of time to wait between retry attempts. |spring.cloud.azure.servicebus.retry.exponential.max-delay | | Maximum permissible amount of time between retry attempts. |spring.cloud.azure.servicebus.retry.exponential.max-retries | | The maximum number of attempts. diff --git a/docs/src/main/asciidoc/_configprops_storage_blob.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-storage-blob.adoc similarity index 97% rename from docs/src/main/asciidoc/_configprops_storage_blob.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-storage-blob.adoc index f8b24545..4d9d6352 100644 --- a/docs/src/main/asciidoc/_configprops_storage_blob.adoc +++ b/docs/src/main/asciidoc/_configuration-properties-azure-storage-blob.adoc @@ -8,6 +8,8 @@ |spring.cloud.azure.storage.blob.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.storage.blob.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.storage.blob.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.storage.blob.client.headers[0].name | | The name of the header. +|spring.cloud.azure.storage.blob.client.headers[0].values | | List of values of the header. |spring.cloud.azure.storage.blob.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.storage.blob.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.storage.blob.client.logging.level | | The level of detail to log on HTTP messages. diff --git a/docs/src/main/asciidoc/_configprops_storage_fileshare.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-storage-file-share.adoc similarity index 97% rename from docs/src/main/asciidoc/_configprops_storage_fileshare.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-storage-file-share.adoc index 0635f1b7..722f30d8 100644 --- a/docs/src/main/asciidoc/_configprops_storage_fileshare.adoc +++ b/docs/src/main/asciidoc/_configuration-properties-azure-storage-file-share.adoc @@ -7,6 +7,8 @@ |spring.cloud.azure.storage.fileshare.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.storage.fileshare.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.storage.fileshare.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.storage.fileshare.client.headers[0].name | | The name of the header. +|spring.cloud.azure.storage.fileshare.client.headers[0].values | | List of values of the header. |spring.cloud.azure.storage.fileshare.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.storage.fileshare.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.storage.fileshare.client.logging.level | | The level of detail to log on HTTP messages. diff --git a/docs/src/main/asciidoc/_configprops_storage_queue.adoc b/docs/src/main/asciidoc/_configuration-properties-azure-storage-queue.adoc similarity index 97% rename from docs/src/main/asciidoc/_configprops_storage_queue.adoc rename to docs/src/main/asciidoc/_configuration-properties-azure-storage-queue.adoc index a82e823d..f7d0189f 100644 --- a/docs/src/main/asciidoc/_configprops_storage_queue.adoc +++ b/docs/src/main/asciidoc/_configuration-properties-azure-storage-queue.adoc @@ -7,6 +7,8 @@ |spring.cloud.azure.storage.queue.client.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.storage.queue.client.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.storage.queue.client.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.storage.queue.client.headers[0].name | | The name of the header. +|spring.cloud.azure.storage.queue.client.headers[0].values | | List of values of the header. |spring.cloud.azure.storage.queue.client.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.storage.queue.client.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.storage.queue.client.logging.level | | The level of detail to log on HTTP messages. diff --git a/docs/src/main/asciidoc/_configprops_global.adoc b/docs/src/main/asciidoc/_configuration-properties-global.adoc similarity index 97% rename from docs/src/main/asciidoc/_configprops_global.adoc rename to docs/src/main/asciidoc/_configuration-properties-global.adoc index c09e6b5f..de7c1c44 100644 --- a/docs/src/main/asciidoc/_configprops_global.adoc +++ b/docs/src/main/asciidoc/_configuration-properties-global.adoc @@ -8,6 +8,8 @@ |spring.cloud.azure.client.http.connect-timeout | | Amount of time the request attempts to connect to the remote host and the connection is resolved. |spring.cloud.azure.client.http.connection-idle-timeout | | Amount of time before an idle connection. |spring.cloud.azure.client.http.headers | | Comma-delimited list of headers applied to each request sent with client. +|spring.cloud.azure.client.http.headers[0].name | | The name of the header. +|spring.cloud.azure.client.http.headers[0].values | | List of values of the header. |spring.cloud.azure.client.http.logging.allowed-header-names | | Comma-delimited list of whitelisted headers that should be logged. |spring.cloud.azure.client.http.logging.allowed-query-param-names | | Comma-delimited list of whitelisted query parameters. |spring.cloud.azure.client.http.logging.level | | The level of detail to log on HTTP messages. diff --git a/docs/src/main/asciidoc/appendix.adoc b/docs/src/main/asciidoc/appendix.adoc index 97c1669b..55b432ed 100644 --- a/docs/src/main/asciidoc/appendix.adoc +++ b/docs/src/main/asciidoc/appendix.adoc @@ -2,33 +2,33 @@ [appendix] == Configuration Properties === Global Properties -include::_configprops_global.adoc[] +include::_configuration-properties-global.adoc[] === Azure Active Directory Properties -include::_configprops_aad.adoc[] +include::_configuration-properties-azure-active-directory.adoc[] === Azure Active Directory B2C Properties -include::_configprops_aadb2c.adoc[] +include::_configuration-properties-azure-active-directory-b2c.adoc[] === Azure App Configuration Properties -include::_configprops_appconf.adoc[] +include::_configuration-properties-azure-app-configuration.adoc[] === Azure Cosmos Properties -include::_configprops_cosmos.adoc[] +include::_configuration-properties-azure-cosmos-db.adoc[] === Azure Event Hubs Properties -include::_configprops_eventhubs.adoc[] +include::_configuration-properties-azure-event-hubs.adoc[] === Azure Key Vault Secrets Properties -include::_configprops_kv_secret.adoc[] +include::_configuration-properties-azure-key-vault-secrets.adoc[] === Azure Key Vault Certificates Properties -include::_configprops_kv_certificate.adoc[] +include::_configuration-properties-azure-key-vault-certificates.adoc[] === Azure Service Bus Properties -include::_configprops_servicebus.adoc[] +include::_configuration-properties-azure-service-bus.adoc[] === Azure Service Bus JMS Properties -include::_configprops_servicebus_jms.adoc[] +include::_configuration-properties-azure-service-bus-jms.adoc[] === Azure Storage Blob Properties -include::_configprops_storage_blob.adoc[] +include::_configuration-properties-azure-storage-blob.adoc[] === Azure Storage File Share Properties -include::_configprops_storage_fileshare.adoc[] +include::_configuration-properties-azure-storage-file-share.adoc[] === Azure Storage Queue Properties -include::_configprops_storage_queue.adoc[] +include::_configuration-properties-azure-storage-queue.adoc[] === All Configuration Properties -include::_configprops.adoc[] +include::_configuration-properties-all.adoc[] [appendix] include::_migration-guide-for-4.0.adoc[] diff --git a/pom.xml b/pom.xml index 03696783..f7736335 100644 --- a/pom.xml +++ b/pom.xml @@ -48,6 +48,7 @@ docs + spring-cloud-azure-markdown-appdendix-generator @@ -109,6 +110,194 @@ + + org.codehaus.mojo + exec-maven-plugin + + + generate-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-all.adoc + spring.jms.servicebus.*|spring.cloud.azure.* + + + + + generate-global-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-global.adoc + spring.cloud.azure.(client|credential|profile|proxy|retry).* + + + + + generate-aad-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-active-directory.adoc + (?!spring.cloud.azure.active-directory.b2c.*)(spring.cloud.azure.active-directory.*) + + + + + generate-aadb2c-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-active-directory-b2c.adoc + spring.cloud.azure.active-directory.b2c.* + + + + + generate-appconf-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-app-configuration.adoc + spring.cloud.azure.appconfiguration.* + + + + + generate-cosmos-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-cosmos-db.adoc + spring.cloud.azure.cosmos.* + + + + + generate-eventhubs-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-event-hubs.adoc + spring.cloud.azure.eventhubs.* + + + + + generate-kv-secret-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-key-vault-secrets.adoc + spring.cloud.azure.keyvault.secret.* + + + + + generate-kv-certificate-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-key-vault-certificates.adoc + spring.cloud.azure.keyvault.certificate.* + + + + + generate-servicebus-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-service-bus.adoc + spring.cloud.azure.servicebus.* + + + + + generate-servicebus-jms-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-service-bus-jms.adoc + spring.jms.servicebus.* + + + + + generate-storage-blob-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-storage-blob.adoc + spring.cloud.azure.storage.blob.* + + + + + generate-storage-fileshare-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-storage-file-share.adoc + spring.cloud.azure.storage.fileshare.* + + + + + generate-storage-queue-configprops + prepare-package + + java + + + + ${project.basedir}/src/main/asciidoc/_configuration-properties-azure-storage-queue.adoc + spring.cloud.azure.storage.queue.* + + + + + diff --git a/spring-cloud-azure-markdown-appdendix-generator/pom.xml b/spring-cloud-azure-markdown-appdendix-generator/pom.xml new file mode 100644 index 00000000..6c81d1b1 --- /dev/null +++ b/spring-cloud-azure-markdown-appdendix-generator/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + + com.azure.spring + spring-cloud-azure-aggregator + 4.1.0 + ../pom.xml + + + spring-cloud-azure-markdown-appdendix-generator + spring-cloud-azure-markdown-appdendix-generator + jar + + + + com.azure.spring + spring-cloud-azure-starter + + + com.azure.spring + spring-cloud-azure-starter-stream-eventhubs + + + com.azure.spring + spring-cloud-azure-starter-stream-servicebus + + + + + markdown-docs + + + + org.codehaus.mojo + exec-maven-plugin + + com.azure.spring.cloud.internal.Main + + + + + + + + diff --git a/spring-cloud-azure-markdown-appdendix-generator/src/main/java/com/azure/spring/cloud/internal/Main.java b/spring-cloud-azure-markdown-appdendix-generator/src/main/java/com/azure/spring/cloud/internal/Main.java new file mode 100644 index 00000000..1b257063 --- /dev/null +++ b/spring-cloud-azure-markdown-appdendix-generator/src/main/java/com/azure/spring/cloud/internal/Main.java @@ -0,0 +1,265 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.azure.spring.cloud.internal; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.util.StreamUtils; + +/** + * Generate markdown files with configuration properties based on the path of the file to + * be output and the pattern included in the properties. + */ +public final class Main { + + private Main() { + } + + /** + * This method is used to generate configuration properties Markdown files. + * @param args args[0]: output file name. The file name must start with + * "_configuration-properties-". And in actual outputted file name, ".adoc" will be + * replaced by ".md", "_" will be replaced by "". For example: + * "_configuration-properties-global.adoc" after the replacement is + * "configuration-properties-global.md". This is required because this module and the + * docs' module use the configuration of the parent pom and changes to configuration + * properties need to be synced to MS Docs. args[1]: property inclusion pattern. + * Filter unwanted properties based on patterns. + */ + public static void main(String... args) { + String outputFile = args[0].replace("adoc", "md").replace("_", ""); + String inclusionPattern = args.length > 1 ? args[1] : ".*"; + File parent = new File(outputFile).getParentFile(); + if (!parent.exists()) { + System.out.println( + "No parent directory [" + parent + "] found. Will not generate the configuration properties file"); + return; + } + new Generator().generate(outputFile, inclusionPattern, getCurrentDateString()); + } + + /** + * Get current date string. + * @return the current date string + */ + static String getCurrentDateString() { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(); + simpleDateFormat.applyPattern("MM/dd/yyyy"); + Date date = new Date(); + return simpleDateFormat.format(date); + } + + /** + * Generate Markdown files based on properties and filename. + */ + static class Generator { + + /** + * Generate files prefixed with configuration-properties. + * @param outputFile the file name must start with "configuration-properties-" + * @param inclusionPattern the inclusion pattern + * @param date the current date string + */ + void generate(String outputFile, String inclusionPattern, String date) { + try { + System.out.println("Parsing all configuration metadata"); + List resources = getSpringConfigurationMetadataJsonFilesInClasspath(); + TreeMap descriptions = new TreeMap<>(); + int propertyCount = 0; + Pattern pattern = Pattern.compile(inclusionPattern); + ObjectMapper objectMapper = new ObjectMapper(); + for (Resource resource : resources) { + byte[] bytes = StreamUtils.copyToByteArray(resource.getInputStream()); + Map rootMap = objectMapper.readValue(bytes, HashMap.class); + List> properties = (List>) rootMap.get("properties"); + propertyCount += properties.size(); + properties.forEach(propertyItem -> { + String name = String.valueOf(propertyItem.get("name")); + if (!pattern.matcher(name).matches()) { + return; + } + String description = String.valueOf(propertyItem.get("description")); + String defaultValue = String.valueOf(propertyItem.get("defaultValue")); + descriptions.put(name, defaultValue == null || defaultValue.equals("null") ? description + : description + " The default value is " + "`" + defaultValue + "`" + "."); + }); + } + System.out.println("Found [" + resources.size() + "] Azure projects configuration metadata jsons. [" + + descriptions.size() + "/" + propertyCount + "] were matching the pattern [" + inclusionPattern + + "]"); + System.out.println("Successfully built the description table"); + if (descriptions.isEmpty()) { + System.out.println("Will not update the table, since no configuration properties were found!"); + return; + } + generatePropertiesFile(outputFile, descriptions, date); + } + catch (IOException e) { + throw new IllegalStateException(e); + } + } + + /** + * Get Spring on Azure related "spring-configuration-metadata.json" files in + * classpath. + * @return a result set containing the specified fields + * @throws IOException did not get any "spring-configuration-metadata.json" files + * in classpath + */ + protected List getSpringConfigurationMetadataJsonFilesInClasspath() throws IOException { + Resource[] resources = new PathMatchingResourcePatternResolver() + .getResources("classpath*:/META-INF/spring-configuration-metadata.json"); + return Arrays.stream(resources).filter(resource -> { + try { + return resource.getURL().toString().contains("azure"); + } + catch (IOException e) { + e.printStackTrace(); + } + return false; + }).collect(Collectors.toList()); + } + + /** + * Padding the string to the required length. + * @param string the string to padding + * @param c the padding content + * @param resultLength the length of padding + * @return the required length + */ + private String paddingWithChar(String string, char c, int resultLength) { + String result = String.format("%1$-" + resultLength + "s", string.trim()); + if (' ' != c) { + return result.replace(' ', c); + } + return result; + } + + /** + * Uppercase string. + * @param letters the uppercase string required + * @return the uppercase string + */ + private String uppercaseString(String letters) { + if ("db".equals(letters) | "jms".equals(letters) | "b2c".equals(letters)) { + return letters.toUpperCase(); + } + else { + return letters.substring(0, 1).toUpperCase().concat(letters.substring(1)); + } + } + + /** + * Generate title name for markdown files. + * @param outputFile the output file name + * @return the title name + */ + private String generateTitleName(String outputFile) { + outputFile = outputFile + .substring(outputFile.lastIndexOf(File.separator) + "_configuration-properties-".length(), + outputFile.lastIndexOf(".")) + .replace('-', ' ').trim(); + if ("all".equals(outputFile)) { + return "List of configuration"; + } + String[] value = outputFile.split(" "); + StringBuilder result = new StringBuilder(" "); + for (String s : value) { + result.append(uppercaseString(s)).append(" "); + } + return result.toString().trim(); + } + + /** + * Compare the lengths of elements in the given result set and return the max + * length. + * @param stringStream the result sets to compare + * @return the max length + */ + private int getMaxLength(Stream stringStream) { + return stringStream.map(String::trim).mapToInt(String::length).max().orElse(0); + } + + /** + * Generate properties markdown files. + * @param outputFile the output file + * @param descriptions the result set of properties and their descriptions + * @param date the current date string + */ + private void generatePropertiesFile(String outputFile, TreeMap descriptions, String date) { + int nameColumnWidth = getMaxLength(descriptions.keySet().stream()); + int descriptionColumnWidth = getMaxLength(descriptions.values().stream()); + Path path = Paths.get(outputFile); + try (BufferedWriter writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) { + writer.write("---"); + writer.newLine(); + writer.write("ms.author: v-yonghuiye"); + writer.newLine(); + writer.write("ms.date: " + date); + writer.newLine(); + writer.write("---"); + writer.newLine(); + writer.newLine(); + writer.write("## " + generateTitleName(outputFile) + " properties"); + writer.newLine(); + writer.newLine(); + writer.write("> [!div class=\"mx-tdBreakAll\"]"); + writer.newLine(); + String propertyHeader = paddingWithChar("Property", ' ', nameColumnWidth + 1); + String descriptionHeader = paddingWithChar("Description", ' ', descriptionColumnWidth + 1); + writer.write("> | " + propertyHeader + "| " + descriptionHeader + "|"); + writer.newLine(); + String markdownTableCol1 = paddingWithChar("", '-', nameColumnWidth + 2); + String markdownTableCol2 = paddingWithChar("", '-', descriptionColumnWidth + 2); + writer.write("> |" + markdownTableCol1 + "|" + markdownTableCol2 + "|"); + writer.newLine(); + for (Map.Entry description : descriptions.entrySet()) { + String nameCol = paddingWithChar(description.getKey(), ' ', nameColumnWidth); + String descriptionCol = paddingWithChar(description.getValue(), ' ', descriptionColumnWidth); + writer.write("> | " + nameCol + " | " + descriptionCol + " |"); + writer.newLine(); + } + } + catch (IOException e) { + e.printStackTrace(); + } + System.out.println("Successfully stored the output Markdown file!"); + } + + } + +} diff --git a/spring-cloud-azure-markdown-appdendix-generator/src/test/java/com/azure/spring/cloud/internal/GeneratorTests.java b/spring-cloud-azure-markdown-appdendix-generator/src/test/java/com/azure/spring/cloud/internal/GeneratorTests.java new file mode 100644 index 00000000..e2c9bf11 --- /dev/null +++ b/spring-cloud-azure-markdown-appdendix-generator/src/test/java/com/azure/spring/cloud/internal/GeneratorTests.java @@ -0,0 +1,100 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.azure.spring.cloud.internal; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; + +import static org.assertj.core.api.BDDAssertions.then; + +class GeneratorTests { + + private static final String DATE = "MM/dd/yyyy"; + + private static final String INCLUSION_PATTERN = "spring.cloud.azure.*"; + + @BeforeEach + public void before() { + File file = getOutputFilePath(); + if (file.delete()) { + System.out.println("File deleted!"); + } + } + + @Test + void notCreateFileWhenNoPropertiesFound() { + Main.Generator generator = new Main.Generator() { + @Override + protected List getSpringConfigurationMetadataJsonFilesInClasspath() { + return new ArrayList<>(); + } + }; + File file = getOutputFilePath(); + String outputFile = file.getPath(); + generator.generate(outputFile, INCLUSION_PATTERN, DATE); + then(file).doesNotExist(); + } + + @Test + void createFileWhenPropertiesFound() throws IOException { + Main.Generator generator = new Main.Generator() { + @Override + protected List getSpringConfigurationMetadataJsonFilesInClasspath() throws IOException { + Resource[] resources = new PathMatchingResourcePatternResolver() + .getResources("/with-azure-in-name.json"); + return Arrays.asList(resources); + } + }; + File file = getOutputFilePath(); + String outputFile = file.getPath(); + generator.generate(outputFile, INCLUSION_PATTERN, DATE); + then(file).exists(); + compareFile(outputFile); + } + + private void compareFile(String file2) throws IOException { + try (BufferedInputStream inFile1 = new BufferedInputStream( + new FileInputStream("src/test/resources/configuration-properties-output.md")); + BufferedInputStream inFile2 = new BufferedInputStream(new FileInputStream(file2))) { + Assertions.assertThat(inFile1).hasSameContentAs(inFile2); + } + } + + private File getOutputFilePath() { + URL root = this.getClass().getResource("."); + if (root == null) { + throw new IllegalArgumentException("The output file path is not found!"); + } + else { + return new File(root.getPath(), "configuration-properties-output.md"); + } + } + +} diff --git a/spring-cloud-azure-markdown-appdendix-generator/src/test/java/com/azure/spring/cloud/internal/MainTests.java b/spring-cloud-azure-markdown-appdendix-generator/src/test/java/com/azure/spring/cloud/internal/MainTests.java new file mode 100644 index 00000000..0e61df38 --- /dev/null +++ b/spring-cloud-azure-markdown-appdendix-generator/src/test/java/com/azure/spring/cloud/internal/MainTests.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.azure.spring.cloud.internal; + +import java.io.File; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.BDDAssertions.then; + +class MainTests { + + @Test + void notCreateFileWhenNoParentDirectoryFound() { + File nonExistantFile = new File("/this/file/does/not/exist"); + Main.main(nonExistantFile.getAbsolutePath()); + then(nonExistantFile).doesNotExist(); + } + +} diff --git a/spring-cloud-azure-markdown-appdendix-generator/src/test/resources/configuration-properties-output.md b/spring-cloud-azure-markdown-appdendix-generator/src/test/resources/configuration-properties-output.md new file mode 100644 index 00000000..9df2414c --- /dev/null +++ b/spring-cloud-azure-markdown-appdendix-generator/src/test/resources/configuration-properties-output.md @@ -0,0 +1,13 @@ +--- +ms.author: v-yonghuiye +ms.date: MM/dd/yyyy +--- + +## Output properties + +> [!div class="mx-tdBreakAll"] +> | Property | Description | +> |------------------------------------|--------------------------------------------------| +> | spring.cloud.azure.first-property | First Description. The default value is `false`. | +> | spring.cloud.azure.fourth-property | Fourth Description. | +> | spring.cloud.azure.second-property | Second Description. The default value is `true`. | diff --git a/spring-cloud-azure-markdown-appdendix-generator/src/test/resources/with-azure-in-name.json b/spring-cloud-azure-markdown-appdendix-generator/src/test/resources/with-azure-in-name.json new file mode 100644 index 00000000..21c102b2 --- /dev/null +++ b/spring-cloud-azure-markdown-appdendix-generator/src/test/resources/with-azure-in-name.json @@ -0,0 +1,27 @@ +{ + "properties": [ + { + "defaultValue": "false", + "name": "spring.cloud.azure.first-property", + "description": "First Description.", + "type": "java.lang.Boolean" + }, + { + "defaultValue": "true", + "name": "spring.cloud.azure.second-property", + "description": "Second Description.", + "type": "java.lang.Boolean" + }, + { + "defaultValue": "true", + "name": "spring.cloud.third-property", + "description": "Third Description.", + "type": "java.lang.Boolean" + }, + { + "name": "spring.cloud.azure.fourth-property", + "description": "Fourth Description.", + "type": "java.lang.Boolean" + } + ] +}