Skip to content
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 Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM jumpserver/chen-base:20251114_082449 AS stage-build
FROM jumpserver/chen-base:20260303_090037 AS stage-build
ENV LANG=en_US.UTF-8

WORKDIR /opt/chen/
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile-base
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN set -ex \
&& chmod 755 /usr/local/bin/check \
&& rm -f check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz

ARG WISP_VERSION=v0.2.8
ARG WISP_VERSION=v0.2.12
RUN set -ex \
&& wget https://github.com/jumpserver/wisp/releases/download/${WISP_VERSION}/wisp-${WISP_VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf wisp-${WISP_VERSION}-linux-${TARGETARCH}.tar.gz -C /usr/local/bin/ --strip-components=1 \
Expand All @@ -43,7 +43,7 @@ RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=che
npm install

# Install Maven dependencies
ARG MAVEN_VERSION=3.9.11
ARG MAVEN_VERSION=3.9.12
ARG USER_HOME_DIR="/root"
ARG BASE_URL=https://downloads.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries
ARG MAVEN_MIRROR=https://repo.maven.apache.org/maven2
Expand All @@ -69,5 +69,9 @@ RUN set -ex \
&& mkdir -p /opt/chen/frontend/dist \
&& sed -i "s@https://repo.maven.apache.org/maven2@${MAVEN_MIRROR}@g" settings.xml \
&& cp -f settings.xml /root/.m2/ \
&& mvn clean install
&& mvn clean install \





76 changes: 75 additions & 1 deletion backend/wisp/src/main/java/org/jumpserver/wisp/ServiceGrpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,37 @@ org.jumpserver.wisp.ServiceOuterClass.AccountDetailResponse> getGetAccountChatMe
return getGetAccountChatMethod;
}

private static volatile io.grpc.MethodDescriptor<org.jumpserver.wisp.ServiceOuterClass.HTTPRequest,
org.jumpserver.wisp.ServiceOuterClass.HTTPResponse> getCallAPIMethod;

@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CallAPI",
requestType = org.jumpserver.wisp.ServiceOuterClass.HTTPRequest.class,
responseType = org.jumpserver.wisp.ServiceOuterClass.HTTPResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<org.jumpserver.wisp.ServiceOuterClass.HTTPRequest,
org.jumpserver.wisp.ServiceOuterClass.HTTPResponse> getCallAPIMethod() {
io.grpc.MethodDescriptor<org.jumpserver.wisp.ServiceOuterClass.HTTPRequest, org.jumpserver.wisp.ServiceOuterClass.HTTPResponse> getCallAPIMethod;
if ((getCallAPIMethod = ServiceGrpc.getCallAPIMethod) == null) {
synchronized (ServiceGrpc.class) {
if ((getCallAPIMethod = ServiceGrpc.getCallAPIMethod) == null) {
ServiceGrpc.getCallAPIMethod = getCallAPIMethod =
io.grpc.MethodDescriptor.<org.jumpserver.wisp.ServiceOuterClass.HTTPRequest, org.jumpserver.wisp.ServiceOuterClass.HTTPResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "CallAPI"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.jumpserver.wisp.ServiceOuterClass.HTTPRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.jumpserver.wisp.ServiceOuterClass.HTTPResponse.getDefaultInstance()))
.setSchemaDescriptor(new ServiceMethodDescriptorSupplier("CallAPI"))
.build();
}
}
}
return getCallAPIMethod;
}

/**
* Creates a new async stub that supports all call types for the service
*/
Expand Down Expand Up @@ -974,6 +1005,13 @@ default void getAccountChat(org.jumpserver.wisp.ServiceOuterClass.Empty request,
io.grpc.stub.StreamObserver<org.jumpserver.wisp.ServiceOuterClass.AccountDetailResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAccountChatMethod(), responseObserver);
}

