-
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(credentials): query for Agent HTTP credentials without specific userinfo #1674
fix(credentials): query for Agent HTTP credentials without specific userinfo #1674
Conversation
Hi @andrewazores! Add at least one of the required labels to this PR Required labels are : chore,ci,cleanup,docs,feat,fix,perf,refactor,style,test |
/build_test |
To run smoketest:
|
I get this error:
|
https://httpie.io/docs/cli/https Add |
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.
Still get the error:
HTTP/1.1 500 Internal Server Error
content-encoding: gzip
content-length: 214
content-type: application/json
{
"data": {
"reason": "java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.CompletionException: java.lang.RuntimeException: org.apache.http.auth.InvalidCredentialsException: No credentials found for agent http://localhost:9988/"
},
"meta": {
"status": "Internal Server Error",
"type": "text/plain"
}
}
Go to the Security view in th Web UI. Are there stored credentials for that agent connection URL listed? |
553b8bb
to
6c15238
Compare
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.
looks good to me - just need to rebase
6c15238
to
cbe7f07
Compare
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/main
Fixes: #1673
Description of the change:
When querying for stored credentials by
targetId
, check if the providedtargetId
is JMX. If not, assume it is Agent HTTP, and check if there is an exact match for the giventargetId
as well as if there is a match for thattargetId
without theuserinfo
part of the URI.Motivation for the change:
This way the credentials querying is lenient on clients not including stored credentials in the Agent HTTP URI, which should not normally be expected - the server has those credentials stored in the encrypted database table, provided to it by the Agent instance, so these credentials are not known to the client and the reference to them in the database should also not be required knowledge for the client to perform queries.
How to manually test:
https -vv --auth=user:pass :8181/api/v2.3/targets/$(echo -n http://localhost:9988/ | jq -sRr @uri)/mbeanMetrics
and ensure that the response is a JSON object containing MBean information.