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

JWT Config key behevior different in native and jvm mode #16099

Closed
Andro999b opened this issue Mar 29, 2021 · 2 comments · Fixed by #23421
Closed

JWT Config key behevior different in native and jvm mode #16099

Andro999b opened this issue Mar 29, 2021 · 2 comments · Fixed by #23421
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@Andro999b
Copy link
Contributor

Andro999b commented Mar 29, 2021

Describe the bug

mp.jwt.verify.publickey.location is build time config key in native mode
and runtime in jvm mode

Expected behavior

mp.jwt.verify.publickey.location to be runtime evaluated in both jvm and native

Actual behavior

mp.jwt.verify.publickey.location evaluate during build in native mode

Steps to reproduce the behavior:

  1. Use env varaible in mp.jwt.verify.publickey.location like: http://${NAMESPACE}-accounts.${NAMESPACE}.svc.cluster.local/jwks
  2. Observe: Build step io.quarkus.smallrye.jwt.deployment.SmallRyeJwtProcessor#registerNativeImageResources threw an exception: java.util.NoSuchElementException: SRCFG00011: Could not expand value NAMESPACE in property mp.jwt.verify.publickey.location

Output of uname -a or ver

Linux andrii-PC 5.4.0-70-generic #78-Ubuntu SMP Fri Mar 19 13:29:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.9" 2020-10-20
OpenJDK Runtime Environment GraalVM CE 20.3.0 (build 11.0.9+10-jvmci-20.3-b06)
OpenJDK 64-Bit Server VM GraalVM CE 20.3.0 (build 11.0.9+10-jvmci-20.3-b06, mixed mode, sharing)

GraalVM version (if different from Java)

openjdk version "11.0.9" 2020-10-20
OpenJDK Runtime Environment GraalVM CE 20.3.0 (build 11.0.9+10-jvmci-20.3-b06)
OpenJDK 64-Bit Server VM GraalVM CE 20.3.0 (build 11.0.9+10-jvmci-20.3-b06, mixed mode, sharing)

Quarkus version or git rev

1.13.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 6.5.1

@Andro999b Andro999b added the kind/bug Something isn't working label Mar 29, 2021
@sberyozkin
Copy link
Member

@radcortez hey Roberto, how would we tackle this one :-) ? (I believe it is not a smallrye-jwt specific issue and relates to the ongoing conversation about syncing mp-*/smallrye-* properties with the quarkus-namespaced properties)

@radcortez
Copy link
Member

No, the issue here is that the MP property is being queried during build time to register the resource with the native image. But we don't want to force configuration properties outside the quarkus namespace to be build time. I've made a fix that registers the resource if we can find one, and if not it is on the user to provide the correct configuration during runtime.

@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Feb 3, 2022
@gsmet gsmet modified the milestones: 2.8 - main, 2.7.1.Final Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants