-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add repository-url module and move URLRepository #22752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 29 commits
ad4f704
b32361f
563b616
54f6e6b
311d890
669c4ef
00b20f9
18fefbd
8f92848
abd7750
4e05efc
7bf6f4f
b263edc
983dc67
6c574e2
6ecf433
ee80d3b
ec750a9
6f661c8
fa40f2c
b8b6132
344eeb2
937ce94
63da34d
b49a346
1555ca0
e488f29
9ac5852
dd03e3a
12775b4
0880f6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /* | ||
| * Licensed to Elasticsearch under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch 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. | ||
| */ | ||
|
|
||
| esplugin { | ||
| description 'Module for generic repositories' | ||
| classname 'org.elasticsearch.plugin.repository.url.URLRepositoryPlugin' | ||
| } | ||
|
|
||
| compileJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes" | ||
| compileTestJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes" | ||
|
||
|
|
||
| integTest { | ||
| cluster { | ||
| setting 'repositories.url.allowed_urls', 'http://snapshot.test*' | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /* | ||
| * Licensed to Elasticsearch under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch 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.elasticsearch.plugin.repository.url; | ||
|
|
||
| import org.elasticsearch.common.settings.Setting; | ||
| import org.elasticsearch.common.xcontent.NamedXContentRegistry; | ||
| import org.elasticsearch.env.Environment; | ||
| import org.elasticsearch.plugins.Plugin; | ||
| import org.elasticsearch.plugins.RepositoryPlugin; | ||
| import org.elasticsearch.repositories.Repository; | ||
| import org.elasticsearch.repositories.url.URLRepository; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.Collections; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| public class URLRepositoryPlugin extends Plugin implements RepositoryPlugin { | ||
|
|
||
| @Override | ||
| public List<Setting<?>> getSettings() { | ||
| return Arrays.asList( | ||
| URLRepository.ALLOWED_URLS_SETTING, | ||
| URLRepository.REPOSITORIES_URL_SETTING, | ||
| URLRepository.SUPPORTED_PROTOCOLS_SETTING | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| public Map<String, Repository.Factory> getRepositories(Environment env, NamedXContentRegistry namedXContentRegistry) { | ||
| return Collections.singletonMap(URLRepository.TYPE, metadata -> new URLRepository(metadata, env, namedXContentRegistry)); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be URL repository?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - just fixed