Skip to content

Commit af358d0

Browse files
Signed-off-by: Andrey Pleskach <ples@aiven.io>
1 parent 6d35a0a commit af358d0

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/main/java/org/opensearch/security/dlic/rest/api/AbstractApiAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
import static org.opensearch.security.dlic.rest.api.Responses.conflict;
7575
import static org.opensearch.security.dlic.rest.api.Responses.forbidden;
7676
import static org.opensearch.security.dlic.rest.api.Responses.forbiddenMessage;
77-
import static org.opensearch.security.dlic.rest.api.Responses.internalSeverError;
77+
import static org.opensearch.security.dlic.rest.api.Responses.internalServerError;
7878
import static org.opensearch.security.dlic.rest.api.Responses.payload;
7979
import static org.opensearch.security.dlic.rest.support.Utils.withIOException;
8080

@@ -482,7 +482,7 @@ public final void onFailure(Exception e) {
482482
if (ExceptionsHelper.unwrapCause(e) instanceof VersionConflictEngineException) {
483483
conflict(channel, e.getMessage());
484484
} else {
485-
internalSeverError(channel, "Error " + e.getMessage());
485+
internalServerError(channel, "Error " + e.getMessage());
486486
}
487487
}
488488

@@ -579,7 +579,7 @@ protected final RestChannelConsumer prepareRequest(RestRequest request, NodeClie
579579

580580
// check if .opendistro_security index has been initialized
581581
if (!ensureIndexExists()) {
582-
return channel -> internalSeverError(channel, RequestContentValidator.ValidationError.SECURITY_NOT_INITIALIZED.message());
582+
return channel -> internalServerError(channel, RequestContentValidator.ValidationError.SECURITY_NOT_INITIALIZED.message());
583583
}
584584

585585
// check if request is authorized

src/main/java/org/opensearch/security/dlic/rest/api/FlushCacheApiAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.opensearch.security.securityconf.impl.CType;
2929
import org.opensearch.threadpool.ThreadPool;
3030

31-
import static org.opensearch.security.dlic.rest.api.Responses.internalSeverError;
31+
import static org.opensearch.security.dlic.rest.api.Responses.internalServerError;
3232
import static org.opensearch.security.dlic.rest.api.Responses.ok;
3333
import static org.opensearch.security.dlic.rest.support.Utils.addRoutesPrefix;
3434

@@ -73,7 +73,7 @@ private void flushCacheApiRequestHandlers(RequestHandler.RequestHandlersBuilder
7373
public void onResponse(ConfigUpdateResponse configUpdateResponse) {
7474
if (configUpdateResponse.hasFailures()) {
7575
LOGGER.error("Cannot flush cache due to", configUpdateResponse.failures().get(0));
76-
internalSeverError(
76+
internalServerError(
7777
channel,
7878
"Cannot flush cache due to " + configUpdateResponse.failures().get(0).getMessage() + "."
7979
);
@@ -86,7 +86,7 @@ public void onResponse(ConfigUpdateResponse configUpdateResponse) {
8686
@Override
8787
public void onFailure(final Exception e) {
8888
LOGGER.error("Cannot flush cache due to", e);
89-
internalSeverError(channel, "Cannot flush cache due to " + e.getMessage() + ".");
89+
internalServerError(channel, "Cannot flush cache due to " + e.getMessage() + ".");
9090
}
9191

9292
}

src/main/java/org/opensearch/security/dlic/rest/api/MigrateApiAction.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
import org.opensearch.threadpool.ThreadPool;
6262

6363
import static org.opensearch.security.dlic.rest.api.Responses.badRequest;
64-
import static org.opensearch.security.dlic.rest.api.Responses.internalSeverError;
64+
import static org.opensearch.security.dlic.rest.api.Responses.internalServerError;
6565
import static org.opensearch.security.dlic.rest.api.Responses.ok;
6666
import static org.opensearch.security.dlic.rest.support.Utils.addRoutesPrefix;
6767
// CS-ENFORCE-SINGLE
@@ -209,7 +209,7 @@ public void onResponse(CreateIndexResponse response) {
209209
}
210210
} catch (final IOException e1) {
211211
LOGGER.error("Unable to create bulk request " + e1, e1);
212-
internalSeverError(channel, "Unable to create bulk request.");
212+
internalServerError(channel, "Unable to create bulk request.");
213213
return;
214214
}
215215

@@ -226,7 +226,7 @@ public void onResponse(BulkResponse response) {
226226
"Unable to upload migrated configuration because of "
227227
+ response.buildFailureMessage()
228228
);
229-
internalSeverError(
229+
internalServerError(
230230
channel,
231231
"Unable to upload migrated configuration (bulk index failed)."
232232
);
@@ -240,7 +240,7 @@ public void onResponse(BulkResponse response) {
240240
@Override
241241
public void onFailure(Exception e) {
242242
LOGGER.error("Unable to upload migrated configuration because of " + e, e);
243-
internalSeverError(channel, "Unable to upload migrated configuration.");
243+
internalServerError(channel, "Unable to upload migrated configuration.");
244244
}
245245
}
246246
)
@@ -251,7 +251,7 @@ public void onFailure(Exception e) {
251251
@Override
252252
public void onFailure(Exception e) {
253253
LOGGER.error("Unable to create opendistro_security index because of " + e, e);
254-
internalSeverError(channel, "Unable to create opendistro_security index.");
254+
internalServerError(channel, "Unable to create opendistro_security index.");
255255
}
256256
});
257257

@@ -263,7 +263,7 @@ public void onFailure(Exception e) {
263263
@Override
264264
public void onFailure(Exception e) {
265265
LOGGER.error("Unable to delete opendistro_security index because of " + e, e);
266-
internalSeverError(channel, "Unable to delete opendistro_security index.");
266+
internalServerError(channel, "Unable to delete opendistro_security index.");
267267
}
268268
});
269269

src/main/java/org/opensearch/security/dlic/rest/api/Responses.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static void conflict(final RestChannel channel, final String message) {
5050
response(channel, RestStatus.CONFLICT, message);
5151
}
5252

53-
public static void internalSeverError(final RestChannel channel, final String message) {
53+
public static void internalServerError(final RestChannel channel, final String message) {
5454
response(channel, RestStatus.INTERNAL_SERVER_ERROR, message);
5555
}
5656

src/main/java/org/opensearch/security/dlic/rest/api/ValidateApiAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import org.opensearch.threadpool.ThreadPool;
4141

4242
import static org.opensearch.security.dlic.rest.api.Responses.badRequest;
43-
import static org.opensearch.security.dlic.rest.api.Responses.internalSeverError;
43+
import static org.opensearch.security.dlic.rest.api.Responses.internalServerError;
4444
import static org.opensearch.security.dlic.rest.api.Responses.ok;
4545
import static org.opensearch.security.dlic.rest.support.Utils.addRoutesPrefix;
4646

@@ -125,7 +125,7 @@ protected void validate(RestChannel channel, RestRequest request) throws IOExcep
125125

126126
ok(channel, "OK.");
127127
} catch (Exception e) {
128-
internalSeverError(channel, "Configuration is not valid.");
128+
internalServerError(channel, "Configuration is not valid.");
129129
}
130130
}
131131

0 commit comments

Comments
 (0)