/**
*/
default void callAPI(org.jumpserver.wisp.ServiceOuterClass.HTTPRequest request,
io.grpc.stub.StreamObserver<org.jumpserver.wisp.ServiceOuterClass.HTTPResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCallAPIMethod(), responseObserver);
}
}

/**
Expand Down Expand Up @@ -1194,6 +1232,14 @@ public void getAccountChat(org.jumpserver.wisp.ServiceOuterClass.Empty request,
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetAccountChatMethod(), getCallOptions()), request, responseObserver);
}

/**
*/
public void callAPI(org.jumpserver.wisp.ServiceOuterClass.HTTPRequest request,
io.grpc.stub.StreamObserver<org.jumpserver.wisp.ServiceOuterClass.HTTPResponse> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCallAPIMethod(), getCallOptions()), request, responseObserver);
}
}

/**
Expand Down Expand Up @@ -1372,6 +1418,13 @@ public org.jumpserver.wisp.ServiceOuterClass.AccountDetailResponse getAccountCha
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetAccountChatMethod(), getCallOptions(), request);
}

/**
*/
public org.jumpserver.wisp.ServiceOuterClass.HTTPResponse callAPI(org.jumpserver.wisp.ServiceOuterClass.HTTPRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCallAPIMethod(), getCallOptions(), request);
}
}

/**
Expand Down Expand Up @@ -1573,6 +1626,14 @@ public com.google.common.util.concurrent.ListenableFuture<org.jumpserver.wisp.Se
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetAccountChatMethod(), getCallOptions()), request);
}

/**
*/
public com.google.common.util.concurrent.ListenableFuture<org.jumpserver.wisp.ServiceOuterClass.HTTPResponse> callAPI(
org.jumpserver.wisp.ServiceOuterClass.HTTPRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCallAPIMethod(), getCallOptions()), request);
}
}

private static final int METHODID_GET_TOKEN_AUTH_INFO = 0;
Expand All @@ -1598,7 +1659,8 @@ public com.google.common.util.concurrent.ListenableFuture<org.jumpserver.wisp.Se
private static final int METHODID_FACE_MONITOR_CALLBACK = 20;
private static final int METHODID_JOIN_FACE_MONITOR = 21;
private static final int METHODID_GET_ACCOUNT_CHAT = 22;
private static final int METHODID_DISPATCH_TASK = 23;
private static final int METHODID_CALL_API = 23;
private static final int METHODID_DISPATCH_TASK = 24;

private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
Expand Down Expand Up @@ -1709,6 +1771,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserv
serviceImpl.getAccountChat((org.jumpserver.wisp.ServiceOuterClass.Empty) request,
(io.grpc.stub.StreamObserver<org.jumpserver.wisp.ServiceOuterClass.AccountDetailResponse>) responseObserver);
break;
case METHODID_CALL_API:
serviceImpl.callAPI((org.jumpserver.wisp.ServiceOuterClass.HTTPRequest) request,
(io.grpc.stub.StreamObserver<org.jumpserver.wisp.ServiceOuterClass.HTTPResponse>) responseObserver);
break;
default:
throw new AssertionError();
}
Expand Down Expand Up @@ -1898,6 +1964,13 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser
org.jumpserver.wisp.ServiceOuterClass.Empty,
org.jumpserver.wisp.ServiceOuterClass.AccountDetailResponse>(
service, METHODID_GET_ACCOUNT_CHAT)))
.addMethod(
getCallAPIMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
org.jumpserver.wisp.ServiceOuterClass.HTTPRequest,
org.jumpserver.wisp.ServiceOuterClass.HTTPResponse>(
service, METHODID_CALL_API)))
.build();
}

Expand Down Expand Up @@ -1970,6 +2043,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
.addMethod(getFaceMonitorCallbackMethod())
.addMethod(getJoinFaceMonitorMethod())
.addMethod(getGetAccountChatMethod())
.addMethod(getCallAPIMethod())
.build();
}
}
Expand Down
Loading