1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.eclipse.aether.transport.minio;
20
21 import org.eclipse.aether.ConfigurationProperties;
22 import org.eclipse.aether.RepositorySystemSession;
23 import org.eclipse.aether.transport.minio.internal.FixedBucketObjectNameMapperFactory;
24
25 /**
26 * Configuration for MinIO Transport.
27 *
28 * @since 2.0.2
29 */
30 public final class MinioTransporterConfigurationKeys {
31 private MinioTransporterConfigurationKeys() {}
32
33 static final String CONFIG_PROPS_PREFIX =
34 ConfigurationProperties.PREFIX_TRANSPORT + MinioTransporterFactory.NAME + ".";
35
36 /**
37 * Object name mapper to use.
38 *
39 * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
40 * @configurationType {@link String}
41 * @configurationDefaultValue {@link #DEFAULT_OBJECT_NAME_MAPPER}
42 * @configurationRepoIdSuffix Yes
43 */
44 public static final String CONFIG_PROP_OBJECT_NAME_MAPPER = CONFIG_PROPS_PREFIX + "objectNameMapper";
45
46 public static final String DEFAULT_OBJECT_NAME_MAPPER = FixedBucketObjectNameMapperFactory.NAME;
47
48 /**
49 * The fixed bucket name to use.
50 *
51 * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
52 * @configurationType {@link String}
53 * @configurationDefaultValue {@link #DEFAULT_FIXED_BUCKET_NAME}
54 * @configurationRepoIdSuffix Yes
55 */
56 public static final String CONFIG_PROP_FIXED_BUCKET_NAME = CONFIG_PROPS_PREFIX + "fixedBucketName";
57
58 public static final String DEFAULT_FIXED_BUCKET_NAME = "maven";
59
60 /**
61 * Whether plaintext HTTP object storage endpoints (repository URLs in {@code minio+http} or {@code s3+http}
62 * form) are allowed. Plaintext endpoints offer no transport integrity (artifacts and their checksum objects
63 * travel over the same tamperable channel) and, because the repository protocol string is not {@code http},
64 * such URLs are not matched by {@code external:http:*} mirror blocking. They are therefore refused unless this
65 * property is explicitly set to {@code true}.
66 *
67 * @since 2.0.23
68 * @configurationSource {@link RepositorySystemSession#getConfigProperties()}
69 * @configurationType {@link Boolean}
70 * @configurationDefaultValue {@link #DEFAULT_ALLOW_INSECURE_PROTOCOL}
71 * @configurationRepoIdSuffix Yes
72 */
73 public static final String CONFIG_PROP_ALLOW_INSECURE_PROTOCOL = CONFIG_PROPS_PREFIX + "allowInsecureProtocol";
74
75 public static final boolean DEFAULT_ALLOW_INSECURE_PROTOCOL = false;
76 }