Add @JsonIgnore annotations to sensitive methods
Added @JsonIgnore annotations to override methods in StaffAppFormData and ContactFormData classes to prevent them from being serialized.
This commit is contained in:
parent
ed098513f5
commit
1dbb80e5a2
|
|
@ -1,6 +1,7 @@
|
|||
package com.alttd.forms.controlers.apply;
|
||||
|
||||
import com.alttd.forms.form.Form;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
|
@ -90,6 +91,7 @@ public class StaffAppFormData extends Form {
|
|||
@Length(max = 2000, message = "Text can't be longer than 2000 characters")
|
||||
public String other;
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StaffAppFormData{" +
|
||||
|
|
@ -111,21 +113,25 @@ public class StaffAppFormData extends Form {
|
|||
'}';
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public Optional<String> getDiscordBotUrl() {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String getReceiver() {
|
||||
return "apply@alttd.com";
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String getSender() {
|
||||
return email;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String toHtml() {
|
||||
String[] fields = {"Username", "Email", "Discord", "PC requirements", "Age", "Pronoun", "Join date", "Avg time", "Available days", "Available time", "Staff experience", "Plugin experience", "Why staff", "Expectations mod", "Other"};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.alttd.forms.controlers.contact;
|
||||
|
||||
import com.alttd.forms.form.Form;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
|
|
@ -31,6 +32,7 @@ public class ContactFormData extends Form {
|
|||
@Length(min = 11, max = 2000, message = "Your question should have between 10 and 2000 characters")
|
||||
public String question;
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ContactFormData{" +
|
||||
|
|
@ -40,21 +42,25 @@ public class ContactFormData extends Form {
|
|||
'}';
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public Optional<String> getDiscordBotUrl() {
|
||||
return Optional.of("http://discordbot:8001/api/contact/submitContactForm");
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String getReceiver() {
|
||||
return "support@alttd.com";
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String getSender() {
|
||||
return email;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String toHtml() {
|
||||
String[] fields = {"Username", "Email", "Question"};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user