Repository navigation
Lift minimum JDK version to 21 and remove SecurityManager - #2214
Conversation
| <libraries> | ||
| </libraries> | ||
| <javase>17</javase> | ||
| <javase>21</javase> |
There was a problem hiding this comment.
That's require change on the karaf-maven-plugin and dependencies. I will create another PR (as planned) to tackle that.
| import static org.ops4j.pax.exam.CoreOptions.maven; | ||
| import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.*; | ||
|
|
||
| @Ignore("Disabled due to removal of SecurityManager. ref Apache Karaf GitHub issue #2082") |
There was a problem hiding this comment.
I would rather remove the test (to avoid confusion) or refactor it instead of ignoring it.
There was a problem hiding this comment.
Ok, if I just remove the SecurityManager assertion, the test completes.
I am not sure if I get completely what this test was intended for (it checks that all bundles come up after applying a specific config - but how this was related to SecurityManager, I still don't get).
I pushed the change to ignore that no SecurityManager is there.
|
@jbonofre is there anying else open I should address? |
|
@holgerfriedrich I think this PR is pretty good, it just needs dependent PRs. I will tackle that. |
023bbe9 to
8ed17ca
Compare
|
@holgerfriedrich do you mind to share your email address with me ? I just realize that you didn't subscribe on the dev mailing list, and you are not on The ASF slack Karaf channel. Thanks ! |
8ed17ca to
d2e0bc8
Compare
|
Hi @holgerfriedrich @jbonofre, I've got here some ugly patches that seem to make the Subject-related stuff work on java 25. Basically, there's an issue with that in 25, Subject.callAs() and current() use a ScopedValue and its binding "gets lost" across "thread-boundaries", of which there are a bunch :) It gets ugly, because every time you do something like ExecutorService.submit() you have to also "pass" the current Subject. Gets even worse, because Gogo needs a similar treatment... Anyway, wondering if it might help if I share what we've got here with you... or if you already have something like it? Or if I might help in some other way? :) |
|
@arusevm I'm finalizing camel-karaf release. I will be back on Karaf just after, tackling this. Sorry for the delay. |
7a69588 to
264b04b
Compare
|
Thanks @holgerfriedrich for the update ! I will do a new pass because I have a bunch of changes on the way. |
7e6e4fd to
05bbfa0
Compare
|
@jbonofre may I ask you to have a look at this again? I rebased it in the last days and got the CI green. It is a major step towards Java 25 compatibility. |
c54ec28 to
7a3001e
Compare
7a3001e to
050898c
Compare
|
@holgerfriedrich I removed the specs bundles. Can you please rebase? What's your take about JDK 17 / JDK 21? |
050898c to
6e02242
Compare
|
@jbonofre if we do not consider writing a compat layer on our own, we need then new API available from JDK18. So 21 LTS is the natural choice. |
|
@holgerfriedrich I agree. I'm advocating for JDK 21 for Karaf 4.5.x. I propose to go that way (including updating our CI). |
6e02242 to
1bd0efa
Compare
|
@jbonofre how shall we proceed with this one? |
|
@holgerfriedrich there is needed wersion of aries proxy compatible with jdk 25, it seems that their repo is already compatible with jdk 25 but no new release yet. |
|
@holgerfriedrich @kamilkrzywanski I think we can move forward with this PR and tackle more required updates in follow up PRs (I'm working on Aries releases). |
- Propagate session subject on JDK 25, fix jaas:sudo
- Fix GogoPlugin user lookup, KarafTestSupport unwrap
- java_home 21+, ${javaVersion} in archetype pom
Java 21 is the minimum now, so drop the jre-1.8..20 and eecap-1.8..20 definitions. Add eecap-22..27 and jre-27, and align the instance and test templates (they stopped at eecap-18). java.applet (JEP 504) and netscape.javascript (jdk.jsobject) are gone from Java 26, so jre-26 and later no longer export them.
No replacement intended: the SecurityManager is permanently disabled since JDK 24 (JEP 486), so there is nothing left to test. Felix dropped its Security Manager support as well, see FELIX-6833. Also remove the felix.framework.security test dependency and the test-only framework-security feature.
c65830e to
4ea5255
Compare
|
Last version + cherry-picked #3098 tested with native J25 classes: Full openHAB on top, still seems to work fine. |
| // them (JDK 21: AccessControlContext inheritance, possibly from an earlier | ||
| // jaas:sudo). So the session's subject is authoritative; jaas:sudo switches it while | ||
| // its command runs. Subject.current() is only a fallback for sessions without one. | ||
| Subject subject = (Subject) session.get(Subject.class.getName()); |
There was a problem hiding this comment.
Looking closer at this, reading the authoritative RBAC Subject from session.get(Subject.class.getName()) is a security issue: Session.get/put is backed by Gogo's user-writable variable map (CommandSessionImpl.variables), so any shell user can overwrite or clear it directly with plain variable assignment (no command or .invoke needed):
- In Karaf's default
org.apache.karaf.command.acl.shell(where.invokeis not restricted), a restricted user (e.g.viewer) can construct/populate aSubjectwithRolePrincipal("admin")and assignjavax.security.auth.Subject = $forged, bypassing shell RBAC. - Even when
.invoke = adminis configured,javax.security.auth.Subject = foocauses an uncheckedClassCastExceptionon every subsequent command, andjavax.security.auth.Subject = nullforces fallback toSubject.current()(which on JDK 21 can pick up a stale inherited ACC on a pool thread).
Instead of reading the security authority from Gogo variables, could we keep the authoritative Subject in an internal field on ConsoleSessionImpl and HeadlessSessionImpl (and map CommandSessionImpl -> Session internally in SessionFactoryImpl instead of trusting .session)?
- Capture
Subject.current()in bothConsoleSessionImplandHeadlessSessionImplconstructors (and createshellinsideJaasHelper.doAs(Subject, ...)inShellFactoryImpl, matchingLocalConsoleManagerandSuCommand). - In
Session.execute(CharSequence), ifSubject.current()is non-null, temporarily switch the internal session subject in atry/finallyblock. That waySudoCommand,ShellCommand, andKarafTestSupportautomatically propagate theirdoAs/callAssubject without writing it to user-mutable shell variables.
| @Override | ||
| protected Object invoke(CommandSessionImpl session, Object target, String name, List<Object> args) throws Exception { | ||
| checkSecurity(SHELL_SCOPE, SHELL_INVOKE, Arrays.asList(target, name, args)); | ||
| checkShellSecurityAsSessionSubject(session, SHELL_INVOKE, Arrays.asList(target, name, args)); |
There was a problem hiding this comment.
Two points here (in addition to the session.get(Subject.class.getName()) comment on SecuredCommand):
super.invoke(session, target, name, args)currently runs outsideJaasHelper.runAs(subject, ...). On JDK 25, if reflective invocation calls aServiceGuard-protected OSGi service or anything inspectingSubject.current(), it will seenull. Wrapping bothcheckSecurity(...)andsuper.invoke(...)insideJaasHelper.doAs(subject, ...)avoids that.- If
.sessionis still read fromcommandSession, a user running.session = foowill cause aClassCastExceptionhere, resolving theSession/Subjectvia an internal map inSessionFactoryImpl(or at least guarding withinstanceof) will prevent that.
There was a problem hiding this comment.
@jbonofre both changes done as requested.... please have a careful look at the implementation - I don't feel very confident in this area....
| // pull the java:21-jre-alpine image | ||
| // TODO it should be changed to the official karaf image as soon as it's available on Docker HUB | ||
| pull("java", "8-jre-alpine", true, url); | ||
| pull("java", "21-jre-alpine", true, url); |
There was a problem hiding this comment.
java:21-jre-alpine doesn't exist on Docker Hub (the official java repo was deprecated after Java 8). Let's use eclipse-temurin:21-jre-alpine here (and in provision() below), and eclipse-temurin:21-jre in DockerClientTest.java, docker/src/test/resources/Dockerfile, docker/src/test/resources/docker-build.sh (openjdk:21-jre also doesn't exist), and manual/src/main/asciidoc/user-guide/docker.adoc, to stay consistent with DockerfileMojo and assemblies/docker/Dockerfile.
There was a problem hiding this comment.
done as requested
| <configuration> | ||
| <source>1.8</source> | ||
| <target>1.8</target> | ||
| <release>${javaVersion}</release> |
There was a problem hiding this comment.
Thanks for updating this to ${javaVersion}! Two spots right above in this same POM still reference Java 17:
- Line 373:
<requiredJavaVersion>[17,)</requiredJavaVersion>should be[${javaVersion},)now that the plugin ships Java 21 bytecode (same intooling/karaf-services-maven-plugin/pom.xml:151). - Line 301:
<maven.compiler.release>17</maven.compiler.release>could also use${javaVersion}for consistency.
There was a problem hiding this comment.
I tried to avoid conflicts with #3115. Changing both now.
| setPrivateField(mojo, "assembly", assembly); | ||
| setPrivateField(mojo, "command", "[\"karaf\", \"server\"]"); | ||
| setPrivateField(mojo, "image", "eclipse-temurin:17-jre"); | ||
| setPrivateField(mojo, "image", "eclipse-temurin:21-jre"); |
There was a problem hiding this comment.
Nit: since DEFAULT_IMAGE is now eclipse-temurin:21-jre, testCustomImageAndCommand() no longer distinguishes a custom image from the default. Maybe use eclipse-temurin:25-jre here instead?
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
jbonofre
left a comment
There was a problem hiding this comment.
LGTM now, thanks for addressing all the feedback and for the patience through all rebases @holgerfriedrich!
I reviewed the updated SessionFactoryImpl / ConsoleSessionImpl / HeadlessSessionImpl / SecuredCommand / SecuredSessionFactoryImpl changes-keeping the authoritative Subject in a package-private field and resolving CommandSession -> Session internally in SessionFactoryImpl looks solid and cleanly handles both the security boundary and JDK 25 ScopedValue propagation across Gogo/SSH/console threads.
|
Great. Let's see how it works out. CI is green now as well (the other 6 jobs will never run, since the CI setup has changed in the meantime). |
|
@holgerfriedrich I will merge as soon as CI is green on the PR (still running). |
|
@holgerfriedrich it seems that the CI is "weird" here. Let me check 😄 |
|
@jbonofre |
|
@holgerfriedrich the problem is that they are blocking the merge. Let me fix that. |
…er from MBeanInvocationHandler Signed-off-by: JB Onofré <jbonofre@apache.org>
Signed-off-by: JB Onofré <jbonofre@apache.org>
|
I updated the I will cleanup once on |
|
It seems the J25 job is only triggered on merge - as long it is a PR, it will not built due to the condition |
|
@holgerfriedrich yes, that's the plan: unblock/merge this one and improve on |
* Lift minimum JDK version to 21 and remove SecurityManager
* Lift minimum JDK version to 21
* Remove occurrences of SecurityManager, as getSecurityManager returns
null since JDK 18
* Enable verbose deprecation warnings
* Replace getSubject and doAs calls,
getSubject can no longer be activated via JRE command line as
SecurityManager has been removed in JDK 25.
A replacement is available since Java 21.
doAs was deprecated and is replaced by callAll.
* Remove SecurityManager form JavaSecurityTest
* disable org.osgi.framework.security in JavaSecurityTest
* Updated how Java 21 is set in various places
* Fix Subject propagation for shell RBAC on JDK 25
Subject.current()/callAs() use a plain ScopedValue on JDK 25 (no
SecurityManager fallback like on JDK 21), which doesn't survive a
new Thread or an ExecutorService hop. Since Felix Gogo runs each
command on its own executor thread, this broke current-user lookup
and RBAC checks (bundle:list/bundle:info losing bundle visibility).
- JaasHelper.doAs/runAs now use Subject.callAs() instead of the old
AccessControlContext/SubjectDomainCombiner plumbing; drop the now
dead OsgiSubjectDomainCombiner/DelegatingProtectionDomain classes.
- SecuredCommand.execute() re-binds the subject from the session on
whatever thread runs the command, since Session is always passed
explicitly there regardless of the executing thread.
- LocalConsoleManager, ShellFactoryImpl and SuCommand store the
subject on the session so SecuredCommand can read it back.
* Change thread creation for itests
* Fix typo in ci workflow desc
* Replace doAs in newly added KarafMBeanServerGuardTest
* Replace java 17 in karaf-light pom
* Add Java25 on Ubuntu to build matrix
* ubuntu 26.04 public preview for j25
* mvn-4.0.0-rc-7 for j25
* Cleanup
* Prefer the bound subject in SecuredCommand, fall back to the session variable
* Rethrow unchecked exceptions in GSSAPILdapLoginModule
* Require JDK 21 in startup scripts, remove Java 8 leftovers
* Remove unused java.security import
* Cleanup, addresses AI review
- Propagate session subject on JDK 25, fix jaas:sudo
- Fix GogoPlugin user lookup, KarafTestSupport unwrap
- java_home 21+, ${javaVersion} in archetype pom
* Define JRE/EE capabilities for Java 21 to 27 only
Java 21 is the minimum now, so drop the jre-1.8..20 and eecap-1.8..20
definitions. Add eecap-22..27 and jre-27, and align the instance and
test templates (they stopped at eecap-18).
java.applet (JEP 504) and netscape.javascript (jdk.jsobject) are gone
from Java 26, so jre-26 and later no longer export them.
* Replace {8,11,17}-jre by 21-jre
* Remove JavaSecurityTest, apache#2082
No replacement intended: the SecurityManager is permanently disabled
since JDK 24 (JEP 486), so there is nothing left to test. Felix dropped
its Security Manager support as well, see FELIX-6833.
Also remove the felix.framework.security test dependency and the
test-only framework-security feature.
* Replace stale Java versions, also in docs
* Use session subject for shell invoke/redirect ACL checks
* Implement review suggestions
* Keep the shell session subject out of user-writable variables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Adapt Docker test to J25
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* Remove unused karaf-maven-plugin config.properties and AccessController from MBeanInvocationHandler
Signed-off-by: JB Onofré <jbonofre@apache.org>
* Keep default JDK 21 CI job names matching .asf.yaml required checks
Signed-off-by: JB Onofré <jbonofre@apache.org>
---------
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: JB Onofré <jbonofre@apache.org>
Co-authored-by: Fryderyk Wysocki <fryderyk.wysocki@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: JB Onofré <jbonofre@apache.org>
(cherry picked from commit 4829b97)
* Lift minimum JDK version to 21 and remove SecurityManager
* Lift minimum JDK version to 21
* Remove occurrences of SecurityManager, as getSecurityManager returns
null since JDK 18
* Enable verbose deprecation warnings
* Replace getSubject and doAs calls,
getSubject can no longer be activated via JRE command line as
SecurityManager has been removed in JDK 25.
A replacement is available since Java 21.
doAs was deprecated and is replaced by callAll.
* Remove SecurityManager form JavaSecurityTest
* disable org.osgi.framework.security in JavaSecurityTest
* Updated how Java 21 is set in various places
* Fix Subject propagation for shell RBAC on JDK 25
Subject.current()/callAs() use a plain ScopedValue on JDK 25 (no
SecurityManager fallback like on JDK 21), which doesn't survive a
new Thread or an ExecutorService hop. Since Felix Gogo runs each
command on its own executor thread, this broke current-user lookup
and RBAC checks (bundle:list/bundle:info losing bundle visibility).
- JaasHelper.doAs/runAs now use Subject.callAs() instead of the old
AccessControlContext/SubjectDomainCombiner plumbing; drop the now
dead OsgiSubjectDomainCombiner/DelegatingProtectionDomain classes.
- SecuredCommand.execute() re-binds the subject from the session on
whatever thread runs the command, since Session is always passed
explicitly there regardless of the executing thread.
- LocalConsoleManager, ShellFactoryImpl and SuCommand store the
subject on the session so SecuredCommand can read it back.
* Change thread creation for itests
* Fix typo in ci workflow desc
* Replace doAs in newly added KarafMBeanServerGuardTest
* Replace java 17 in karaf-light pom
* Add Java25 on Ubuntu to build matrix
* ubuntu 26.04 public preview for j25
* mvn-4.0.0-rc-7 for j25
* Cleanup
* Prefer the bound subject in SecuredCommand, fall back to the session variable
* Rethrow unchecked exceptions in GSSAPILdapLoginModule
* Require JDK 21 in startup scripts, remove Java 8 leftovers
* Remove unused java.security import
* Cleanup, addresses AI review
- Propagate session subject on JDK 25, fix jaas:sudo
- Fix GogoPlugin user lookup, KarafTestSupport unwrap
- java_home 21+, ${javaVersion} in archetype pom
* Define JRE/EE capabilities for Java 21 to 27 only
Java 21 is the minimum now, so drop the jre-1.8..20 and eecap-1.8..20
definitions. Add eecap-22..27 and jre-27, and align the instance and
test templates (they stopped at eecap-18).
java.applet (JEP 504) and netscape.javascript (jdk.jsobject) are gone
from Java 26, so jre-26 and later no longer export them.
* Replace {8,11,17}-jre by 21-jre
* Remove JavaSecurityTest, apache#2082
No replacement intended: the SecurityManager is permanently disabled
since JDK 24 (JEP 486), so there is nothing left to test. Felix dropped
its Security Manager support as well, see FELIX-6833.
Also remove the felix.framework.security test dependency and the
test-only framework-security feature.
* Replace stale Java versions, also in docs
* Use session subject for shell invoke/redirect ACL checks
* Implement review suggestions
* Keep the shell session subject out of user-writable variables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Adapt Docker test to J25
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* Remove unused karaf-maven-plugin config.properties and AccessController from MBeanInvocationHandler
Signed-off-by: JB Onofré <jbonofre@apache.org>
* Keep default JDK 21 CI job names matching .asf.yaml required checks
Signed-off-by: JB Onofré <jbonofre@apache.org>
---------
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: JB Onofré <jbonofre@apache.org>
Co-authored-by: Fryderyk Wysocki <fryderyk.wysocki@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: JB Onofré <jbonofre@apache.org>
(cherry picked from commit 4829b97)
* Lift minimum JDK version to 21 and remove SecurityManager
* Lift minimum JDK version to 21
* Remove occurrences of SecurityManager, as getSecurityManager returns
null since JDK 18
* Enable verbose deprecation warnings
* Replace getSubject and doAs calls,
getSubject can no longer be activated via JRE command line as
SecurityManager has been removed in JDK 25.
A replacement is available since Java 21.
doAs was deprecated and is replaced by callAll.
* Remove SecurityManager form JavaSecurityTest
* disable org.osgi.framework.security in JavaSecurityTest
* Updated how Java 21 is set in various places
* Fix Subject propagation for shell RBAC on JDK 25
Subject.current()/callAs() use a plain ScopedValue on JDK 25 (no
SecurityManager fallback like on JDK 21), which doesn't survive a
new Thread or an ExecutorService hop. Since Felix Gogo runs each
command on its own executor thread, this broke current-user lookup
and RBAC checks (bundle:list/bundle:info losing bundle visibility).
- JaasHelper.doAs/runAs now use Subject.callAs() instead of the old
AccessControlContext/SubjectDomainCombiner plumbing; drop the now
dead OsgiSubjectDomainCombiner/DelegatingProtectionDomain classes.
- SecuredCommand.execute() re-binds the subject from the session on
whatever thread runs the command, since Session is always passed
explicitly there regardless of the executing thread.
- LocalConsoleManager, ShellFactoryImpl and SuCommand store the
subject on the session so SecuredCommand can read it back.
* Change thread creation for itests
* Fix typo in ci workflow desc
* Replace doAs in newly added KarafMBeanServerGuardTest
* Replace java 17 in karaf-light pom
* Add Java25 on Ubuntu to build matrix
* ubuntu 26.04 public preview for j25
* mvn-4.0.0-rc-7 for j25
* Cleanup
* Prefer the bound subject in SecuredCommand, fall back to the session variable
* Rethrow unchecked exceptions in GSSAPILdapLoginModule
* Require JDK 21 in startup scripts, remove Java 8 leftovers
* Remove unused java.security import
* Cleanup, addresses AI review
- Propagate session subject on JDK 25, fix jaas:sudo
- Fix GogoPlugin user lookup, KarafTestSupport unwrap
- java_home 21+, ${javaVersion} in archetype pom
* Define JRE/EE capabilities for Java 21 to 27 only
Java 21 is the minimum now, so drop the jre-1.8..20 and eecap-1.8..20
definitions. Add eecap-22..27 and jre-27, and align the instance and
test templates (they stopped at eecap-18).
java.applet (JEP 504) and netscape.javascript (jdk.jsobject) are gone
from Java 26, so jre-26 and later no longer export them.
* Replace {8,11,17}-jre by 21-jre
* Remove JavaSecurityTest, apache#2082
No replacement intended: the SecurityManager is permanently disabled
since JDK 24 (JEP 486), so there is nothing left to test. Felix dropped
its Security Manager support as well, see FELIX-6833.
Also remove the felix.framework.security test dependency and the
test-only framework-security feature.
* Replace stale Java versions, also in docs
* Use session subject for shell invoke/redirect ACL checks
* Implement review suggestions
* Keep the shell session subject out of user-writable variables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Adapt Docker test to J25
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* Remove unused karaf-maven-plugin config.properties and AccessController from MBeanInvocationHandler
Signed-off-by: JB Onofré <jbonofre@apache.org>
* Keep default JDK 21 CI job names matching .asf.yaml required checks
Signed-off-by: JB Onofré <jbonofre@apache.org>
---------
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: JB Onofré <jbonofre@apache.org>
Co-authored-by: Fryderyk Wysocki <fryderyk.wysocki@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: JB Onofré <jbonofre@apache.org>
(cherry picked from commit 4829b97)
* Lift minimum JDK version to 21 and remove SecurityManager
* Lift minimum JDK version to 21
* Remove occurrences of SecurityManager, as getSecurityManager returns
null since JDK 18
* Enable verbose deprecation warnings
* Replace getSubject and doAs calls,
getSubject can no longer be activated via JRE command line as
SecurityManager has been removed in JDK 25.
A replacement is available since Java 21.
doAs was deprecated and is replaced by callAll.
* Remove SecurityManager form JavaSecurityTest
* disable org.osgi.framework.security in JavaSecurityTest
* Updated how Java 21 is set in various places
* Fix Subject propagation for shell RBAC on JDK 25
Subject.current()/callAs() use a plain ScopedValue on JDK 25 (no
SecurityManager fallback like on JDK 21), which doesn't survive a
new Thread or an ExecutorService hop. Since Felix Gogo runs each
command on its own executor thread, this broke current-user lookup
and RBAC checks (bundle:list/bundle:info losing bundle visibility).
- JaasHelper.doAs/runAs now use Subject.callAs() instead of the old
AccessControlContext/SubjectDomainCombiner plumbing; drop the now
dead OsgiSubjectDomainCombiner/DelegatingProtectionDomain classes.
- SecuredCommand.execute() re-binds the subject from the session on
whatever thread runs the command, since Session is always passed
explicitly there regardless of the executing thread.
- LocalConsoleManager, ShellFactoryImpl and SuCommand store the
subject on the session so SecuredCommand can read it back.
* Change thread creation for itests
* Fix typo in ci workflow desc
* Replace doAs in newly added KarafMBeanServerGuardTest
* Replace java 17 in karaf-light pom
* Add Java25 on Ubuntu to build matrix
* ubuntu 26.04 public preview for j25
* mvn-4.0.0-rc-7 for j25
* Cleanup
* Prefer the bound subject in SecuredCommand, fall back to the session variable
* Rethrow unchecked exceptions in GSSAPILdapLoginModule
* Require JDK 21 in startup scripts, remove Java 8 leftovers
* Remove unused java.security import
* Cleanup, addresses AI review
- Propagate session subject on JDK 25, fix jaas:sudo
- Fix GogoPlugin user lookup, KarafTestSupport unwrap
- java_home 21+, ${javaVersion} in archetype pom
* Define JRE/EE capabilities for Java 21 to 27 only
Java 21 is the minimum now, so drop the jre-1.8..20 and eecap-1.8..20
definitions. Add eecap-22..27 and jre-27, and align the instance and
test templates (they stopped at eecap-18).
java.applet (JEP 504) and netscape.javascript (jdk.jsobject) are gone
from Java 26, so jre-26 and later no longer export them.
* Replace {8,11,17}-jre by 21-jre
* Remove JavaSecurityTest, apache#2082
No replacement intended: the SecurityManager is permanently disabled
since JDK 24 (JEP 486), so there is nothing left to test. Felix dropped
its Security Manager support as well, see FELIX-6833.
Also remove the felix.framework.security test dependency and the
test-only framework-security feature.
* Replace stale Java versions, also in docs
* Use session subject for shell invoke/redirect ACL checks
* Implement review suggestions
* Keep the shell session subject out of user-writable variables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Adapt Docker test to J25
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* Remove unused karaf-maven-plugin config.properties and AccessController from MBeanInvocationHandler
Signed-off-by: JB Onofré <jbonofre@apache.org>
* Keep default JDK 21 CI job names matching .asf.yaml required checks
Signed-off-by: JB Onofré <jbonofre@apache.org>
---------
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: JB Onofré <jbonofre@apache.org>
Co-authored-by: Fryderyk Wysocki <fryderyk.wysocki@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: JB Onofré <jbonofre@apache.org>
(cherry picked from commit 4829b97)
This is a first step to prepare the 4.5 branch for running with Java 25.
Starting Karaf in Java 25 does not yet work, as a few functions related to the SecurityManager have been deprecated long time ago and cannot be activated any longer via command line switches.
As a new API has been added in Java 18, I for new lift the minimum required version to Java 21 (LTS).
Maybe this is not the way to go - as there has been some discussions if we could introduce an abstraction layer to allow Java 17 as well.
null since JDK 18
Disable JavaSecurityTest, Rework JavaSecurityTest #2082** getSubject can no longer be activated via JRE command line as
SecurityManager has been removed in JDK 25.
A replacement is available since Java 21.
** doAs was deprecated and is replaced by callAll.
For Java 25, another set of modifications is still needed and will be submitted as another PR.
Locally, I got Karaf compiling, passing the tests, and starting with Java 25. 🥳