Skip to content

Commit 8622f03

Browse files
authored
Replace AccessController and remove restriction on word Extension (opensearch-project#5750)
Signed-off-by: Craig Perkins <[email protected]>
1 parent 04c90e2 commit 8622f03

File tree

75 files changed

+412
-1136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+412
-1136
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2525
- [Resource Sharing] Make migrate api require default access level to be supplied and updates documentations + tests ([#5717](https://github.com/opensearch-project/security/pull/5717))
2626
- [Resource Sharing] Removes share and revoke java APIs ([#5718](https://github.com/opensearch-project/security/pull/5718))
2727
- Fix build failure in SecurityFilterTests ([#5736](https://github.com/opensearch-project/security/pull/5736))
28+
- Replace AccessController and remove restriction on word Extension ([#5750](https://github.com/opensearch-project/security/pull/5750))
2829
- Add security provider earlier in bootstrap process ([#5749](https://github.com/opensearch-project/security/pull/5749))
2930

3031
### Maintenance

checkstyle/checkstyle.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,20 +228,13 @@
228228
<property name="severity" value="error"/>
229229
</module>
230230

231-
<module name="RegexpSingleline">
232-
<property name="format" value="extension"/>
233-
<property name="ignoreCase" value="true"/>
234-
<property name="message" value="Extension should only be used sparingly to keep implementations as generic as possible" />
235-
<property name="severity" value="error"/>
236-
</module>
237-
238231
<module name="SuppressWithPlainTextCommentFilter">
239-
<property name="offCommentFormat" value="CS-SUPPRESS-ALL: .+"/> <!-- Require an explaination after surpressing -->
232+
<property name="offCommentFormat" value="CS-SUPPRESS-ALL: .+"/> <!-- Require an explanation after suppressing -->
240233
<property name="onCommentFormat" value="CS-ENFORCE-ALL"/>
241234
</module>
242235

243236
<module name="SuppressWithPlainTextCommentFilter">
244-
<property name="offCommentFormat" value="CS-SUPPRESS-SINGLE\: ([\w\|]+) .+"/> <!-- Require an explaination after surpressing -->
237+
<property name="offCommentFormat" value="CS-SUPPRESS-SINGLE\: ([\w\|]+) .+"/> <!-- Require an explanation after suppressing -->
245238
<property name="onCommentFormat" value="CS-ENFORCE-SINGLE()"/>
246239
<property name="checkFormat" value="$1"/>
247240
</module>

src/integrationTest/java/org/opensearch/security/SnapshotSteps.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ public SnapshotSteps(RestHighLevelClient restHighLevelClient) {
4141
this.snapshotClient = requireNonNull(restHighLevelClient, "Rest high level client is required.").snapshot();
4242
}
4343

44-
// CS-SUPPRESS-SINGLE: RegexpSingleline It is not possible to use phrase "cluster manager" instead of master here
4544
public org.opensearch.action.support.clustermanager.AcknowledgedResponse createSnapshotRepository(
4645
String repositoryName,
4746
String snapshotDirPath,
4847
String type
49-
)
50-
// CS-ENFORCE-SINGLE
51-
throws IOException {
48+
) throws IOException {
5249
PutRepositoryRequest createRepositoryRequest = new PutRepositoryRequest().name(repositoryName)
5350
.type(type)
5451
.settings(Map.of("location", snapshotDirPath));
@@ -77,18 +74,14 @@ public int waitForSnapshotCreation(String repositoryName, String snapshotName) {
7774
return count.get();
7875
}
7976

80-
// CS-SUPPRESS-SINGLE: RegexpSingleline It is not possible to use phrase "cluster manager" instead of master here
8177
public org.opensearch.action.support.clustermanager.AcknowledgedResponse deleteSnapshotRepository(String repositoryName)
8278
throws IOException {
83-
// CS-ENFORCE-SINGLE
8479
DeleteRepositoryRequest request = new DeleteRepositoryRequest(repositoryName);
8580
return snapshotClient.deleteRepository(request, DEFAULT);
8681
}
8782

88-
// CS-SUPPRESS-SINGLE: RegexpSingleline It is not possible to use phrase "cluster manager" instead of master here
8983
public org.opensearch.action.support.clustermanager.AcknowledgedResponse deleteSnapshot(String repositoryName, String snapshotName)
9084
throws IOException {
91-
// CS-ENFORCE-SINGLE
9285
return snapshotClient.delete(new DeleteSnapshotRequest(repositoryName, snapshotName), DEFAULT);
9386
}
9487

src/integrationTest/java/org/opensearch/security/systemindex/sampleplugin/IndexDocumentIntoSystemIndexAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010

1111
package org.opensearch.security.systemindex.sampleplugin;
1212

13-
// CS-SUPPRESS-SINGLE: RegexpSingleline It is not possible to use phrase "cluster manager" instead of master here
1413
import org.opensearch.action.ActionType;
1514
import org.opensearch.action.support.clustermanager.AcknowledgedResponse;
16-
// CS-ENFORCE-SINGLE
1715

1816
public class IndexDocumentIntoSystemIndexAction extends ActionType<AcknowledgedResponse> {
1917
public static final IndexDocumentIntoSystemIndexAction INSTANCE = new IndexDocumentIntoSystemIndexAction();

src/integrationTest/java/org/opensearch/security/systemindex/sampleplugin/RunClusterHealthAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010

1111
package org.opensearch.security.systemindex.sampleplugin;
1212

13-
// CS-SUPPRESS-SINGLE: RegexpSingleline It is not possible to use phrase "cluster manager" instead of master here
1413
import org.opensearch.action.ActionType;
1514
import org.opensearch.action.support.clustermanager.AcknowledgedResponse;
16-
// CS-ENFORCE-SINGLE
1715

1816
public class RunClusterHealthAction extends ActionType<AcknowledgedResponse> {
1917
public static final RunClusterHealthAction INSTANCE = new RunClusterHealthAction();

src/integrationTest/java/org/opensearch/security/systemindex/sampleplugin/TransportIndexDocumentIntoSystemIndexAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package org.opensearch.security.systemindex.sampleplugin;
1212

13-
// CS-SUPPRESS-SINGLE: RegexpSingleline It is not possible to use phrase "cluster manager" instead of master here
1413
import org.opensearch.action.admin.indices.create.CreateIndexRequest;
1514
import org.opensearch.action.index.IndexRequest;
1615
import org.opensearch.action.support.ActionFilters;
@@ -23,7 +22,6 @@
2322
import org.opensearch.tasks.Task;
2423
import org.opensearch.transport.TransportService;
2524
import org.opensearch.transport.client.Client;
26-
// CS-ENFORCE-SINGLE
2725

2826
public class TransportIndexDocumentIntoSystemIndexAction extends HandledTransportAction<
2927
IndexDocumentIntoSystemIndexRequest,

src/integrationTest/java/org/opensearch/security/systemindex/sampleplugin/TransportRunClusterHealthAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package org.opensearch.security.systemindex.sampleplugin;
1212

13-
// CS-SUPPRESS-SINGLE: RegexpSingleline It is not possible to use phrase "cluster manager" instead of master here
1413
import org.opensearch.action.admin.cluster.health.ClusterHealthRequest;
1514
import org.opensearch.action.admin.cluster.health.ClusterHealthResponse;
1615
import org.opensearch.action.support.ActionFilters;
@@ -21,7 +20,6 @@
2120
import org.opensearch.tasks.Task;
2221
import org.opensearch.transport.TransportService;
2322
import org.opensearch.transport.client.Client;
24-
// CS-ENFORCE-SINGLE
2523

2624
public class TransportRunClusterHealthAction extends HandledTransportAction<RunClusterHealthRequest, AcknowledgedResponse> {
2725

src/integrationTest/java/org/opensearch/test/framework/certificate/CertificateMetadata.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010
package org.opensearch.test.framework.certificate;
1111

12-
// CS-SUPPRESS-SINGLE: RegexpSingleline Extension is used to refer to certificate extensions, keeping this rule disable for the whole file
1312
import java.util.ArrayList;
1413
import java.util.Collection;
1514
import java.util.Collections;
@@ -217,4 +216,3 @@ ExtendedKeyUsage getExtendedKeyUsage() {
217216
return new ExtendedKeyUsage(usages);
218217
}
219218
}
220-
// CS-ENFORCE-SINGLE

src/integrationTest/java/org/opensearch/test/framework/certificate/CertificatesIssuer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
package org.opensearch.test.framework.certificate;
2828

29-
// CS-SUPPRESS-SINGLE: RegexpSingleline Extension is used to refer to certificate extensions, keeping this rule disable for the whole file
3029
import java.math.BigInteger;
3130
import java.security.KeyPair;
3231
import java.security.NoSuchAlgorithmException;
@@ -238,4 +237,3 @@ private BigInteger generateNextCertificateSerialNumber() {
238237
return BigInteger.valueOf(ID_COUNTER.incrementAndGet());
239238
}
240239
}
241-
// CS-ENFORCE-SINGLE

src/integrationTest/java/org/opensearch/test/framework/certificate/PublicKeyUsage.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.bouncycastle.asn1.x509.KeyPurposeId;
1515
import org.bouncycastle.asn1.x509.KeyUsage;
1616

17-
// CS-SUPPRESS-SINGLE: RegexpSingleline Extension is used to refer to certificate extensions
1817
/**
1918
* The class is associated with certificate extensions related to key usages. These extensions are defined by
2019
* <a href="https://www.rfc-editor.org/rfc/rfc5280.html">RFC 5280</a> and describes allowed usage of public kay which is embedded in
@@ -26,7 +25,6 @@
2625
*
2726
* @see <a href="https://www.rfc-editor.org/rfc/rfc5280.html">RFC 5280</a>
2827
*/
29-
// CS-ENFORCE-SINGLE
3028
enum PublicKeyUsage {
3129
DIGITAL_SIGNATURE(KeyUsage.digitalSignature),
3230
KEY_CERT_SIGN(KeyUsage.keyCertSign),

0 commit comments

Comments
 (0)