Repository: helidon-io/helidon (java)

Issue:
4.x: Docs - Security http basic auth documentation mentions wrong property
## Environment Details
* Helidon Version: 4.x
* Helidon SE or Helidon MP
* JDK version: 21
* OS:
* Docker version (if applicable):

----------

## Problem Description

Current documentation uses : 
 - `HttpBasicAuthProvider.EP_PROPERTY_OUTBOUND_USER` instead of `EndpointConfig.PROPERTY_OUTBOUND_ID`
 - `HttpBasicAuthProvider.EP_PROPERTY_OUTBOUND_PASSWORD` instead of `EndpointConfig.PROPERTY_OUTBOUND_SECRET`



Pull request:
4.x: Docs - fix Security http basic authentication property
### Description

fix #7975

### Documentation

updated in this PR


Patch:
diff --git a/archetypes/helidon/src/main/archetype/mp/custom/database-outputs.xml b/archetypes/helidon/src/main/archetype/mp/custom/database-outputs.xml
index 9c9d3e09e2..f89aabfe3d 100644
--- a/archetypes/helidon/src/main/archetype/mp/custom/database-outputs.xml
+++ b/archetypes/helidon/src/main/archetype/mp/custom/database-outputs.xml
@@ -306,8 +306,8 @@ docker run --rm --name mysql -p 3306:3306 \
                     </list>
                     <list key="dependencies">
                         <map>
-                            <value key="groupId">mysql</value>
-                            <value key="artifactId">mysql-connector-java</value>
+                            <value key="groupId">com.mysql</value>
+                            <value key="artifactId">mysql-connector-j</value>
                             <value key="scope">runtime</value>
                         </map>
                     </list>
diff --git a/archetypes/helidon/src/main/archetype/se/custom/database-output.xml b/archetypes/helidon/src/main/archetype/se/custom/database-output.xml
index 7d0b7622a4..5e4135c609 100644
--- a/archetypes/helidon/src/main/archetype/se/custom/database-output.xml
+++ b/archetypes/helidon/src/main/archetype/se/custom/database-output.xml
@@ -61,8 +61,8 @@ For details, see https://www.h2database.com/html/cheatSheet.html
                             <value key="artifactId">helidon-integrations-db-mysql</value>
                         </map>
                         <map>
-                            <value key="groupId">mysql</value>
-                            <value key="artifactId">mysql-connector-java</value>
+                            <value key="groupId">com.mysql</value>
+                            <value key="artifactId">mysql-connector-j</value>
                         </map>
                     </list>
                     <value key="db-health-check-stmt" if="${health}">SELECT 0</value>
diff --git a/common/socket/src/main/java/io/helidon/common/socket/SocketOptionsBlueprint.java b/common/socket/src/main/java/io/helidon/common/socket/SocketOptionsBlueprint.java
index c487c778a2..4fc8d864eb 100644
--- a/common/socket/src/main/java/io/helidon/common/socket/SocketOptionsBlueprint.java
+++ b/common/socket/src/main/java/io/helidon/common/socket/SocketOptionsBlueprint.java
@@ -23,6 +23,7 @@ import java.net.SocketOption;
 import java.net.StandardSocketOptions;
 import java.time.Duration;
 import java.util.Map;
+import java.util.Optional;
 
 import io.helidon.builder.api.Option;
 import io.helidon.builder.api.Prototype;
@@ -67,8 +68,8 @@ interface SocketOptionsBlueprint {
      * @return buffer size, in bytes
      * @see java.net.StandardSocketOptions#SO_RCVBUF
      */
-    @ConfiguredOption("32768")
-    int socketReceiveBufferSize();
+    @ConfiguredOption
+    Optional<Integer> socketReceiveBufferSize();
 
     /**
      * Socket send buffer size.
@@ -76,8 +77,8 @@ interface SocketOptionsBlueprint {
      * @return buffer size, in bytes
      * @see java.net.StandardSocketOptions#SO_SNDBUF
      */
-    @ConfiguredOption("32768")
-    int socketSendBufferSize();
+    @ConfiguredOption
+    Optional<Integer> socketSendBufferSize();
 
     /**
      * Socket reuse address.
@@ -129,8 +130,8 @@ interface SocketOptionsBlueprint {
     class BuilderDecorator implements Prototype.BuilderDecorator<SocketOptions.BuilderBase<?, ?>> {
         @Override
         public void decorate(SocketOptions.BuilderBase<?, ?> target) {
-            target.putSocketOption(StandardSocketOptions.SO_RCVBUF, target.socketReceiveBufferSize());
-            target.putSocketOption(StandardSocketOptions.SO_SNDBUF, target.socketSendBufferSize());
+            target.socketReceiveBufferSize().ifPresent(i -> target.putSocketOption(StandardSocketOptions.SO_RCVBUF, i));
+            target.socketSendBufferSize().ifPresent(i -> target.putSocketOption(StandardSocketOptions.SO_SNDBUF, i));
             target.putSocketOption(StandardSocketOptions.SO_REUSEADDR, target.socketReuseAddress());
             target.putSocketOption(StandardSocketOptions.SO_KEEPALIVE, target.socketKeepAlive());
             target.putSocketOption(StandardSocketOptions.TCP_NODELAY, target.tcpNoDelay());
diff --git a/dependencies/pom.xml b/dependencies/pom.xml
index b428a54bab..7023bf6356 100644
--- a/dependencies/pom.xml
+++ b/dependencies/pom.xml
@@ -121,7 +121,7 @@
         <version.lib.microstream>08.01.01-MS-GA</version.lib.microstream>
         <version.lib.mongodb>4.10.2</version.lib.mongodb>
         <version.lib.mssql-jdbc>8.4.1.jre8</version.lib.mssql-jdbc>
-        <version.lib.mysql-connector-java>8.0.28</version.lib.mysql-connector-java>
+        <version.lib.mysql-connector-j>8.2.0</version.lib.mysql-connector-j>
         <version.lib.narayana>7.0.0.Final</version.lib.narayana>
         <version.lib.neo4j>5.12.0</version.lib.neo4j>
         <version.lib.netty>4.1.100.Final</version.lib.netty>
@@ -810,9 +810,9 @@
                 <version>${version.lib.h2}</version>
             </dependency>
             <dependency>
-                <groupId>mysql</groupId>
-                <artifactId>mysql-connector-java</artifactId>
-                <version>${version.lib.mysql-connector-java}</version>
+                <groupId>com.mysql</groupId>
+                <artifactId>mysql-connector-j</artifactId>
+                <version>${version.lib.mysql-connector-j}</version>
             </dependency>
             <dependency>
                 <groupId>org.postgresql</groupId>
diff --git a/docs/includes/security/providers/http-basic-auth.adoc b/docs/includes/security/providers/http-basic-auth.adoc
index 7c14afb8d9..26691c230d 100644
--- a/docs/includes/security/providers/http-basic-auth.adoc
+++ b/docs/includes/security/providers/http-basic-auth.adoc
@@ -89,8 +89,8 @@ Subject is created based on the username and roles provided by the user store.
 When identity propagation is configured, there are several options for identifying username and password to propagate:
 
 1. We propagate the current username and password (inbound request must be authenticated using basic authentication).
-2. We use username and password from an explicitly configured property (See `HttpBasicAuthProvider.EP_PROPERTY_OUTBOUND_USER`
-    and `HttpBasicAuthProvider.EP_PROPERTY_OUTBOUND_PASSWORD`)
+2. We use username and password from an explicitly configured property (See `EndpointConfig.PROPERTY_OUTBOUND_ID`
+    and `EndpointConfig.PROPERTY_OUTBOUND_SECRET`)
 3. We use username and password associated with an outbound target (see example configuration above)
 
 Identity is propagated only if:
diff --git a/docs/includes/security/providers/http-digest-auth.adoc b/docs/includes/security/providers/http-digest-auth.adoc
index 88db728295..e9bfd4ad91 100644
--- a/docs/includes/security/providers/http-digest-auth.adoc
+++ b/docs/includes/security/providers/http-digest-auth.adoc
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 
-    Copyright (c) 2018, 2022 Oracle and/or its affiliates.
+    Copyright (c) 2018, 2023 Oracle and/or its affiliates.
 
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ Java service loader service `io.helidon.security.providers.httpauth.spi.UserStor
  users to the provider, such as when validated against an internal database or LDAP server.
 The user store is defined so you never need the clear text password of the user.
 
-_Note on security of HTTP Digest Authenticaton_
+_Note on security of HTTP Digest Authentication_
 
 These authentication schemes
 should be _obsolete_, though they provide a very easy way to test a protected resource.
diff --git a/docs/sitegen.yaml b/docs/sitegen.yaml
index a1401af214..875c8e9229 100644
--- a/docs/sitegen.yaml
+++ b/docs/sitegen.yaml
@@ -451,6 +451,12 @@ backend:
                 glyph:
                   type: "icon"
                   value: "outbox"
+              - type: "PAGE"
+                title: "Testing"
+                source: "testing.adoc"
+                glyph:
+                  type: "icon"
+                  value: "thumbs_up_down"
               - type: "PAGE"
                 title: "Tracing"
                 source: "tracing.adoc"
diff --git a/examples/dbclient/jdbc/pom.xml b/examples/dbclient/jdbc/pom.xml
index f9b8f33998..aeefe4db30 100644
--- a/examples/dbclient/jdbc/pom.xml
+++ b/examples/dbclient/jdbc/pom.xml
@@ -68,8 +68,8 @@
         </dependency>
 <!--
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
         </dependency>
 -->
 <!--
diff --git a/examples/dbclient/pokemons/pom.xml b/examples/dbclient/pokemons/pom.xml
index 6ae1b94407..f067b9607a 100644
--- a/examples/dbclient/pokemons/pom.xml
+++ b/examples/dbclient/pokemons/pom.xml
@@ -78,12 +78,6 @@
             <groupId>io.helidon.integrations.db</groupId>
             <artifactId>h2</artifactId>
         </dependency>
-<!--
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
--->
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-jdk14</artifactId>
diff --git a/examples/integrations/cdi/datasource-hikaricp-mysql/pom.xml b/examples/integrations/cdi/datasource-hikaricp-mysql/pom.xml
index 9d5fdd66c6..61df50f3b3 100644
--- a/examples/integrations/cdi/datasource-hikaricp-mysql/pom.xml
+++ b/examples/integrations/cdi/datasource-hikaricp-mysql/pom.xml
@@ -51,8 +51,8 @@
 
         <!-- Runtime-scoped dependencies. -->
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
             <scope>runtime</scope>
             <optional>true</optional>
         </dependency>
diff --git a/integrations/db/mysql/pom.xml b/integrations/db/mysql/pom.xml
index 3515436262..7f4206ee60 100644
--- a/integrations/db/mysql/pom.xml
+++ b/integrations/db/mysql/pom.xml
@@ -36,8 +36,8 @@
 
     <dependencies>
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
             <scope>provided</scope>
         </dependency>
     </dependencies>
diff --git a/metrics/providers/micrometer/src/main/java/io/helidon/metrics/providers/micrometer/MicrometerPrometheusFormatter.java b/metrics/providers/micrometer/src/main/java/io/helidon/metrics/providers/micrometer/MicrometerPrometheusFormatter.java
index ebad78514a..c8aa27050f 100644
--- a/metrics/providers/micrometer/src/main/java/io/helidon/metrics/providers/micrometer/MicrometerPrometheusFormatter.java
+++ b/metrics/providers/micrometer/src/main/java/io/helidon/metrics/providers/micrometer/MicrometerPrometheusFormatter.java
@@ -131,10 +131,10 @@ public class MicrometerPrometheusFormatter implements MeterRegistryFormatter {
                 return Optional.empty();
             }
 
-            String prometheusOutput = filter(prometheusMeterRegistry.get()
-                                                     .scrape(MicrometerPrometheusFormatter.MEDIA_TYPE_TO_FORMAT.get(
-                                                                     resultMediaType),
-                                                             meterNamesOfInterest));
+            String prometheusOutput = prometheusMeterRegistry.get()
+                    .scrape(MicrometerPrometheusFormatter.MEDIA_TYPE_TO_FORMAT.get(
+                                    resultMediaType),
+                            meterNamesOfInterest);
 
             return prometheusOutput.isBlank() ? Optional.empty() : Optional.of(prometheusOutput);
         }
@@ -218,16 +218,6 @@ public class MicrometerPrometheusFormatter implements MeterRegistryFormatter {
         return result;
     }
 
-    /**
-     * Filter the Prometheus-format report.
-     *
-     * @param output Prometheus-format report
-     * @return output filtered
-     */
-    private static String filter(String output) {
-        return output.replaceFirst("# EOF\r?\n?", "");
-    }
-
     private static Optional<PrometheusMeterRegistry> prometheusMeterRegistry(MeterRegistry meterRegistry) {
         io.micrometer.core.instrument.MeterRegistry mMeterRegistry =
                 meterRegistry.unwrap(io.micrometer.core.instrument.MeterRegistry.class);


Test patch:
diff --git a/docs/se/testing.adoc b/docs/se/testing.adoc
index d6dd3d106f..db7f71379b 100644
--- a/docs/se/testing.adoc
+++ b/docs/se/testing.adoc
@@ -41,9 +41,9 @@ include::{rootdir}/includes/dependencies.adoc[]
 [source,xml]
 ----
 <dependency>
-    <groupId>io.helidon.testing.junit5</groupId>
-    <artifactId>helidon-testing-junit5-webserver</artifactId>
-    <scope>test</scope>
+     <groupId>io.helidon.webserver.testing.junit5</groupId>
+     <artifactId>helidon-webserver-testing-junit5</artifactId>
+     <scope>test</scope>
 </dependency>
 ----
 
diff --git a/metrics/providers/micrometer/src/test/java/io/helidon/metrics/providers/micrometer/TestPrometheusFormatting.java b/metrics/providers/micrometer/src/test/java/io/helidon/metrics/providers/micrometer/TestPrometheusFormatting.java
index ac00f6e0c1..10a98c3103 100644
--- a/metrics/providers/micrometer/src/test/java/io/helidon/metrics/providers/micrometer/TestPrometheusFormatting.java
+++ b/metrics/providers/micrometer/src/test/java/io/helidon/metrics/providers/micrometer/TestPrometheusFormatting.java
@@ -19,6 +19,7 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
+import io.helidon.common.media.type.MediaTypes;
 import io.helidon.common.testing.junit5.OptionalMatcher;
 import io.helidon.metrics.api.Counter;
 import io.helidon.metrics.api.MeterRegistry;
@@ -36,6 +37,7 @@ import org.junit.jupiter.api.Test;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.allOf;
 import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.endsWith;
 import static org.hamcrest.Matchers.instanceOf;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.not;
@@ -43,6 +45,13 @@ import static org.hamcrest.Matchers.not;
 class TestPrometheusFormatting {
 
     private static final String SCOPE_TAG_NAME = "this-scope";
+
+    /*
+    Only OpenMetrics format, not the Prometheus exposition format, has the trailing EOF which (for example) the Prometheus
+    server expects to see when it probes targets. That's why, below, when we format the output, we specify OpenMetrics as the
+    media type.
+     */
+    private static final String OPENMETRICS_EOF = "# EOF\n";
     private static MeterRegistry meterRegistry;
 
     private static MetricsConfig metricsConfig;
@@ -87,13 +96,15 @@ class TestPrometheusFormatting {
         e.record(2, TimeUnit.SECONDS);
 
         MicrometerPrometheusFormatter formatter = MicrometerPrometheusFormatter.builder(meterRegistry)
+                .resultMediaType(MediaTypes.APPLICATION_OPENMETRICS_TEXT)
                 .scopeTagName(SCOPE_TAG_NAME)
                 .build();
         Optional<Object> outputOpt = formatter.format();
 
         assertThat("Formatted output",
                    checkAndCast(outputOpt),
-                   allOf(containsString(scopeExpr("c1_total",
+                   allOf(
+                           containsString(scopeExpr("c1_total",
                                                   "this_scope",
                                                   "app",
                                                   "1.0")),
@@ -108,7 +119,9 @@ class TestPrometheusFormatting {
                          containsString(scopeExpr("t1_1_seconds_count",
                                                   "this_scope",
                                                   "app",
-                                                  "1.0"))));
+                                                  "1.0")),
+                         endsWith(OPENMETRICS_EOF)));
+
     }
 
     @Test
@@ -122,6 +135,7 @@ class TestPrometheusFormatting {
         d.record(7, TimeUnit.SECONDS);
 
         MicrometerPrometheusFormatter formatter = MicrometerPrometheusFormatter.builder(meterRegistry)
+                .resultMediaType(MediaTypes.APPLICATION_OPENMETRICS_TEXT)
                 .scopeTagName(SCOPE_TAG_NAME)
                 .meterNameSelection(Set.of("c2"))
                 .build();
@@ -139,7 +153,8 @@ class TestPrometheusFormatting {
                                                       "1.0"))),
                          not(containsString(scopeExpr("t2_seconds_sum",
                                                       "this_scope",
-                                                      "app", "7.0")))));
+                                                      "app", "7.0"))),
+                         endsWith(OPENMETRICS_EOF)));
 
     }
 
