Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
9ea1a37
Add _all endpoint applying a complete configuration in one request
pathob Jul 4, 2026
9f8fd49
Move map-based setLicenses into the LicensesService interface
pathob Jul 5, 2026
c8ab876
Replace crowd functional test fixtures with model example constants
pathob Jul 5, 2026
fdda605
Document the RFC stance of the 207 aggregation
pathob Jul 5, 2026
663236a
Merge the product settings composites into one implementation each
pathob Jul 5, 2026
6fb6389
Drop the authentication service and resource type parameters
pathob Jul 5, 2026
acf33a8
Key sub-field statuses by the request's JSON field paths
pathob Jul 5, 2026
6d7990e
Aggregate the overall status as unanimous-or-207
pathob Jul 5, 2026
3c6790b
Extract commons base models for the _all and settings hierarchies
pathob Jul 6, 2026
751f37e
Derive status-map keys from the models via @SubEntityOf
pathob Jul 6, 2026
a9af1b4
Persist Confluence security settings and keep status order
pathob Jul 6, 2026
432a41c
Rename Abstract_AllResourceFuncTest to _AbstractAllResourceFuncTest
pathob Jul 6, 2026
48654ef
Harden the _all request handling and reflective path derivation
pathob Jul 6, 2026
1c74288
Trim the shadowed OpenAPI copy, dead constants and stale wording
pathob Jul 6, 2026
e880204
Share the apply-and-record core between the status helpers
pathob Jul 6, 2026
223bace
Return the highest sub-field status code for the _all endpoint
pathob Jul 6, 2026
6f227d7
Derive the trusted-proxies status key from a getter reference
pathob Jul 6, 2026
5957605
Split the settings base so every product model extends it
pathob Jul 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

public class BootstrAPI {

public static final String ALL = "all";
public static final String _ALL = "_all";

Check failure on line 5 in commons/src/main/java/com/deftdevs/bootstrapi/commons/constants/BootstrAPI.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.

See more on https://sonarcloud.io/project/issues?id=deftdevs_bootstrapi&issues=AZ4-8usFsVWpy8fCo6T5&open=AZ4-8usFsVWpy8fCo6T5&pullRequest=222
public static final String _ROOT = "/";

Check failure on line 6 in commons/src/main/java/com/deftdevs/bootstrapi/commons/constants/BootstrAPI.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.

See more on https://sonarcloud.io/project/issues?id=deftdevs_bootstrapi&issues=AZ4-8usFsVWpy8fCo6T6&open=AZ4-8usFsVWpy8fCo6T6&pullRequest=222

public static final String APPLICATION = "application";
public static final String APPLICATIONS = "applications";
public static final String APPLICATION_LINK = "application-link";
Expand Down Expand Up @@ -49,6 +51,7 @@
public static final String SETTINGS_BRANDING_LOGIN_PAGE = "login-page";
public static final String SETTINGS_BRANDING_LOGO = "logo";
public static final String SETTINGS_CUSTOM_HTML = "custom-html";
public static final String SETTINGS_GENERAL = "general";
public static final String SETTINGS_SECURITY = "security";
public static final String USER = "user";
public static final String USERS = "users";
Expand All @@ -57,10 +60,20 @@
public static final String MEDIA_TYPE_IMAGE = "image/*";

public static final String ERROR_COLLECTION_RESPONSE_DESCRIPTION = "Returns a list of error messages.";
public static final String _ALL_PUT_SUMMARY = "Apply a complete configuration";

Check failure on line 63 in commons/src/main/java/com/deftdevs/bootstrapi/commons/constants/BootstrAPI.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.

See more on https://sonarcloud.io/project/issues?id=deftdevs_bootstrapi&issues=AZ8sWAkD2ZtEwoSju9jd&open=AZ8sWAkD2ZtEwoSju9jd&pullRequest=222
public static final String _ALL_PUT_RESPONSE_DESCRIPTION = "Returns the updated configuration. The per-sub-field outcome is reported in the"

Check failure on line 64 in commons/src/main/java/com/deftdevs/bootstrapi/commons/constants/BootstrAPI.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.

See more on https://sonarcloud.io/project/issues?id=deftdevs_bootstrapi&issues=AZ8sWAkD2ZtEwoSju9je&open=AZ8sWAkD2ZtEwoSju9je&pullRequest=222
+ " 'status' map, keyed by the request's field paths (e.g. 'settings/general', 'mailServer/smtp';"
+ " 2xx for success, 4xx/5xx for failure with a human-readable 'message' and optional 'details')."
+ " License keys in the response are redacted (e.g. 'AAAB...wxyz#a1b2')."
+ " If any sub-field fails, the highest sub-field status code is returned with the same response body.";
public static final String _ALL_PUT_FAILURE_RESPONSE_DESCRIPTION = "One or more sub-fields failed to apply. The response code is the highest"

Check failure on line 69 in commons/src/main/java/com/deftdevs/bootstrapi/commons/constants/BootstrAPI.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.

See more on https://sonarcloud.io/project/issues?id=deftdevs_bootstrapi&issues=AZ83QI0DT67pfladuKfP&open=AZ83QI0DT67pfladuKfP&pullRequest=222
+ " sub-field status code; inspect the per-sub-field 'status' map in the response body to see which"
+ " fields succeeded and which failed. Request-level errors (e.g. a missing request body) return an"
+ " error message list instead.";
public static final String SETTINGS_GENERAL_GET_SUMMARY = "Get the general settings";
public static final String SETTINGS_GENERAL_GET_RESPONSE_DESCRIPTION = "Returns the general settings";
public static final String SETTINGS_GENERAL_PUT_SUMMARY = "Set the general settings";
public static final String SETTINGS_GENERAL_PUT_RESPONSE_DESCRIPTION = "Returns the general security settings";
public static final String SETTINGS_GENERAL_PUT_RESPONSE_DESCRIPTION = "Returns the updated general settings";
public static final String SETTINGS_SECURITY_GET_SUMMARY = "Get the security settings";
public static final String SETTINGS_SECURITY_GET_RESPONSE_DESCRIPTION = "Returns the security settings";
public static final String SETTINGS_SECURITY_PUT_SUMMARY = "Set the security settings";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
import lombok.experimental.SuperBuilder;

import javax.xml.bind.annotation.XmlElement;
import com.deftdevs.bootstrapi.commons.model.type.SubEntityOf;
import javax.xml.bind.annotation.XmlRootElement;


@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@SubEntityOf(AuthenticationModel.class)
@XmlRootElement
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.deftdevs.bootstrapi.commons.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.xml.bind.annotation.XmlElement;

/**
* Settings group schema for products that support color-scheme branding
* (only Confluence; Crowd brands its login page with a product-specific
* model instead).
*/
@Data
@SuperBuilder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public abstract class AbstractSettingsBrandingModel extends AbstractSettingsSecurityModel {

@XmlElement
private SettingsBrandingColorSchemeModel branding;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.deftdevs.bootstrapi.commons.model;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.xml.bind.annotation.XmlElement;

/**
* Canonical settings group schema shared by all products. Extended by
* {@link AbstractSettingsSecurityModel} and {@link AbstractSettingsBrandingModel}
* for the sub-fields only some products support, so that every product's
* concrete settings model inherits its fields from the class its sub-models
* name via {@code @SubEntityOf} — field names then match by construction.
*/
@Data
@SuperBuilder
@NoArgsConstructor
public abstract class AbstractSettingsModel {

@XmlElement
private SettingsGeneralModel general;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.deftdevs.bootstrapi.commons.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.xml.bind.annotation.XmlElement;

/**
* Settings group schema for products that support security settings
* (Confluence and Jira; Crowd does not).
*/
@Data
@SuperBuilder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public abstract class AbstractSettingsSecurityModel extends AbstractSettingsModel {

@XmlElement
private SettingsSecurityModel security;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.deftdevs.bootstrapi.commons.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Map;

import static com.deftdevs.bootstrapi.commons.constants.BootstrAPI.AUTHENTICATION;

@Data
@NoArgsConstructor
@AllArgsConstructor
@XmlRootElement(name = AUTHENTICATION)
public class AuthenticationModel {

@XmlElement
private Map<String, AbstractAuthenticationIdpModel> idps;

@XmlElement
private AuthenticationSsoModel sso;

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import lombok.NoArgsConstructor;

import javax.xml.bind.annotation.XmlElement;
import com.deftdevs.bootstrapi.commons.model.type.SubEntityOf;
import javax.xml.bind.annotation.XmlRootElement;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@SubEntityOf(AuthenticationModel.class)
@XmlRootElement(name = BootstrAPI.AUTHENTICATION + "-" + BootstrAPI.AUTHENTICATION_SSO)
public class AuthenticationSsoModel {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package com.deftdevs.bootstrapi.crowd.model;
package com.deftdevs.bootstrapi.commons.model;

import com.deftdevs.bootstrapi.commons.model.SettingsModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;

import static com.deftdevs.bootstrapi.commons.constants.BootstrAPI.MAIL_SERVER;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@XmlRootElement(name = "all")
public class AllModel {
@XmlRootElement(name = MAIL_SERVER)
public class MailServerModel {

@XmlElement
private SettingsModel settings;
private MailServerSmtpModel smtp;

@XmlElement
private List<ApplicationModel> applications;
private MailServerPopModel pop;

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import com.deftdevs.bootstrapi.commons.model.type.SubEntityOf;
import javax.xml.bind.annotation.XmlRootElement;

@Data
@SuperBuilder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@SubEntityOf(MailServerModel.class)
@XmlRootElement(name = BootstrAPI.MAIL_SERVER + "-" + BootstrAPI.MAIL_SERVER_POP)
public class MailServerPopModel extends AbstractMailServerProtocolModel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
import lombok.experimental.SuperBuilder;

import javax.xml.bind.annotation.XmlElement;
import com.deftdevs.bootstrapi.commons.model.type.SubEntityOf;
import javax.xml.bind.annotation.XmlRootElement;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@SubEntityOf(MailServerModel.class)
@XmlRootElement(name = BootstrAPI.MAIL_SERVER + "-" + BootstrAPI.MAIL_SERVER_SMTP)
public class MailServerSmtpModel extends AbstractMailServerProtocolModel {

Expand Down Expand Up @@ -57,4 +59,14 @@ public boolean getUseTls() {
.timeout(5000L)
.build();

// restricted to the fields supported by all products (e.g. Crowd does not echo name and protocol)
public static final MailServerSmtpModel EXAMPLE_2_MINIMAL = MailServerSmtpModel.builder()
.from(EXAMPLE_2.getFrom())
.prefix(EXAMPLE_2.getPrefix())
.host(EXAMPLE_2.getHost())
.port(EXAMPLE_2.getPort())
.useTls(EXAMPLE_2.getUseTls())
.timeout(EXAMPLE_2.getTimeout())
.build();

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import com.deftdevs.bootstrapi.commons.model.type.SubEntityOf;
import javax.xml.bind.annotation.XmlRootElement;

import static com.deftdevs.bootstrapi.commons.constants.BootstrAPI.*;
Expand All @@ -16,6 +17,7 @@
@Builder
@NoArgsConstructor
@AllArgsConstructor
@SubEntityOf(AbstractSettingsBrandingModel.class)
@XmlRootElement(name = SETTINGS + "-" + SETTINGS_BRANDING + "-" + COLOR_SCHEME)
@XmlAccessorType(XmlAccessType.FIELD)
public class SettingsBrandingColorSchemeModel {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.deftdevs.bootstrapi.commons.model;

import com.deftdevs.bootstrapi.commons.constants.BootstrAPI;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Builder;
Expand All @@ -10,16 +9,21 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import com.deftdevs.bootstrapi.commons.model.type.SubEntityOf;
import javax.xml.bind.annotation.XmlRootElement;
import java.net.URI;

import static com.deftdevs.bootstrapi.commons.constants.BootstrAPI.SETTINGS;
import static com.deftdevs.bootstrapi.commons.constants.BootstrAPI.SETTINGS_GENERAL;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@XmlRootElement(name = BootstrAPI.SETTINGS)
@SubEntityOf(AbstractSettingsModel.class)
@XmlRootElement(name = SETTINGS + "-" + SETTINGS_GENERAL)
@XmlAccessorType(XmlAccessType.FIELD)
public class SettingsModel {
public class SettingsGeneralModel {

@XmlElement
private URI baseUrl;
Expand All @@ -46,20 +50,26 @@ public String getMode() {

// Example instances for documentation and tests

public static final SettingsModel EXAMPLE_1 = SettingsModel.builder()
public static final SettingsGeneralModel EXAMPLE_1 = SettingsGeneralModel.builder()
.title("Example")
.baseUrl(URI.create("https://example.com"))
.mode("private")
.contactMessage("Test Message")
.externalUserManagement(true)
.build();

public static final SettingsModel EXAMPLE_1_NO_MODE = SettingsModel.builder()
public static final SettingsGeneralModel EXAMPLE_1_NO_MODE = SettingsGeneralModel.builder()
.title("Example")
.baseUrl(URI.create("https://example.com"))
.mode(null)
.contactMessage("Test Message")
.externalUserManagement(true)
.build();

// restricted to the fields supported by all products (e.g. Crowd)
public static final SettingsGeneralModel EXAMPLE_1_MINIMAL = SettingsGeneralModel.builder()
.title(EXAMPLE_1.getTitle())
.baseUrl(EXAMPLE_1.getBaseUrl())
.build();

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import com.deftdevs.bootstrapi.commons.model.type.SubEntityOf;
import javax.xml.bind.annotation.XmlRootElement;

import static com.deftdevs.bootstrapi.commons.constants.BootstrAPI.SETTINGS;
Expand All @@ -17,6 +18,7 @@
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@SubEntityOf(AbstractSettingsSecurityModel.class)
@XmlRootElement(name = SETTINGS + "-" + SETTINGS_SECURITY)
@XmlAccessorType(XmlAccessType.FIELD)
public class SettingsSecurityModel {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.deftdevs.bootstrapi.commons.model;

import com.deftdevs.bootstrapi.commons.model.type._AllModelAccessor;
import com.deftdevs.bootstrapi.commons.model.type._AllModelStatus;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.xml.bind.annotation.XmlElement;
import java.util.Map;

/**
* Shared shape of the product _all models: the configuration fields every
* product supports plus the per-sub-field status map of the response.
* Products extend it with their product-specific fields.
*
* @param <S> the product's settings model type
*/
@Data
@SuperBuilder
@NoArgsConstructor
public abstract class _AbstractAllModel<S> implements _AllModelAccessor {

Check warning on line 22 in commons/src/main/java/com/deftdevs/bootstrapi/commons/model/_AbstractAllModel.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this class name to match the regular expression '^[A-Z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=deftdevs_bootstrapi&issues=AZ83QIzYT67pfladuKfM&open=AZ83QIzYT67pfladuKfM&pullRequest=222

@XmlElement
private S settings;

@XmlElement
private Map<String, AbstractDirectoryModel> directories;

@XmlElement
private Map<String, ApplicationLinkModel> applicationLinks;

@XmlElement
private Map<String, LicenseModel> licenses;

@XmlElement
private MailServerModel mailServer;

@XmlElement
private Map<String, _AllModelStatus> status;

}
Loading