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

feat(agent): two-way communications #1608

Merged
merged 14 commits into from
Sep 19, 2023
Merged
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 pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<com.google.dagger.version>2.47</com.google.dagger.version>
<com.google.dagger.compiler.version>${com.google.dagger.version}</com.google.dagger.compiler.version>

<io.cryostat.core.version>2.21.1</io.cryostat.core.version>
<io.cryostat.core.version>2.22.0</io.cryostat.core.version>

<org.openjdk.nashorn.core.version>15.4</org.openjdk.nashorn.core.version>
<org.apache.commons.lang3.version>3.12.0</org.apache.commons.lang3.version>
Expand Down
1 change: 1 addition & 0 deletions smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ runDemoApps() {
--env CRYOSTAT_AGENT_TRUST_ALL="true" \
--env CRYOSTAT_AGENT_AUTHORIZATION="Basic $(echo user:pass | base64)" \
--env CRYOSTAT_AGENT_REGISTRATION_PREFER_JMX="false" \
--env CRYOSTAT_AGENT_API_WRITES_ENABLED="true" \
--rm -d quay.io/andrewazores/quarkus-test:latest

# copy a jboss-client.jar into /clientlib first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.openjdk.jmc.rjmx.services.jfr.IRecordingDescriptor;
import org.openjdk.jmc.rjmx.services.jfr.IRecordingDescriptor.RecordingState;

import io.cryostat.core.serialization.SerializableRecordingDescriptor;
import io.cryostat.recordings.RecordingMetadataManager.Metadata;

import org.apache.commons.lang3.builder.EqualsBuilder;
Expand Down

This file was deleted.

8 changes: 4 additions & 4 deletions src/main/java/io/cryostat/messaging/MessagingServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import io.cryostat.messaging.notifications.NotificationFactory;
import io.cryostat.messaging.notifications.NotificationListener;
import io.cryostat.net.AuthManager;
import io.cryostat.net.AuthorizationErrorException;
import io.cryostat.net.AuthenticationErrorException;
import io.cryostat.net.HttpServer;
import io.cryostat.net.security.ResourceAction;
import io.cryostat.net.web.http.HttpMimeType;
Expand Down Expand Up @@ -132,7 +132,7 @@ public void start() throws SocketException, UnknownHostException {
.onFailure(
() ->
promise.fail(
new AuthorizationErrorException(
new AuthenticationErrorException(
"")))
.execute();
} catch (InterruptedException
Expand All @@ -146,9 +146,9 @@ public void start() throws SocketException, UnknownHostException {
if (result.failed()) {
if (ExceptionUtils.hasCause(
result.cause(),
AuthorizationErrorException.class)) {
AuthenticationErrorException.class)) {
logger.info(
(AuthorizationErrorException)
(AuthenticationErrorException)
result.cause());
logger.info(
"Disconnected remote client {} due to"
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/io/cryostat/net/AgentApiException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright The Cryostat Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.cryostat.net;

public class AgentApiException extends RuntimeException {
public AgentApiException(int statusCode) {
super(String.format("Unexpected HTTP response code %d", statusCode));
}
}
Loading
Loading