added NoXss validation
This commit is contained in:
parent
8e400fa2b4
commit
599ccdc43c
@ -30,6 +30,7 @@ import org.thingsboard.server.common.data.id.MobileAppId;
|
|||||||
import org.thingsboard.server.common.data.id.TenantId;
|
import org.thingsboard.server.common.data.id.TenantId;
|
||||||
import org.thingsboard.server.common.data.mobile.layout.MobileLayoutConfig;
|
import org.thingsboard.server.common.data.mobile.layout.MobileLayoutConfig;
|
||||||
import org.thingsboard.server.common.data.validation.Length;
|
import org.thingsboard.server.common.data.validation.Length;
|
||||||
|
import org.thingsboard.server.common.data.validation.NoXss;
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
@ -40,9 +41,11 @@ public class MobileAppBundle extends BaseData<MobileAppBundleId> implements HasT
|
|||||||
private TenantId tenantId;
|
private TenantId tenantId;
|
||||||
@Schema(description = "Application bundle title. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "Application bundle title. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
|
@NoXss
|
||||||
@Length(fieldName = "title")
|
@Length(fieldName = "title")
|
||||||
private String title;
|
private String title;
|
||||||
@Schema(description = "Application bundle description.")
|
@Schema(description = "Application bundle description.")
|
||||||
|
@NoXss
|
||||||
@Length(fieldName = "description")
|
@Length(fieldName = "description")
|
||||||
private String description;
|
private String description;
|
||||||
@Schema(description = "Android application id")
|
@Schema(description = "Android application id")
|
||||||
|
|||||||
@ -62,6 +62,7 @@ public class NotificationRule extends BaseData<NotificationRuleId> implements Ha
|
|||||||
@Valid
|
@Valid
|
||||||
private NotificationRuleRecipientsConfig recipientsConfig;
|
private NotificationRuleRecipientsConfig recipientsConfig;
|
||||||
|
|
||||||
|
@Valid
|
||||||
private NotificationRuleConfig additionalConfig;
|
private NotificationRuleConfig additionalConfig;
|
||||||
|
|
||||||
private NotificationRuleId externalId;
|
private NotificationRuleId externalId;
|
||||||
|
|||||||
@ -16,12 +16,14 @@
|
|||||||
package org.thingsboard.server.common.data.notification.rule;
|
package org.thingsboard.server.common.data.notification.rule;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.thingsboard.server.common.data.validation.NoXss;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class NotificationRuleConfig implements Serializable {
|
public class NotificationRuleConfig implements Serializable {
|
||||||
|
|
||||||
|
@NoXss
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import jakarta.validation.constraints.NotEmpty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.thingsboard.server.common.data.notification.NotificationDeliveryMethod;
|
import org.thingsboard.server.common.data.notification.NotificationDeliveryMethod;
|
||||||
|
import org.thingsboard.server.common.data.validation.NoXss;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -43,6 +44,7 @@ public abstract class DeliveryMethodNotificationTemplate {
|
|||||||
|
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
|
@NoXss
|
||||||
protected String body;
|
protected String body;
|
||||||
|
|
||||||
public DeliveryMethodNotificationTemplate(DeliveryMethodNotificationTemplate other) {
|
public DeliveryMethodNotificationTemplate(DeliveryMethodNotificationTemplate other) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user