-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds migration and column for
doc_type_label
and fixes virus scanni…
…ng logic (#424) * Adds migration and column for doc type label for user_files table. * Fixes an issue with virus scanning if using the noop scanner (would always say the files was scanned even if feature was disabled.) * Creates annotation for @DynamicField and some tests for that work. * Adds dynamic field handling for validation * Updates readme Co-Authored-By: Lauren Kemperman; lkemperman@codeforamerica.org
- Loading branch information
1 parent
a8626c9
commit 5ca8004
Showing
31 changed files
with
536 additions
and
151 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
24 changes: 24 additions & 0 deletions
24
src/main/java/formflow/library/data/annotations/DynamicField.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package formflow.library.data.annotations; | ||
|
||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import jakarta.validation.Payload; | ||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
@Target({ElementType.FIELD, TYPE, ANNOTATION_TYPE}) | ||
@Retention(RUNTIME) | ||
@Documented | ||
public @interface DynamicField { | ||
|
||
String message() default ""; | ||
|
||
Class<?>[] groups() default {}; | ||
|
||
Class<? extends Payload>[] payload() default {}; | ||
|
||
} |
3 changes: 2 additions & 1 deletion
3
...rmflow/library/data/validators/Money.java → ...mflow/library/data/annotations/Money.java
This file contains 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
3 changes: 2 additions & 1 deletion
3
...rmflow/library/data/validators/Phone.java → ...mflow/library/data/annotations/Phone.java
This file contains 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
This file contains 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
1 change: 1 addition & 0 deletions
1
src/main/java/formflow/library/data/validators/PhoneValidator.java
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package formflow.library.inputs; | ||
|
||
public class FieldNameMarkers { | ||
|
||
public static final String UNVALIDATED_FIELD_MARKER_CSRF = "_csrf"; | ||
public static final String UNVALIDATED_FIELD_MARKER_VALIDATE_ADDRESS = "validate_"; | ||
public static final String UNVALIDATED_FIELD_MARKER_VALIDATED = "_validated"; | ||
public static final String DYNAMIC_FIELD_MARKER = "_wildcard_"; | ||
} |
Oops, something went wrong.