smolnar82 opened a new pull request, #1544: URL: https://github.com/apache/knox/pull/1544
[KNOX-3616](https://issues.apache.org/jira/browse/KNOX-3616) - Upgrade Apache Shiro to 3.0.2 ## What changes were proposed in this pull request? Upgrade Apache Shiro from 2.2.1 to 3.0.2. - Bumped `shiro.version` to `3.0.2`. - Removed `<classifier>jakarta</classifier>` from the `shiro-core` and `shiro-web` dependencies (root `pom.xml` dependencyManagement, `gateway-provider-security-shiro`, `gateway-server`, `gateway-test`). Shiro 3.x is Jakarta-only, and the `jakarta` classifier artifacts are no longer published. The ehcache `jakarta` classifier is unchanged. - `ShiroSubjectIdentityAdapter`: Shiro 3 changed `PrincipalCollection.asSet()` from a raw `Set` to `Set<?>`, which broke the unchecked conversion into `Set<String>`/`Set<Principal>`. Replaced it with the typed `byType(String.class)` (KnoxLdapRealm case) and `byType(Principal.class)` (KnoxPamRealm case). Behavior is the same: `KnoxLdapRealm` adds only `String` principals (username and group names), and `KnoxPamRealm` adds `Principal` objects. No transitive dependencies are added. The Shiro modules pulled in by `shiro-core`/`shiro-web` are the same ones as in 2.2.1; only the OWASP encoder version moves from 1.4.0 to 1.6.0. ## How was this patch tested? - `mvn -T1C clean install -DskipTests` passes, including test compilation, the enforcer `dependencyConvergence` check and `dependency:analyze-only`. - `gateway-provider-security-shiro` unit tests: 44 run, 0 failures, 1 skipped. - Docker Compose E2E suite: 177 passed. This includes the LDAP-backed suites that exercise `KnoxLdapRealm`/`ShiroFilter` (auth service, LDAP cache, LDAP injection, LDAP proxy search, backend password alias retry). ## Integration Tests No new integration tests were added. The existing E2E topologies already configure Shiro with `KnoxLdapRealm` extensively, and they all pass with the upgrade: ``` ❯ tests-1 | ------------------------------------ tests-1 | Your code has been rated at 10.00/10 tests-1 | tests-1 | Waiting for knox... tests-1 | ============================= test session starts ============================== tests-1 | platform linux -- Python 3.10.20, pytest-9.0.3, pluggy-1.7.0 tests-1 | rootdir: /tests tests-1 | plugins: platformdirs-4.12.4 tests-1 | collected 177 items tests-1 | tests-1 | test_clientid_credentials.py ........... [ 6%] tests-1 | test_delegation.py .............. [ 14%] tests-1 | test_gateway_identity_cert.py ...... [ 17%] tests-1 | test_health.py ..... [ 20%] tests-1 | test_k8s_delegation.py ........ [ 24%] tests-1 | test_k8s_jwks_ca.py ........... [ 31%] tests-1 | test_k8s_serviceaccount_validation.py ...... [ 34%] tests-1 | test_knox_admin_path_traversal.py ... [ 36%] tests-1 | test_knox_auth_service_and_ldap.py ... [ 37%] tests-1 | test_knox_configs.py . [ 38%] tests-1 | test_knox_ldap_backend_password_alias_retry.py .. [ 39%] tests-1 | test_knox_ldap_cache.py ... [ 41%] tests-1 | test_knox_ldap_injection.py ....... [ 45%] tests-1 | test_knox_ldap_proxy_search.py ............... [ 53%] tests-1 | test_knoxauth_preauth_and_paths.py ...... [ 57%] tests-1 | test_knoxauth_token_forwarding.py ........... [ 63%] tests-1 | test_knoxidf.py ....... [ 67%] tests-1 | test_knoxsso_redirect.py . [ 67%] tests-1 | test_knoxtoken_jwt.py .................... [ 79%] tests-1 | test_pathacls_encoded_path.py ...... [ 82%] tests-1 | test_pathacls_rule_order.py ... [ 84%] tests-1 | test_remote_auth.py ... [ 85%] tests-1 | test_remoteauth_extauthz_additional_path.py .... [ 88%] tests-1 | test_token_exchange.py ................. [ 97%] tests-1 | test_token_limit_by_type.py .... [100%] tests-1 | tests-1 | =============================== warnings summary =============================== ... tests-1 | -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html tests-1 | ----------------- generated xml file: /tests/test-results.xml ------------------ tests-1 | ================= 177 passed, 155 warnings in 66.66s (0:01:06) ================= tests-1 exited with code 0 Aborting on container exit... Container compose-tests-1 Stopping Container compose-tests-1 Stopped Config w Enable Watch d Detach ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
