Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump io.smallrye.config:smallrye-config-source-yaml from 3.8.2 to 3.9.0 in /devtools/gradle #166

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion devtools/gradle/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugin-publish = "1.2.1"

# updating Kotlin here makes QuarkusPluginTest > shouldNotFailOnProjectDependenciesWithoutMain(Path) fail
kotlin = "2.0.0"
smallrye-config = "3.8.2"
smallrye-config = "3.9.0"

junit5 = "5.10.2"
assertj = "3.25.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ public void transform(TransformationContext ctx) {
@BuildStep
void produceTenantIdentityProviders(BuildProducer<SyntheticBeanBuildItem> syntheticBeanProducer,
OidcRecorder recorder, BeanDiscoveryFinishedBuildItem beans, CombinedIndexBuildItem combinedIndex) {
if (!combinedIndex.getIndex().getAnnotations(TENANT_NAME).isEmpty()) {
var tenantAnnotations = combinedIndex.getIndex().getAnnotations(TENANT_NAME);
if (!tenantAnnotations.isEmpty()) {

// create TenantIdentityProviders for tenants selected with @Tenant like: @Tenant("my-tenant")
beans
.getInjectionPoints()
Expand Down Expand Up @@ -301,10 +303,9 @@ public void registerTenantResolverInterceptor(Capabilities capabilities, OidcRec
.stream()
.map(AnnotationInstance::target)
// ignored field injection points and injection setters
// as we don't want to count in the TenantIdentityProvider injection point
.filter(t -> t.kind() == METHOD)
.map(AnnotationTarget::asMethod)
.anyMatch(m -> !m.isConstructor() && !m.hasAnnotation(DotNames.INJECT));
// as we don't want to count in the TenantIdentityProvider injection point;
// if class is the target, we know it cannot be a TenantIdentityProvider as we produce it ourselves
.anyMatch(t -> isMethodWithTenantAnnButNotInjPoint(t) || t.kind() == CLASS);
if (foundTenantResolver) {
// register method interceptor that will be run before security checks
bindingProducer.produce(
Expand All @@ -315,6 +316,10 @@ public void registerTenantResolverInterceptor(Capabilities capabilities, OidcRec
}
}

private static boolean isMethodWithTenantAnnButNotInjPoint(AnnotationTarget t) {
return t.kind() == METHOD && !t.asMethod().isConstructor() && !t.hasAnnotation(DotNames.INJECT);
}

private static boolean detectUserInfoRequired(BeanRegistrationPhaseBuildItem beanRegistrationPhaseBuildItem) {
return isInjected(beanRegistrationPhaseBuildItem, USER_INFO_NAME, null);
}
Expand Down Expand Up @@ -356,14 +361,6 @@ private static boolean isApplicationPackage(String injectionPointTargetInfo) {
&& !injectionPointTargetInfo.startsWith(SMALLRYE_JWT_PACKAGE);
}

private static String toTargetName(AnnotationTarget target) {
if (target.kind() == CLASS) {
return target.asClass().name().toString();
} else {
return target.asMethod().declaringClass().name().toString() + "#" + target.asMethod().name();
}
}

public static class IsEnabled implements BooleanSupplier {
OidcBuildTimeConfig config;

Expand Down