Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2025 Red Hat, Inc.
* Copyright (c) 2012-2026 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -51,6 +51,20 @@ public String getId() {
return userId();
}

@GET
@Path("/name")
@Produces(TEXT_PLAIN)
@Operation(
summary = "Get current user name",
responses = {
@ApiResponse(
responseCode = "200",
description = "The response contains current user's name"),
})
public String getUser() {
return EnvironmentContext.getCurrent().getSubject().getUserName();
}

private static String userId() {
return EnvironmentContext.getCurrent().getSubject().getUserId();
}
Expand Down
Loading