Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
5af56b9
Add REST and Transport actions for oidc authentication
jkakavas Dec 5, 2018
c4154f6
support state
jkakavas Dec 13, 2018
8149339
Merge remote-tracking branch 'origin/master' into oidc-realm-base
jkakavas Dec 14, 2018
8d54c7c
track current changes
jkakavas Dec 21, 2018
cc68f5a
Ongoing oidc work
jkakavas Dec 24, 2018
72a2dd4
Add functionality for building Authentication Requests
jkakavas Dec 27, 2018
69fb95c
Fix formatting
jkakavas Dec 27, 2018
12dd9c0
Fix formatting
jkakavas Dec 27, 2018
6a4cac6
Fix settings
jkakavas Dec 27, 2018
aeacfc5
Correct javadoc
jkakavas Dec 27, 2018
845dc36
Add serialiazion and tests for the AuthenticateRequest
jkakavas Dec 27, 2018
21559dd
Add JWT model and builder
jkakavas Dec 28, 2018
59f9284
Add JsonWebToken parser
jkakavas Jan 4, 2019
cd03bdf
Add support for signing and signature validation
jkakavas Jan 7, 2019
d70446f
Complement JWS implementation and tests
jkakavas Jan 9, 2019
ae7a57c
Merge remote-tracking branch 'origin/master' into oidc-realm-jwt-helpers
jkakavas Jan 9, 2019
8aa1a42
Doc changes and add an IdToken class
jkakavas Jan 9, 2019
0bf371a
fix all precommit issues
jkakavas Jan 9, 2019
0400d8a
Update realm tests with the required RP_ALLOWED_SIGNATURE_ALGORITHM s…
jkakavas Jan 10, 2019
b6e5cca
Remove the AbstracLifecycleComponent constructor with Settings (#37523)
pgomulka Jan 17, 2019
1686c32
SQL: Rename SQL type DATE to DATETIME (#37395)
matriv Jan 17, 2019
676e1b1
Fix erroneous docstrings for abstract bulk by scroll request (#37517)
torgeir Jan 17, 2019
da79930
Decreased time out in test
martijnvg Jan 17, 2019
6fe2d6d
Mute TransportClientNodesServiceTests#testListenerFailures
ywelsch Jan 17, 2019
99b0984
Moved ccr integration to the package with other ccr integration tests.
martijnvg Jan 17, 2019
d9fa4e4
Fix testRelocateWhileContinuouslyIndexingAndWaitingForRefresh (#37560)
ywelsch Jan 17, 2019
b85bfd3
Added fatal_exception field for ccr stats in monitoring mapping. (#37…
martijnvg Jan 17, 2019
4351a5e
Allow field types to optimize phrase prefix queries (#37436)
jimczi Jan 17, 2019
20ed3dd
Make recovery source send operations non-blocking (#37503)
dnhatn Jan 17, 2019
587034d
Add set_priority action to ILM (#37397)
jakelandis Jan 17, 2019
a2d9c46
[DOCS] Adds limitation to the get jobs API (#37549)
lcawl Jan 17, 2019
6d64a2a
Propagate Errors in executors to uncaught exception handler (#36137)
ywelsch Jan 17, 2019
68de2ed
Fix assertion at end of forceRefreshes (#37559)
ywelsch Jan 17, 2019
6dcb3af
[DOCS] Adds size limitation to the get datafeeds APIs (#37578)
lcawl Jan 17, 2019
5782a5b
Mute UnicastZenPingTests#testSimplePings
jbaiera Jan 17, 2019
a0c504e
Create specific exception for when snapshots are in progress (#37550)
talevy Jan 17, 2019
381d035
Remove Redundant RestoreRequest Class (#37535)
original-brownbear Jan 17, 2019
b6f06a4
Implement follower rate limiting for file restore (#37449)
Tim-Brooks Jan 17, 2019
978c818
Use RestoreSnapshotRequest in CcrRepositoryIT
Tim-Brooks Jan 17, 2019
62ddc8c
Reenable UnicastZenPingTests#testSimplePings
original-brownbear Jan 18, 2019
080c073
Minor docs cleanup (#37595)
cachedout Jan 18, 2019
2f0e0b2
Allow indices.get_mapping response parsing without types (#37492)
Jan 18, 2019
25aac4f
Remove `include_type_name` in asciidoc where possible (#37568)
Jan 18, 2019
699d881
Migrate IndicesExistsIT to Zen2 (#37526)
DaveCTurner Jan 18, 2019
65e76b3
Migrate RecoveryFromGatewayIT to Zen2 (#37520)
DaveCTurner Jan 18, 2019
29d3a70
Fix BulkWithUpdatesIT and CloseIndexIT
tlrx Jan 18, 2019
3a96608
Remove more include_type_name and types from docs (#37601)
Jan 18, 2019
ed297b7
Only update response headers if we have a new one (#37590)
jasontedor Jan 18, 2019
7597b7c
Add validation for empty PutPrivilegeRequest (#37569)
jkakavas Jan 18, 2019
604422c
Update Execute Watch to allow unknown fields (#37498)
hub-cap Jan 18, 2019
377d96e
Remove initial_master_nodes on node restart (#37580)
ywelsch Jan 18, 2019
6846666
Add ccr follow info api (#37408)
martijnvg Jan 18, 2019
de55b4d
Add types deprecation to script contexts (#37554)
jdconrad Jan 18, 2019
633bd09
Nit in settings.gradle for Eclipse
albertzaharovits Jan 18, 2019
54af8a4
SQL: fix object extraction from sources (#37502)
imotov Jan 18, 2019
fc1c476
Document the need for JAVA11_HOME (#37589)
hmcc Jan 18, 2019
642e45e
Fix setting openldap realm ssl config
jaymode Jan 18, 2019
a2bdfb9
Packaging: Update marker used to allow ELASTIC_PASSWORD (#37243)
rjernst Jan 18, 2019
a3030c5
[ILM] Add unfollow action (#36970)
martijnvg Jan 18, 2019
8da7a27
Deprecate types in the put mapping API. (#37280)
jtibshirani Jan 18, 2019
5384162
ML: creating ML State write alias and pointing writes there (#37483)
benwtrent Jan 18, 2019
12cdf1c
ML: Add support for single bucket aggs in Datafeeds (#37544)
benwtrent Jan 18, 2019
88b9810
Remove obsolete deprecation checks (#37510)
gwbrown Jan 18, 2019
106f900
refactor inner geogrid classes to own class files (#37596)
talevy Jan 18, 2019
adae233
Add some deprecation optimizations (#37597)
jasontedor Jan 18, 2019
cd41289
Add local session timeouts to leader node (#37438)
Tim-Brooks Jan 18, 2019
fe753ee
Do not add index event listener if CCR disabled (#37432)
Tim-Brooks Jan 18, 2019
c03308a
Update get users to allow unknown fields (#37593)
hub-cap Jan 18, 2019
b4c18a9
Remove an unused constant in PutMappingRequest.
jtibshirani Jan 18, 2019
9b32f57
Update jdk used by the docker builds (#37621)
hub-cap Jan 19, 2019
fc99eb3
Add cache cleaning task for ML snapshot (#37505)
rjernst Jan 20, 2019
5308746
Remove Watcher Account "unsecure" settings (#36736)
albertzaharovits Jan 20, 2019
f843c92
Merge remote-tracking branch 'origin/master' into oidc-realm-jwt-helpers
jkakavas Jan 20, 2019
63e9e46
OpenID Connect Realm base functionality (#37009)
jkakavas Jan 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ JDK 11 and testing on a JDK 8 runtime; to do this, set `RUNTIME_JAVA_HOME`
pointing to the Java home of a JDK 8 installation. Note that this mechanism can
be used to test against other JDKs as well, this is not only limited to JDK 8.

> Note: It is also required to have `JAVA8_HOME`, `JAVA9_HOME`, and
`JAVA10_HOME` are available so that the tests can pass.
> Note: It is also required to have `JAVA8_HOME`, `JAVA9_HOME`, `JAVA10_HOME`
and `JAVA11_HOME` available so that the tests can pass.

> Warning: do not use `sdkman` for Java installations which do not have proper
`jrunscript` for jdk distributions.
Expand Down
13 changes: 13 additions & 0 deletions buildSrc/src/main/resources/forbidden/es-all-signatures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,16 @@ java.nio.channels.SocketChannel#connect(java.net.SocketAddress)
java.lang.Boolean#getBoolean(java.lang.String)

org.apache.lucene.util.IOUtils @ use @org.elasticsearch.core.internal.io instead

@defaultMessage use executors from org.elasticsearch.common.util.concurrent.EsExecutors instead which will properly bubble up Errors
java.util.concurrent.AbstractExecutorService#<init>()
java.util.concurrent.ThreadPoolExecutor#<init>(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue)
java.util.concurrent.ThreadPoolExecutor#<init>(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue, java.util.concurrent.ThreadFactory)
java.util.concurrent.ThreadPoolExecutor#<init>(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue, java.util.concurrent.RejectedExecutionHandler)
java.util.concurrent.ThreadPoolExecutor#<init>(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler)

@defaultMessage extend org.elasticsearch.threadpool.Scheduler.SafeScheduledThreadPoolExecutor instead which will properly bubble up Errors
java.util.concurrent.ScheduledThreadPoolExecutor#<init>(int)
java.util.concurrent.ScheduledThreadPoolExecutor#<init>(int, java.util.concurrent.ThreadFactory)
java.util.concurrent.ScheduledThreadPoolExecutor#<init>(int, java.util.concurrent.RejectedExecutionHandler)
java.util.concurrent.ScheduledThreadPoolExecutor#<init>(int, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler)
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
Expand All @@ -63,6 +62,7 @@
import org.elasticsearch.client.indices.FreezeIndexRequest;
import org.elasticsearch.client.indices.GetIndexTemplatesRequest;
import org.elasticsearch.client.indices.IndexTemplatesExistRequest;
import org.elasticsearch.client.indices.PutMappingRequest;
import org.elasticsearch.client.indices.UnfreezeIndexRequest;
import org.elasticsearch.rest.RestStatus;

Expand Down Expand Up @@ -166,6 +166,45 @@ public void putMappingAsync(PutMappingRequest putMappingRequest, RequestOptions
AcknowledgedResponse::fromXContent, listener, emptySet());
}

/**
* Updates the mappings on an index using the Put Mapping API.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html">
* Put Mapping API on elastic.co</a>
* @param putMappingRequest the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
* {@link #putMapping(PutMappingRequest, RequestOptions)} should be used instead, which accepts a new request object.
*/
@Deprecated
public AcknowledgedResponse putMapping(org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest putMappingRequest,
RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(putMappingRequest, IndicesRequestConverters::putMapping, options,
AcknowledgedResponse::fromXContent, emptySet());
}

/**
* Asynchronously updates the mappings on an index using the Put Mapping API.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html">
* Put Mapping API on elastic.co</a>
* @param putMappingRequest the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener the listener to be notified upon request completion
*
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
* method {@link #putMappingAsync(PutMappingRequest, RequestOptions, ActionListener)} should be used instead,
* which accepts a new request object.
*/
@Deprecated
public void putMappingAsync(org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest putMappingRequest,
RequestOptions options,
ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(putMappingRequest, IndicesRequestConverters::putMapping, options,
AcknowledgedResponse::fromXContent, listener, emptySet());
}

/**
* Retrieves the mappings on an index or indices using the Get Mapping API.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.elasticsearch.action.admin.indices.get.GetIndexRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
import org.elasticsearch.action.admin.indices.rollover.RolloverRequest;
Expand All @@ -51,6 +50,7 @@
import org.elasticsearch.client.indices.FreezeIndexRequest;
import org.elasticsearch.client.indices.GetIndexTemplatesRequest;
import org.elasticsearch.client.indices.IndexTemplatesExistRequest;
import org.elasticsearch.client.indices.PutMappingRequest;
import org.elasticsearch.client.indices.UnfreezeIndexRequest;
import org.elasticsearch.common.Strings;

Expand Down Expand Up @@ -122,14 +122,25 @@ static Request updateAliases(IndicesAliasesRequest indicesAliasesRequest) throws
return request;
}


static Request putMapping(PutMappingRequest putMappingRequest) throws IOException {
Request request = new Request(HttpPut.METHOD_NAME, RequestConverters.endpoint(putMappingRequest.indices(), "_mapping"));

RequestConverters.Params parameters = new RequestConverters.Params(request);
parameters.withTimeout(putMappingRequest.timeout());
parameters.withMasterTimeout(putMappingRequest.masterNodeTimeout());
request.setEntity(RequestConverters.createEntity(putMappingRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE));
return request;
}

static Request putMapping(org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest putMappingRequest) throws IOException {
// The concreteIndex is an internal concept, not applicable to requests made over the REST API.
if (putMappingRequest.getConcreteIndex() != null) {
throw new IllegalArgumentException("concreteIndex cannot be set on PutMapping requests made over the REST API");
}

Request request = new Request(HttpPut.METHOD_NAME, RequestConverters.endpoint(putMappingRequest.indices(), "_mapping",
putMappingRequest.type()));
Request request = new Request(HttpPut.METHOD_NAME, RequestConverters.endpoint(putMappingRequest.indices(),
"_mapping", putMappingRequest.type()));

RequestConverters.Params parameters = new RequestConverters.Params(request);
parameters.withTimeout(putMappingRequest.timeout());
Expand All @@ -150,7 +161,6 @@ static Request getMappings(GetMappingsRequest getMappingsRequest) throws IOExcep
parameters.withMasterTimeout(getMappingsRequest.masterNodeTimeout());
parameters.withIndicesOptions(getMappingsRequest.indicesOptions());
parameters.withLocal(getMappingsRequest.local());
parameters.putParam(INCLUDE_TYPE_NAME_PARAMETER, "true");

return request;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ public List<NamedXContentRegistry.Entry> getNamedXContentParsers() {
ShrinkAction::parse),
new NamedXContentRegistry.Entry(LifecycleAction.class,
new ParseField(FreezeAction.NAME),
FreezeAction::parse)
FreezeAction::parse),
new NamedXContentRegistry.Entry(LifecycleAction.class,
new ParseField(SetPriorityAction.NAME),
SetPriorityAction::parse),
new NamedXContentRegistry.Entry(LifecycleAction.class,
new ParseField(UnfollowAction.NAME),
UnfollowAction::parse)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ public class LifecyclePolicy implements ToXContentObject {
throw new IllegalArgumentException("ordered " + PHASES_FIELD.getPreferredName() + " are not supported");
}, PHASES_FIELD);

ALLOWED_ACTIONS.put("hot", Sets.newHashSet(RolloverAction.NAME));
ALLOWED_ACTIONS.put("warm", Sets.newHashSet(AllocateAction.NAME, ForceMergeAction.NAME, ReadOnlyAction.NAME, ShrinkAction.NAME));
ALLOWED_ACTIONS.put("cold", Sets.newHashSet(AllocateAction.NAME, FreezeAction.NAME));
ALLOWED_ACTIONS.put("hot", Sets.newHashSet(UnfollowAction.NAME, SetPriorityAction.NAME, RolloverAction.NAME));
ALLOWED_ACTIONS.put("warm", Sets.newHashSet(UnfollowAction.NAME, SetPriorityAction.NAME, AllocateAction.NAME, ForceMergeAction.NAME,
ReadOnlyAction.NAME, ShrinkAction.NAME));
ALLOWED_ACTIONS.put("cold", Sets.newHashSet(UnfollowAction.NAME, SetPriorityAction.NAME, AllocateAction.NAME, FreezeAction.NAME));
ALLOWED_ACTIONS.put("delete", Sets.newHashSet(DeleteAction.NAME));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* 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.client.indexlifecycle;

import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;

import java.io.IOException;

/**
* A {@link LifecycleAction} which sets the index's priority. The higher the priority, the faster the recovery.
*/
public class SetPriorityAction implements LifecycleAction, ToXContentObject {
public static final String NAME = "set_priority";
private static final ParseField RECOVERY_PRIORITY_FIELD = new ParseField("priority");

@SuppressWarnings("unchecked")
private static final ConstructingObjectParser<SetPriorityAction, Void> PARSER = new ConstructingObjectParser<>(NAME, true,
a -> new SetPriorityAction((Integer) a[0]));

//package private for testing
final Integer recoveryPriority;

static {
PARSER.declareField(ConstructingObjectParser.constructorArg(),
(p) -> p.currentToken() == XContentParser.Token.VALUE_NULL ? null : p.intValue()
, RECOVERY_PRIORITY_FIELD, ObjectParser.ValueType.INT_OR_NULL);
}

public static SetPriorityAction parse(XContentParser parser) {
return PARSER.apply(parser, null);
}

public SetPriorityAction(@Nullable Integer recoveryPriority) {
if (recoveryPriority != null && recoveryPriority <= 0) {
throw new IllegalArgumentException("[" + RECOVERY_PRIORITY_FIELD.getPreferredName() + "] must be 0 or greater");
}
this.recoveryPriority = recoveryPriority;
}

@Override
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
builder.startObject();
builder.field(RECOVERY_PRIORITY_FIELD.getPreferredName(), recoveryPriority);
builder.endObject();
return builder;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

SetPriorityAction that = (SetPriorityAction) o;

return recoveryPriority != null ? recoveryPriority.equals(that.recoveryPriority) : that.recoveryPriority == null;
}

@Override
public int hashCode() {
return recoveryPriority != null ? recoveryPriority.hashCode() : 0;
}

@Override
public String toString() {
return Strings.toString(this);
}

@Override
public String getName() {
return NAME;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* 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.client.indexlifecycle;

import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;

import java.io.IOException;

public class UnfollowAction implements LifecycleAction, ToXContentObject {
public static final String NAME = "unfollow";

private static final ObjectParser<UnfollowAction, Void> PARSER = new ObjectParser<>(NAME, UnfollowAction::new);

public UnfollowAction() {}

@Override
public String getName() {
return NAME;
}

public static UnfollowAction parse(XContentParser parser) {
return PARSER.apply(parser, null);
}

@Override
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
builder.startObject();
builder.endObject();
return builder;
}

@Override
public int hashCode() {
return 36970;
}

@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj.getClass() != getClass()) {
return false;
}
return true;
}

@Override
public String toString() {
return Strings.toString(this);
}
}
Loading