Skip to content

Commit f88a004

Browse files
authored
Remove unused EntitlementInternals (#116473)
1 parent bc270bd commit f88a004

File tree

3 files changed

+4
-38
lines changed

3 files changed

+4
-38
lines changed

libs/entitlement/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ This module implements mechanisms to grant and check permissions under the _enti
55
The entitlements system provides an alternative to the legacy `SecurityManager` system, which is deprecated for removal.
66
The `entitlement-agent` instruments sensitive class library methods with calls to this module, in order to enforce the controls.
77

8+
This feature is currently under development, and it is completely disabled by default (the agent is not loaded). To enable it, run Elasticsearch with
9+
```shell
10+
./gradlew run --entitlements
11+
```

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/api/ElasticsearchEntitlementChecker.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
import java.util.Optional;
1717

18-
import static org.elasticsearch.entitlement.runtime.internals.EntitlementInternals.isActive;
19-
2018
/**
2119
* Implementation of the {@link EntitlementChecker} interface, providing additional
2220
* API methods for managing the checks.
@@ -25,13 +23,6 @@
2523
public class ElasticsearchEntitlementChecker implements EntitlementChecker {
2624
private static final Logger logger = LogManager.getLogger(ElasticsearchEntitlementChecker.class);
2725

28-
/**
29-
* Causes entitlements to be enforced.
30-
*/
31-
public void activate() {
32-
isActive = true;
33-
}
34-
3526
@Override
3627
public void checkSystemExit(Class<?> callerClass, int status) {
3728
var requestingModule = requestingModule(callerClass);
@@ -66,10 +57,6 @@ private static Module requestingModule(Class<?> callerClass) {
6657
}
6758

6859
private static boolean isTriviallyAllowed(Module requestingModule) {
69-
if (isActive == false) {
70-
logger.debug("Trivially allowed: entitlements are inactive");
71-
return true;
72-
}
7360
if (requestingModule == null) {
7461
logger.debug("Trivially allowed: Entire call stack is in the boot module layer");
7562
return true;
@@ -81,5 +68,4 @@ private static boolean isTriviallyAllowed(Module requestingModule) {
8168
logger.trace("Not trivially allowed");
8269
return false;
8370
}
84-
8571
}

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/internals/EntitlementInternals.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)