Implement "all" endpoints supporting to configure whole instances#222
Draft
pathob wants to merge 11 commits into
Draft
Implement "all" endpoints supporting to configure whole instances#222pathob wants to merge 11 commits into
pathob wants to merge 11 commits into
Conversation
409ad69 to
d34c610
Compare
6ce4812 to
95d6b8d
Compare
e10fca3 to
972184b
Compare
b29c8d8 to
98c8bbf
Compare
|
…tion - Add map-based setLicenses overload (key → LicenseModel) to LicensesService API and all three product implementations; response keys are redacted via LicenseKeyRedactor (first4...last4#hash4 format) - Introduce LicenseKeyRedactor utility with SHA-1-based key redaction and tests - Refactor _AbstractAllServiceImpl: generalize setEntity to <I,O>, sanitize exception details to only expose messages from mapped WebApplicationExceptions - Sweep all three _AllServiceImpl files to use static BootstrAPI constants exclusively (remove reflection-based entityType() helpers) - Add _AllResourceTest for Jira and Confluence mirroring Crowd's test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er/setAuthentication - Add default setMailServer/getMailServer to MailServerService delegating to smtp/pop - Add default setAuthentication/getAuthentication to AuthenticationService delegating to idps/sso - Add setSettings/getSettings to JiraSettingsService as default methods - Extend ConfluenceSettingsService to also include SettingsBrandingService; introduce ConfluenceSettingsServiceImpl composing SettingsServiceImpl + SettingsBrandingServiceImpl - Introduce CrowdSettingsService unifying CrowdSettingsGeneralService + CrowdSettingsBrandingService; introduce CrowdSettingsServiceImpl composing both - Reduce _AllServiceImpl in all three products to flat single setEntity calls per top-level section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Composite service methods (setSettings, setMailServer, setAuthentication) now return ServiceResult<T> carrying both the result model and a sub-map of per-field status entries. _AbstractAllServiceImpl.setEntityWithStatus merges these sub-maps into the top-level status map, so the PUT / response exposes fine-grained keys like settings/general, mail-server/smtp, and authentication/idps rather than a single coarse entry per composite. ServiceResultUtil extracts entityType() and toErrorStatus() as public statics so service interfaces can use them without depending on the abstract class. AbstractAuthenticationIdpModel gains an explicit @XmlRootElement name to enable the same key derivation for the idps entry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bug fixes - Fix NPE in ServiceResultUtil.toErrorStatus for non-standard HTTP codes (e.g. 422, 429) by accepting an int status code on _AllModelStatus.error. - Wrap the composite call in _AbstractAllServiceImpl.setEntityWithStatus so a thrown exception inside setSettings/setMailServer/setAuthentication no longer kills the entire setAll; the failure is attributed to the top-level group derived from the input's @XmlRootElement. - Log non-WAE exceptions server-side before sanitizing them out of the client response. - Fix Jira LicensesServiceImpl.setLicenses(Map) to call addLicense per-key like Confluence/Crowd. The previous implementation paired input keys with JiraLicenseManager.getLicenses() entries by index, but the API makes no ordering guarantee. - Fix Crowd and Confluence ServiceConfig to call existing bean methods instead of `new`-ing duplicate instances for the composite settings service (CGLIB caching was being bypassed). - Fix copy-paste in BootstrAPI.SETTINGS_GENERAL_PUT_RESPONSE_DESCRIPTION. Status-key convention - Split the formerly-overloaded entityType() into two named operations: entityType(Class) returns the raw @XmlRootElement.name (used for top-level keys like mail-templates, session-config) and subEntityKey(Class) splits on the last dash for sub-field keys like settings/general, mail-server/smtp, permissions/global. This removes the silent transform that was incorrectly mapping mail-templates to mail/templates. - Rewrite _AbstractAllResourceImpl.computeOverallStatus to use 207 Multi-Status for mixed outcomes, 500 for any 5xx, the common 4xx when all client errors agree, and 200 otherwise. Design cleanup - Have Confluence's SettingsServiceImpl implement SettingsGeneralService and SettingsSecurityService (it had no interface before). - Have Crowd's CrowdSettingsServiceImpl take interfaces, not concrete impl types, in its constructor. - Remove the unused MailServerModel.EXAMPLE_1 and stale imports across the three _AllServiceImpl files. Docs - Fix _AllModel.md in all three products: licenses is a Map, not a List. - Fix AllApi.md in all three products: the response body is _AllModel (with the status map and redacted license keys), not empty. Tests (+22, all passing) - New ServiceResultUtilTest covers entityType, subEntityKey edge cases, the NPE fix, and exception sanitization. - New _AbstractAllResourceImplTest covers the new aggregation logic. - LicensesServiceTest gets a Jira-specific test verifying redaction and per-key pairing for the new setLicenses(Map) overload. - Rename Crowd AllResourceTest -> _AllResourceTest for naming parity with Jira/Confluence; add status-aggregation tests to all three. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.