|
|
@@ -21,7 +21,9 @@ import org.elasticsearch.common.util.BigArrays;
|
|
|
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
|
|
import org.elasticsearch.env.Environment;
|
|
|
import org.elasticsearch.indices.recovery.RecoverySettings;
|
|
|
+import org.elasticsearch.license.License;
|
|
|
import org.elasticsearch.license.LicenseUtils;
|
|
|
+import org.elasticsearch.license.LicensedFeature;
|
|
|
import org.elasticsearch.license.XPackLicenseState;
|
|
|
import org.elasticsearch.plugins.Plugin;
|
|
|
import org.elasticsearch.plugins.RepositoryPlugin;
|
|
|
@@ -40,6 +42,12 @@ import java.util.function.Supplier;
|
|
|
|
|
|
public class EncryptedRepositoryPlugin extends Plugin implements RepositoryPlugin {
|
|
|
|
|
|
+ static final LicensedFeature.Momentary ENCRYPTED_SNAPSHOT_FEATURE = LicensedFeature.momentary(
|
|
|
+ null,
|
|
|
+ "encrypted-snapshot",
|
|
|
+ License.OperationMode.PLATINUM
|
|
|
+ );
|
|
|
+
|
|
|
private static final Boolean ENCRYPTED_REPOSITORY_FEATURE_FLAG_REGISTERED;
|
|
|
static {
|
|
|
final String property = System.getProperty("es.encrypted_repository_feature_flag_registered");
|
|
|
@@ -154,7 +162,7 @@ public class EncryptedRepositoryPlugin extends Plugin implements RepositoryPlugi
|
|
|
if (false == (delegatedRepository instanceof BlobStoreRepository) || delegatedRepository instanceof EncryptedRepository) {
|
|
|
throw new IllegalArgumentException("Unsupported delegate repository type [" + DELEGATE_TYPE_SETTING.getKey() + "]");
|
|
|
}
|
|
|
- if (false == getLicenseState().checkFeature(XPackLicenseState.Feature.ENCRYPTED_SNAPSHOT)) {
|
|
|
+ if (false == ENCRYPTED_SNAPSHOT_FEATURE.check(getLicenseState())) {
|
|
|
logger.warn(
|
|
|
new ParameterizedMessage(
|
|
|
"Encrypted snapshots are not allowed for the currently installed license [{}]."
|