-
Notifications
You must be signed in to change notification settings - Fork 4
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
Client Side Tracing & OAuth implementation #66
Conversation
void startup(@Observes StartupEvent event) { | ||
Multi.createFrom().ticks().every(duration) | ||
.emitOn(Infrastructure.getDefaultWorkerPool()) | ||
// .filter(aLong -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented it as we will not receive refresh token in client_credentials OAuth flow
|
||
Function<SyntheticCreationalContext<MessagingService>, MessagingService> function = recorder.init(config, shutdown); | ||
|
||
additionalBeanBuildItemBuildProducer.produce(AdditionalBeanBuildItem.unremovableOf(OidcProvider.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ozangunalp is there a way we can produce this bean only if oidc properties are configured by user. I see some warnings/errors thrown by oidc-client library when no configuration is available(in case of basic authentication or any other type of authentication). This is not blocking message flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the easier option is to make it do nothing when oauth authentication is not configured.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For OAuth:
@SravanThotakura05 Overall we need a Quarkus integration test to properly check the token retrieval and refresh. I've made a try here:
https://github.com/ozangunalp/solace-quarkus/pull/new/tracing
For Tracing if there is a "from app to broker to app" propagation test with proper parent traces, it's ok for me.
@ozangunalp i have added your test and it runs fine with initial access token. I have made a small change where we need to update access token only if solace service is connected otherwise messaging service will thrown an exception. For the same reason the access token is not refreshed in tests(Thread.sleep(5000)) since Mutiny encountered this exception. Regarding tracing tests, this file includes a processor test in which app publishes messages to broker and the same is consumed by the application. Do we need to enhance it further? |
Oh, I understand what you mean now. It is ok for me. Token refresh needs more tests in general but I think it is good for a first version. It is already great that we have an end-to-end test for this with Keycloak etc. |
Implemented Client Side tracing & OAuth
Client Side Tracing
a. Trace messages are now generated for messages consumed and published within the extension
b. Context Propagation for existing trace ID will be included in next release
OAuth
a. Implemented Client Credential flow
b. Users now configure refresh interval to fetch access token before expiry
c. Refer to https://quarkus.io/guides/security-openid-connect-client-reference for supported configuration
Liveness mode is now set to true by default to handle pod restart in Kubernetes. Earlier liveness is set to true when messages are received from queue. This is causing the pod to restart since liveness is not set true within specified threshold