-
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.
- Loading branch information
Showing
35 changed files
with
315 additions
and
167 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
org.gradle.jvmargs=-Xmx1024M | ||
quarkusPlatformVersion=3.14.4 | ||
quarkusPluginVersion=3.14.4 | ||
sentryVersion=7.14.0 | ||
twelveMonkeysVersion=3.11.0 | ||
quarkusPlatformVersion=3.16.1 | ||
quarkusPluginVersion=3.16.1 | ||
sentryVersion=7.16.0 | ||
javaXtVersion=2.1.9 | ||
twelveMonkeysVersion=3.12.0 | ||
spotlessPluginVersion=6.25.0 | ||
lombokPluginVersion=8.10 | ||
lombokPluginVersion=8.10.2 |
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
19 changes: 9 additions & 10 deletions
19
quarkus-sentry/runtime/src/main/java/app/fyreplace/api/sentry/config/SentryConfig.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 |
---|---|---|
@@ -1,28 +1,27 @@ | ||
package app.fyreplace.api.sentry.config; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
import io.smallrye.config.ConfigMapping; | ||
import io.smallrye.config.WithDefault; | ||
import java.util.Optional; | ||
|
||
@SuppressWarnings("OptionalUsedAsFieldOrParameterType") | ||
@ConfigRoot(phase = ConfigPhase.RUN_TIME, name = "sentry") | ||
public final class SentryConfig { | ||
@ConfigMapping(prefix = "quarkus.sentry") | ||
@ConfigRoot(phase = ConfigPhase.RUN_TIME) | ||
public interface SentryConfig { | ||
/** | ||
* Sentry Data Source Name. | ||
*/ | ||
@ConfigItem | ||
public Optional<String> dsn = Optional.empty(); | ||
Optional<String> dsn(); | ||
|
||
/** | ||
* Environment the events are tagged with. | ||
*/ | ||
@ConfigItem | ||
public Optional<String> environment = Optional.empty(); | ||
Optional<String> environment(); | ||
|
||
/** | ||
* Percentage of performance events sent to Sentry. | ||
*/ | ||
@ConfigItem(defaultValue = "0.0") | ||
public Optional<Double> tracesSampleRate = Optional.empty(); | ||
@WithDefault("0.0") | ||
Optional<Double> tracesSampleRate(); | ||
} |
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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/app/fyreplace/api/data/validators/Length.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,26 @@ | ||
package app.fyreplace.api.data.validators; | ||
|
||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import jakarta.validation.Constraint; | ||
import jakarta.validation.Payload; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
@SuppressWarnings("unused") | ||
@Retention(RUNTIME) | ||
@Target({FIELD, PARAMETER}) | ||
@Constraint(validatedBy = LengthValidator.class) | ||
public @interface Length { | ||
String message() default "does not meet length requirements"; | ||
|
||
Class<?>[] groups() default {}; | ||
|
||
Class<? extends Payload>[] payload() default {}; | ||
|
||
int min() default 0; | ||
|
||
int max() default Integer.MAX_VALUE; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/app/fyreplace/api/data/validators/LengthValidator.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,21 @@ | ||
package app.fyreplace.api.data.validators; | ||
|
||
import jakarta.validation.ConstraintValidator; | ||
import jakarta.validation.ConstraintValidatorContext; | ||
|
||
public final class LengthValidator implements ConstraintValidator<Length, String> { | ||
private int min; | ||
private int max; | ||
|
||
@Override | ||
public void initialize(final Length constraintAnnotation) { | ||
min = constraintAnnotation.min(); | ||
max = constraintAnnotation.max(); | ||
} | ||
|
||
@Override | ||
public boolean isValid(final String value, final ConstraintValidatorContext context) { | ||
final var count = value.codePointCount(0, value.length()); | ||
return count >= min && count <= max; | ||
} | ||
} |
Oops, something went wrong.