Skip to content
Snippets Groups Projects

Add authentication to the reports endpoint

Merged Martin Lowe requested to merge (removed):malowe/master/auth-fix into master
2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
30 42
31 43 @Inject
32 44 RequestWrapper wrap;
33 45 @Inject
34 46 ReportsService reportsService;
47 @Inject
48 SecurityIdentity ident;
35 49
36 50 @GET
37 51 @Path("/gitlab/private-projects")
38 52 public Response getPrivateProjectEvents(@QueryParam("status") String status, @QueryParam("since") LocalDate since,
39 53 @QueryParam("until") LocalDate until) {
40
54 if (!allowedUsers.contains(ident.getPrincipal().getName())) {
55 LOGGER.debug("User '{}' does not have access to the reports, access blocked", ident.getPrincipal().getName());
56 return Response.status(401).build();
  • Otherwise LGTM!

  • Martin Lowe added 1 commit

    added 1 commit

    • b21e894e - Update spec to add 401 to reports api spec

    Compare with previous version

  • Zachary Sabourin approved this merge request

    approved this merge request

  • Martin Lowe added 1 commit

    added 1 commit

    • a2e3d631 - Fix tests for new authentication barrier

    Compare with previous version

  • Zachary Sabourin approved this merge request

    approved this merge request

  • merged

  • Martin Lowe mentioned in commit 2c75727e

    mentioned in commit 2c75727e

  • Please register or sign in to reply
    Loading