Skip to content

Commit

Permalink
Add missing license header (opensearch-project#3467)
Browse files Browse the repository at this point in the history
Added missing license header for some files.

- [ ] New functionality includes testing
- [ ] New functionality has been documented
- [ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

Signed-off-by: Andrey Pleskach <[email protected]>
(cherry picked from commit fb82bbb)
  • Loading branch information
willyborankin authored and DarshitChanpura committed Oct 6, 2023
1 parent 8b6f2d7 commit e85c5cc
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
package org.opensearch.test.framework.testplugins;

import org.opensearch.ExceptionsHelper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
package org.opensearch.security.dlic.rest.validation;

import org.opensearch.core.rest.RestStatus;
Expand Down Expand Up @@ -113,6 +113,7 @@ default ValidationResult<SecurityConfiguration> entityStatic(final SecurityConfi
final var configuration = securityConfiguration.configuration();
final var entityName = securityConfiguration.entityName();
if (configuration.isStatic(entityName)) {

return ValidationResult.error(RestStatus.FORBIDDEN, forbiddenMessage("Resource '" + entityName + "' is static."));
}
return ValidationResult.success(securityConfiguration);
Expand All @@ -131,6 +132,7 @@ default ValidationResult<SecurityConfiguration> entityHidden(final SecurityConfi
final var configuration = securityConfiguration.configuration();
final var entityName = securityConfiguration.entityName();
if (configuration.isHidden(entityName)) {

return ValidationResult.error(RestStatus.NOT_FOUND, notFoundMessage("Resource '" + entityName + "' is not available."));
}
return ValidationResult.success(securityConfiguration);
Expand Down Expand Up @@ -158,6 +160,7 @@ default ValidationResult<SecurityConfiguration> isAllowedToChangeEntityWithRestA
final var configuration = securityConfiguration.configuration();
final var existingEntity = configuration.getCEntry(securityConfiguration.entityName());
if (restApiAdminPrivilegesEvaluator().containsRestApiAdminPermissions(existingEntity)) {

return ValidationResult.error(RestStatus.FORBIDDEN, forbiddenMessage("Access denied"));
}
} else {
Expand All @@ -167,6 +170,7 @@ default ValidationResult<SecurityConfiguration> isAllowedToChangeEntityWithRestA
configuration.getImplementingClass()
);
if (restApiAdminPrivilegesEvaluator().containsRestApiAdminPermissions(configEntityContent)) {

return ValidationResult.error(RestStatus.FORBIDDEN, forbiddenMessage("Access denied"));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
package org.opensearch.security.dlic.rest.api;

import com.fasterxml.jackson.databind.node.ObjectNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
package org.opensearch.security.dlic.rest.api;

import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/
package org.opensearch.security.transport;

import org.junit.Assert;
Expand Down

0 comments on commit e85c5cc

Please sign in to comment.