gnodet commented on code in PR #12945: URL: https://github.com/apache/maven/pull/12945#discussion_r3903299877
########## impl/maven-impl/src/main/java/org/apache/maven/impl/resolver/MetadataInputValidator.java: ########## @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * http://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 org.apache.maven.impl.resolver; + +import java.io.IOException; + +import org.apache.maven.api.metadata.Snapshot; +import org.apache.maven.api.metadata.SnapshotVersion; +import org.apache.maven.api.metadata.Versioning; + +/** + * Validates metadata content parsed from remote {@code maven-metadata.xml} files before the values + * are used to compose filesystem paths or artifact coordinates. + * <p> + * Repository metadata is not covered by the model validator (it is not a POM), so version tokens, + * snapshot timestamps, and relocation coordinates must be checked at the point of use. Values that + * would map onto filesystem path-traversal segments ({@code ..}), separators ({@code /}, {@code \}), + * drive-letter delimiters ({@code :}), or ISO control characters are rejected. + * + * @since 4.1.0 Review Comment: `@since 4.1.0` is incorrect for the `maven-4.0.x` branch (targeting `4.0.0-SNAPSHOT`). This tag was correct on master (#12950) but was not adapted for the backport. Should be `@since 4.0.0-rc-7` or whichever 4.0.x release this ships in. -- 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]
