public void addAuthorizations(final com.wordnik.swagger.annotations.Authorization[] authorizations) { if (ArrayUtils.isEmpty(authorizations)) { return; } for (com.wordnik.swagger.annotations.Authorization authorization : authorizations) { AuthorizationScope[] authorizationScopes = new AuthorizationScope[authorization.scopes().length]; for(int i = 0;i < authorization.scopes().length;i++) { com.wordnik.swagger.annotations.AuthorizationScope authScope = authorization.scopes()[i]; authorizationScopes[i] = new AuthorizationScope(authScope.scope(), authScope.description()); } this.authorizations.add(new Authorization(authorization.value(), authorizationScopes)); } }
@DELETE @Path(value="/mainCity/date/{date}") @ApiOperation(value = "Remove cities that have been manually entered by the end-user.", response = String.class, authorizations = {@Authorization(value="oauth2")}) public Response resetDayMainCity(@ApiParam(value="Date (YYYY-MM-DD)", required=true) @PathParam("date") String date) { final long guestId = AuthHelper.getGuestId(); StringBuilder sb = new StringBuilder("module=API component=calendarController action=resetDayMainCity") .append(" guestId=").append(guestId); logger.info(sb.toString()); metadataService.resetDayMainCity(guestId, date); return Response.ok("OK").build(); }
if (authorizationAnnotations != null && authorizationAnnotations.length > 0 && StringUtils.hasText(authorizationAnnotations[0].value())) { String value = authorization.value(); AuthorizationScope[] scopes = authorization.scopes(); List<com.mangofactory.swagger.models.dto.AuthorizationScope> authorizationScopeList = newArrayList(); for (AuthorizationScope authorizationScope : scopes) {
@POST @Path(value="/mainCity/date/{date}") @ApiOperation(value = "Set the main city for a given day using lat/lon coordinates.", response = String.class, notes="(we figure out the actual city from the coordinates)", authorizations = {@Authorization(value="oauth2")}) public Response setDayMainCity(@ApiParam(value="Latitude", required=true) @FormParam("latitude") float latitude, @ApiParam(value="Longitude", required=true) @FormParam("longitude") float longitude, @ApiParam(value="Date (YYYY-MM-DD)", required=true) @PathParam("date") String date) { final long guestId = AuthHelper.getGuestId(); StringBuilder sb = new StringBuilder("module=API component=calendarController action=setDayMainCity") .append(" guestId=").append(guestId); logger.info(sb.toString()); metadataService.setDayMainCity(guestId, latitude, longitude, date); return Response.ok("OK").build(); }
if (authorizationAnnotations != null && authorizationAnnotations.length > 0 && StringUtils.hasText(authorizationAnnotations[0].value())) { String value = authorization.value(); AuthorizationScope[] scopes = authorization.scopes(); List<springdox.documentation.service.AuthorizationScope> authorizationScopeList = newArrayList(); for (AuthorizationScope authorizationScope : scopes) {
authorizations = {@Authorization(value="oauth2")}) @Component("RESTMetadataController") @Scope("request")