Search in sources :

Example 1 with SubjectJson

use of org.killbill.billing.jaxrs.json.SubjectJson in project killbill by killbill.

the class SecurityResource method getCurrentUserSubject.

@TimedResource
@GET
@Path("/subject")
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Get user information", response = SubjectJson.class)
@ApiResponses(value = {})
public Response getCurrentUserSubject(@javax.ws.rs.core.Context final HttpServletRequest request) {
    final Subject subject = SecurityUtils.getSubject();
    final SubjectJson subjectJson = new SubjectJson(subject);
    return Response.status(Status.OK).entity(subjectJson).build();
}
Also used : SubjectJson(org.killbill.billing.jaxrs.json.SubjectJson) Subject(org.apache.shiro.subject.Subject) Path(javax.ws.rs.Path) TimedResource(org.killbill.commons.metrics.TimedResource) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Subject (org.apache.shiro.subject.Subject)1 SubjectJson (org.killbill.billing.jaxrs.json.SubjectJson)1 TimedResource (org.killbill.commons.metrics.TimedResource)1