-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix(custom-targets): fix adding jmx-auth custom targets #1408
fix(custom-targets): fix adding jmx-auth custom targets #1408
Conversation
Seems like as of now there are 4 cases:
I think if we are using sessionCredentials and dryRun=false, the web-client should be careful to never supply the request with credentials since the backend does not know which settings the web-client is using. Instead maybe if (for the web-client) we are using session credentials, we attach the credentials as jmx-auth headers, and if we are using backend credentials, we attach it as form body parameters like it is currently implemented? |
3ead18a
to
94d357e
Compare
Test image available:
|
What does this mean? As in supplying the target creation test request with body paremeter credentials (which become stored credentials)? |
Yeah, that's what I meant, but I'm thinking not to do it this way and instead just use another query parameter which lets the backend know whether to save the supplied credentials to the db as storedCredentials or to save it as sessionCredentials. |
Makes sense. Seems neater to use query params (saving some refactoring for frontend)... |
Seems fine to add a query param like |
94d357e
to
25a034e
Compare
I will fix tests once everything is ok'd. |
Looks good. |
Looks good to me too! |
Tested with cryostatio/cryostat-web#907. Credentials are found and target creation form succeeds. |
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
25a034e
to
6247a2e
Compare
Test image available:
|
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
git commit --amend --signoff
Fixes: #1404
Description of the change:
This change allows the Custom Target creation post handler to use credentials in the dao directly (also check session credentials if any). This is because before, the handler would query existing targets in the database and find and use any credentials that match a target using the credentials match expression.
Tests not fixed yet just to confirm that this implementation is what is needed for the web-client to use.
How to manually test:
target.connectUrl == "service:jmx:rmi:///jndi/rmi://localhost:9091/jmxrmi"
)service:jmx:rmi:///jndi/rmi://localhost:9091/jmxrmi
), test the connection, and add the target and notice that it passes.