Skip to content

Commit 4a34f0f

Browse files
committed
Move HardcodedEntitlements to bootstrap package.
This is in preparation for referencing it from initPhase2.
1 parent 915819e commit 4a34f0f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
package org.elasticsearch.entitlement.initialization;
10+
package org.elasticsearch.entitlement.bootstrap;
1111

1212
import org.elasticsearch.core.Booleans;
1313
import org.elasticsearch.entitlement.runtime.policy.Policy;
@@ -42,7 +42,7 @@
4242
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.Mode.READ;
4343
import static org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement.Mode.READ_WRITE;
4444

45-
class HardcodedEntitlements {
45+
public class HardcodedEntitlements {
4646

4747
private static List<Scope> createServerEntitlements(Path pidFile) {
4848

@@ -179,7 +179,7 @@ private static List<Scope> createServerEntitlements(Path pidFile) {
179179
return serverScopes;
180180
}
181181

182-
static Policy serverPolicy(Path pidFile, Policy serverPolicyPatch) {
182+
public static Policy serverPolicy(Path pidFile, Policy serverPolicyPatch) {
183183
var serverScopes = createServerEntitlements(pidFile);
184184
return new Policy(
185185
"server",
@@ -190,7 +190,7 @@ static Policy serverPolicy(Path pidFile, Policy serverPolicyPatch) {
190190
// agents run without a module, so this is a special hack for the apm agent
191191
// this should be removed once https://github.com/elastic/elasticsearch/issues/109335 is completed
192192
// See also modules/apm/src/main/plugin-metadata/entitlement-policy.yaml
193-
static List<Entitlement> agentEntitlements() {
193+
public static List<Entitlement> agentEntitlements() {
194194
return List.of(
195195
new CreateClassLoaderEntitlement(),
196196
new ManageThreadsEntitlement(),

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/EntitlementInitialization.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import org.elasticsearch.core.Booleans;
1313
import org.elasticsearch.entitlement.bootstrap.EntitlementBootstrap;
14+
import org.elasticsearch.entitlement.bootstrap.HardcodedEntitlements;
1415
import org.elasticsearch.entitlement.bridge.EntitlementChecker;
1516
import org.elasticsearch.entitlement.runtime.api.ElasticsearchEntitlementChecker;
1617
import org.elasticsearch.entitlement.runtime.policy.PathLookup;

0 commit comments

Comments
 (0)