kwin commented on code in PR #2211:
URL: https://github.com/apache/maven-resolver/pull/2211#discussion_r4327654068


##########
maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java:
##########
@@ -253,16 +253,90 @@ public final class ConfigurationProperties {
      * a redirect - including redirects that leave the repository origin. 
Avoid placing credentials (for example
      * {@code Authorization}, cookies or private token headers) in this map 
where repository authentication can be
      * used instead: repository authentication is negotiated per host. All 
shipped HTTP transports scope configured
-     * headers to the repository origin by default, see the per-transport 
{@code originScopedHeaders} configuration
-     * keys ({@code aether.transport.apache.originScopedHeaders}, {@code 
aether.transport.jdk.originScopedHeaders},
-     * {@code aether.transport.jetty.originScopedHeaders}).
+     * headers to the repository origin by default, controlled by {@link 
#HTTP_ORIGIN_SCOPED_HEADERS}.
      *
      * @configurationSource {@link 
RepositorySystemSession#getConfigProperties()}
      * @configurationType {@link java.util.Map}
      * @configurationRepoIdSuffix Yes
      */
     public static final String HTTP_HEADERS = PREFIX_TRANSPORT_HTTP + 
"headers";
 
+    public enum RedirectMode {
+        /**
+         * No redirects allowed.
+         */
+        NONE,
+        /**
+         * Redirects only within same authority.
+         */
+        SAME_AUTHORITY,
+        /**
+         * Any redirect is followed.
+         */
+        ANY
+    }
+
+    /**
+     * Optionally restricts HTTP redirects to either the same authority or not 
allowing any redirects at all.
+     * By default any redirect is followed.
+     * Blocked redirects lead to exceptions being thrown by the transport.
+     *
+     * @configurationSource {@link 
RepositorySystemSession#getConfigProperties()}
+     * @configurationType {@link ConfigurationProperties.RedirectMode}
+     * @configurationDefaultValue {@link #HTTP_REDIRECT_MODE}
+     * @configurationRepoIdSuffix Yes
+     * @since 2.0.25
+     * @see {@link #HTTP_ORIGIN_SCOPED_HEADERS} for restricing headers passed 
to redirect targets
+     * @see {@link #HTTP_FOLLOW_INSECURE_REDIRECT} for controlling whether 
HTTPS-to-HTTP redirects are followed

Review Comment:
   Also we need to make sure that we replace the field name by the 
configuration key in https://maven.apache.org/resolver/configuration.html. That 
only works when using link explicitly



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to