Class RootWebService
java.lang.Object
ubic.gemma.rest.RootWebService
Handles calls to the root API url and user info api
- Author:
- tesarst
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic classRequest body forchangeMyPassword(RootWebService.ChangePasswordRequest).static final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseSelf-service password change for the authenticated user.getApiInfo(jakarta.ws.rs.core.UriInfo uriInfo) Returns an object with API information.jakarta.ws.rs.core.ResponsegetCategoriesAlias(jakarta.ws.rs.core.UriInfo uriInfo) Top-level alias forGET /datasets/categories: the curation-UI callsGET /categoriesfor the recently-used annotation-category picker.Retrieve user information for the current user.Retrieve user information.
-
Constructor Details
-
RootWebService
public RootWebService()
-
-
Method Details
-
getApiInfo
@GET @Produces("application/json") public ResponseDataObject<RootWebService.ApiInfoValueObject> getApiInfo(@Context jakarta.ws.rs.core.UriInfo uriInfo) Returns an object with API information. -
getMyself
@GET @Path("/users/me") @Produces("application/json") @PreAuthorize("isAuthenticated()") public ResponseDataObject<RootWebService.UserValueObject> getMyself()Retrieve user information for the current user. -
changeMyPassword
@PUT @Path("/users/me/password") @Consumes("application/json") @Produces("application/json") @PreAuthorize("isAuthenticated()") public jakarta.ws.rs.core.Response changeMyPassword(RootWebService.ChangePasswordRequest req) Self-service password change for the authenticated user. Requires the current password to be presented so a hijacked session or leaked token can't silently rotate the credential. Routes throughUserManager.changePassword(String, String), which verifies the current password against the stored hash, enforces a minimum length, and re-encodes the new password. -
getCategoriesAlias
@GET @Path("/categories") public jakarta.ws.rs.core.Response getCategoriesAlias(@Context jakarta.ws.rs.core.UriInfo uriInfo) Top-level alias forGET /datasets/categories: the curation-UI callsGET /categoriesfor the recently-used annotation-category picker. Implemented as a 302 redirect so query params (filter, limit, etc.) pass through unchanged. -
getUser
@GET @Path("/users/{username}") @Produces("application/json") @PreAuthorize("(isAuthenticated() && principal.username == #username) || hasAuthority('GROUP_ADMIN')") public ResponseDataObject<RootWebService.UserValueObject> getUser(@PathParam("username") String username) Retrieve user information.This method only works for authenticated users (via basic HTTP auth or their JSESSIONID cookie as specified by the
SecuritySchemeannotation on this class. If the current authenticated user is an administrator, any user can be retrieved with this endpoint, otherwise only the current user is accessible.- Parameters:
username- the username
-