@@ -159,6 +174,7 @@ class TestPrometheusFormatting {
         e.record(2, TimeUnit.SECONDS);
 
         MicrometerPrometheusFormatter formatter = MicrometerPrometheusFormatter.builder(meterRegistry)
+                .resultMediaType(MediaTypes.APPLICATION_OPENMETRICS_TEXT)
                 .scopeTagName(SCOPE_TAG_NAME)
                 .scopeSelection(Set.of("app"))
                 .build();
@@ -182,11 +198,12 @@ class TestPrometheusFormatting {
                          containsString(scopeExpr("t3_1_seconds_count",
                                                   "this_scope",
                                                   "app",
-                                                  "1.0"))));
+                                                  "1.0")),
+                         endsWith(OPENMETRICS_EOF)));
     }
 
     private static String scopeExpr(String meterName, String key, String value, String suffix) {
-        return meterName + "{" + key + "=\"" + value + "\",} " + suffix;
+        return meterName + "{" + key + "=\"" + value + "\"} " + suffix;
     }
 
     private static String checkAndCast(Optional<Object> outputOpt) {
diff --git a/tests/integration/dbclient/app/pom.xml b/tests/integration/dbclient/app/pom.xml
index 4e5a08a8e2..93926f3add 100644
--- a/tests/integration/dbclient/app/pom.xml
+++ b/tests/integration/dbclient/app/pom.xml
@@ -236,8 +236,8 @@
                     <version>${project.version}</version>
                 </dependency>
                 <dependency>
-                    <groupId>mysql</groupId>
-                    <artifactId>mysql-connector-java</artifactId>
+                    <groupId>com.mysql</groupId>
+                    <artifactId>mysql-connector-j</artifactId>
                 </dependency>
             </dependencies>
         </profile>
diff --git a/tests/integration/jpa/appl/pom.xml b/tests/integration/jpa/appl/pom.xml
index 2baa0679a1..6dff1a3e7b 100644
--- a/tests/integration/jpa/appl/pom.xml
+++ b/tests/integration/jpa/appl/pom.xml
@@ -380,8 +380,8 @@
                     <version>${project.version}</version>
                 </dependency>
                 <dependency>
-                    <groupId>mysql</groupId>
-                    <artifactId>mysql-connector-java</artifactId>
+                    <groupId>com.mysql</groupId>
+                    <artifactId>mysql-connector-j</artifactId>
                     <scope>runtime</scope>
                 </dependency>
             </dependencies>
diff --git a/tests/integration/vault/pom.xml b/tests/integration/vault/pom.xml
index dd7c93adb6..ad7cdf6539 100644
--- a/tests/integration/vault/pom.xml
+++ b/tests/integration/vault/pom.xml
@@ -104,8 +104,8 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>