Build: #3011 was successful
Job: Build was successful
Code commits
Openfire (master)
-
Guus der Kinderen 4b8c2e0e6507423cd52047abcd4837cc89a96284
Improve GroupProvider thread safety
Making the field volatile guarantees that any thread reading provider (in createGroup, deleteGroup, search, getProvider, etc.) will always observe the value last written, not a stale cached copy from a CPU register or L1 cache.- xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java (version 4b8c2e0e6507423cd52047abcd4837cc89a96284)
-
Guus der Kinderen 6372b2c3b947f927f13d16ce987d14bcc6321e6a
Harden GroupManager unit test around 'share with own group'
The 'share with own group' option is currently persisted as 'share with list of groups' where the value is only the name of the own group.
Although implementation-wise, this is identical to what's already being tested, behavioral, this is different. To capture bugs introduced by potential future changes, this commit adds tests for the 'share with own group' case.- xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java (version 6372b2c3b947f927f13d16ce987d14bcc6321e6a)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerNoMockTest.java (version 6372b2c3b947f927f13d16ce987d14bcc6321e6a)
-
Guus der Kinderen f39e333e63bc8913daab8624b00a1d8954c8f8c3
OF-3287: evict per-user group caches for source group members
Ensure cache invalidation also includes members/admins of the group being processed, not only groups returned by shared-group traversal.
Previously, `evictCachedUsersForGroup(...)` could miss users in the source group (especially non-shared groups), leaving stale cache entries. This caused group create/rename/delete and shared-roster target-list changes to not be reflected immediately for affected users.- xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java (version f39e333e63bc8913daab8624b00a1d8954c8f8c3)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerTest.java (version f39e333e63bc8913daab8624b00a1d8954c8f8c3)
-
Guus der Kinderen bfbe0d15ed2b5428bea5c4513872048e071bd1d2
Refactor GroupManager to facilitate unit testing
A conservative refactoring: the public API is untouched and the seams needed for testing are now in place.
Existing tests have been adapted to the new API where sensible. Wording has been adjusted to reflect behavioral nature of tests, where applicable.- xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java (version bfbe0d15ed2b5428bea5c4513872048e071bd1d2)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/AbstractGroupProviderTest.java (version bfbe0d15ed2b5428bea5c4513872048e071bd1d2)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/DefaultGroupProviderTest.java (version bfbe0d15ed2b5428bea5c4513872048e071bd1d2)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerNoMockTest.java (version bfbe0d15ed2b5428bea5c4513872048e071bd1d2)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerTest.java (version bfbe0d15ed2b5428bea5c4513872048e071bd1d2)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupTest.java (version bfbe0d15ed2b5428bea5c4513872048e071bd1d2)
-
Guus der Kinderen be47757c464bd4303d98e13fdc3469baa357273a
OF-3286: Unify GroupManager metadata locking
Replace the fragmented metadata locking scheme in GroupManager with a single shared lock around groupMetaCache access. This removes the previous mix of separate lock objects and per-user interning, making cache synchronization easier to reason about and reducing the risk of inconsistent updates.
Adds unit tests that verify some of the concurrent behavior.- xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java (version be47757c464bd4303d98e13fdc3469baa357273a)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerConcurrencyTest.java (version be47757c464bd4303d98e13fdc3469baa357273a)
-
Guus der Kinderen 66af4e0dce42c17ece25cd2316739588ff327911
OF-3288: Unify evicting of paginated and non-paginated group names
Instead of having two methods that should always be called at the same time, have one method, that does both. This is less error-prone, and more efficient.- xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java (version 66af4e0dce42c17ece25cd2316739588ff327911)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerTest.java (version 66af4e0dce42c17ece25cd2316739588ff327911)
-
Guus der Kinderen a6d0c1c63e0ea03ead8d243b1a284e6f4e32b09f
Increase test coverage for GroupManager
This adds a couple of tests for obvious gaps in pre-existing test coverage:
- Verify that when a group's sharing target list removes a group, users of that removed group immediately stop seeing the shared group.
- Verify that toggling sharing with everybody is immediately reflected in per-user shared-group results.- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerNoMockTest.java (version a6d0c1c63e0ea03ead8d243b1a284e6f4e32b09f)
-
Guus der Kinderen 9c09b6bbd4355c58a0649da42a57e063d747e518
(code review): renameGroupPostProcess test should exercise renameGroupPostProcess
Previously, the test named `renameGroupPostProcessEvictsPerUserCacheForNonSharedGroupMembers` did not exercise `renameGroupPostProcesss` (but `deleteGroupPostProcess` instead). This commit changes that, so that the test executes the intended system-under-test.
As a result, there now is a requirement to mock `XMPPServer` (the rename functionality needs it to generate a JID). This means that other code can use that mock, too. Implementation that previously actively avoided that has been modified to make use of the new mock.- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerTest.java (version 9c09b6bbd4355c58a0649da42a57e063d747e518)
-
Guus der Kinderen 482dcefb70429a6d6f44d9bc3c75d446ee7cb91d
OF-3285: Ensure changes to group sharing visibility immediately reflected in users' contact lists
Fixes a rather silly bug around cache eviction, added extensive unit test coverage.- xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java (version 482dcefb70429a6d6f44d9bc3c75d446ee7cb91d)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerNoMockTest.java (version 482dcefb70429a6d6f44d9bc3c75d446ee7cb91d)
- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerTest.java (version 482dcefb70429a6d6f44d9bc3c75d446ee7cb91d)
-
Guus der Kinderen 1660d2ef2417cb23118b85d3734716d03e57e8de
Increate test coverage for Group
Added tests for working with 'description' and verify behavior with read-only providers.
Fix inverted logic in TestGroupProvider.setName() that prevented proper GroupAlreadyExistsException handling- xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupTest.java (version 1660d2ef2417cb23118b85d3734716d03e57e8de)
-
Guus der Kinderen ba1145cf183128e375981350a6eb15a5f14805eb
Refactor SCRAM-SHA-1 unit tests: credential obfuscation tests
The fake salt determinism, fake key generation and user enumeration protection tests for SCRAM-SHA-1 are consolidated into one class, which is then
split up in an abstract base class, and a SCRAM-SHA-1 specific subclass. This is expected to make it easier to add test coverage for other algorithms.
Of note is that this change introduces a test-driven rather than domain-driven change in the system under test (`ScramSaslServer` and `ScramSha1SaslServer`): methods were lifted into the abstract superclass primarily because the tests needed polymorphism. This needs improving, which should go in a future commit.- xmppserver/src/main/java/org/jivesoftware/openfire/sasl/ScramSaslServer.java (version ba1145cf183128e375981350a6eb15a5f14805eb)
- xmppserver/src/main/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServer.java (version ba1145cf183128e375981350a6eb15a5f14805eb)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/AbstractScramCredentialObfuscationTest.java (version ba1145cf183128e375981350a6eb15a5f14805eb)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1CredentialObfuscationTest.java (version ba1145cf183128e375981350a6eb15a5f14805eb)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerFakeKeyTest.java (version ba1145cf183128e375981350a6eb15a5f14805eb)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerSaltTest.java (version ba1145cf183128e375981350a6eb15a5f14805eb)
-
Guus der Kinderen 835f42d739c4bd48bdbec425c193ba58fe2788bc
(code review) Fix constant name
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerTest.java (version 835f42d739c4bd48bdbec425c193ba58fe2788bc)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1TestFixtures.java (version 835f42d739c4bd48bdbec425c193ba58fe2788bc)
-
Guus der Kinderen 8efaed2c798d1b769d06353b5e6bbde173420689
Refactor SCRAM-SHA-1 unit tests: introduce base test factory methods
This replaces repeated construction patterns and protocol-building patterns.
By replacing most invocations of `new ScramSha1SaslServer(isPlusMechanism, new HashMap<>(), new ChannelBindingProviderManager(), ScramSha1TestFixtures.SUPPORTED_MECHANISMS);` with a factory method (`newServer(isPlusMechanism)`), a lot of boilerplate code with low informational value has been reduced.
The client `initialMessage` (`"n,,n=" + USER + ",r=" + nonce`) was constructed manually in various variants. By extracting this to a factory method tests become more readable: `final byte[] initialMessage = createClientInitialMessage("n,,", USER, CLIENT_NONCE);` This improves readability a lot, because the SCRAM message construction becomes 'named'. Tests now focus on intent rather than string concatenation.
Similarly, the client finalMessage, which was also constructed with string concatenation in various places, has been extracted to a factory method (`createClientFinalMessage(channelBinding, serverNonce, proof)`). Its usage now becomes declarative (`createClientFinalMessage("biws", nonce, proof)`) rather than protocol-string spaghetti ('"c=biws,r=" + serverNonce + ",p=" + proof').
The 'first exchange' helper (`String doFirstExchange(server)`) has been improved. Instead of returning just the nonce from the first result, it now returns a structure that holds all data from that response.
The old code repeatedly did `Pattern.compile(...); Matcher ...; group(...);` which was getting repetitive. This has been replaced by another centralized parse method (`FirstExchangeResult#fromFirstServerResponse(firstServerResponse)`).
Tests used various mocks of `AuthFactory`, which each set up a partial factory, based on subsets of the same canonical data. These partials (`setupSaltAndIterations()` and `setupSaltAndIterationsAndKeys()`) have been replaced with one method that sets up everything: salt, iterations, password and keys. The new method name is `setupCanonicalAuthData()`. This encodes 'valid SCRAM credentials', avoids subtle divergence between tests, and reduces fragile setup duplication.
All in all, this does not introduce functional changes, but upgrades the code to be better self-describing, and easier to adapt to future use-cases.- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerFakeKeyTest.java (version 8efaed2c798d1b769d06353b5e6bbde173420689)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerSaltTest.java (version 8efaed2c798d1b769d06353b5e6bbde173420689)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerTest.java (version 8efaed2c798d1b769d06353b5e6bbde173420689)
-
Guus der Kinderen 71a75005300818ff1614f592e6941dd92c844967
Refactor SCRAM-SHA-1 unit tests: Introduce test constants class
This introduces a test fixture that defines stable, shared test data, canonical protocol constants, and repeated values with semantic meaning.
Usage of constants from this new fixture avoids using hard-coded values in tests. This makes intent clearer (by referring to data by a meaningful name, rather than by a 'magic value').- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerFakeKeyTest.java (version 71a75005300818ff1614f592e6941dd92c844967)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerSaltTest.java (version 71a75005300818ff1614f592e6941dd92c844967)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerTest.java (version 71a75005300818ff1614f592e6941dd92c844967)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1TestFixtures.java (version 71a75005300818ff1614f592e6941dd92c844967)
-
Guus der Kinderen 09d08932969a4f91547acf549009c7b11c3f0508
Refactor SCRAM-SHA-1 unit test: separate generic vs SHA-1-specific tests
The goal of this change is to prepare the unit test structure for SHA-256 re-use.
A new abstract test class is created that now contains tests for:
- state machine
- malformed input
- negotiated properties
- channel binding behavior
Tests (and helpers) for protocol semantics, SASL contract behavior and algorithm-independent SCRAM behavior now live in that abstract class. SHA-1-specific cryptographic behavior, mechanism naming and success path details remain in the SCRAM-SHA-1 specific class.
The fake salt determinism, fake key generation and user enumeration protection responsibilities are deliberately not folded into the same abstract class, as that would cause us to end up with a "god test class". There is some duplication in those that is worth removing, but that will be the subject of a future commit.- xmppserver/src/main/java/org/jivesoftware/openfire/sasl/ScramSaslServer.java (version 09d08932969a4f91547acf549009c7b11c3f0508)
- xmppserver/src/main/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServer.java (version 09d08932969a4f91547acf549009c7b11c3f0508)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/AbstractScramSaslServerTest.java (version 09d08932969a4f91547acf549009c7b11c3f0508)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/FirstExchangeResult.java (version 09d08932969a4f91547acf549009c7b11c3f0508)
- xmppserver/src/test/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServerTest.java (version 09d08932969a4f91547acf549009c7b11c3f0508)
-
Guus der Kinderen 26d1e5aba92926398c355885dce6be950e930f67
OF-3292: Remove dead code: JavaScript resource serving functionality
- Delete ResourceServlet and related HTTP endpoint
- Remove getJavaScriptUrl() from HttpBindManager
- Remove javascriptaddress form field from HttpBindStatus
- Remove "Javascript Cache" from CacheFactory configuration
- Remove related i18n strings across all locale files
This functionality was no longer wired into the web.xml descriptor and is not actively used.- i18n/src/main/resources/openfire_i18n.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_cs_CZ.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_de.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_es.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_fa_IR.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_fr.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_he.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_ja_JP.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_nl.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_pl_PL.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_pt_BR.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_pt_PT.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_ru_RU.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_sk.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_uk_UA.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- i18n/src/main/resources/openfire_i18n_zh_CN.properties (version 26d1e5aba92926398c355885dce6be950e930f67)
- xmppserver/src/main/java/org/jivesoftware/openfire/commands/admin/HttpBindStatus.java (version 26d1e5aba92926398c355885dce6be950e930f67)
- xmppserver/src/main/java/org/jivesoftware/openfire/http/HttpBindManager.java (version 26d1e5aba92926398c355885dce6be950e930f67)
- xmppserver/src/main/java/org/jivesoftware/openfire/http/ResourceServlet.java (version 26d1e5aba92926398c355885dce6be950e930f67)
- xmppserver/src/main/java/org/jivesoftware/util/cache/CacheFactory.java (version 26d1e5aba92926398c355885dce6be950e930f67)