Page MenuHomePhabricator

AuthZN Sockpuppet Model via Liftwing API
Closed, InvalidPublic

Description

Request Status: New Request
Request Type: project support request

Request Title: AuthZN Sockpuppet Model via Liftwing API

  • Request Description: Liftwing is exposing models via the API Gateway of which the sockpuppet model will require authentication and authorization to use. Currently the API Gateway does not support authZN and will need to do so prior to having model exposed.
  • Indicate Priority Level: Low
  • Main Requestors:@Niharika
  • Ideal Delivery Date:add target date
  • Stakeholders: @sdkim @calbon @Niharika

Request Documentation

Document TypeRequired?Document/Link
Related PHAB TicketsYeshttps://phabricator.wikimedia.org/T265722
Product One PagerYes<add link here>
Product Requirements Document (PRD)Yes<add link here>
Product RoadmapYes<add link here>
Product Planning/Business CaseNo<add link here>
Product BriefNo<add link here>
Other LinksNo<add links here>

Event Timeline

I have concerns about whether this work is the right thing to do and whether the API gateway is the right place for it.
If the API gateway were to implement authentication and authorisation, it would have to do so in a manner that was totally reusable for all WMF applications rather than specific to one application. For Envoy this would probably involve implementation of secondary services for the gateway itself to communicate with - which might be a good idea but it might require us to factor in other parts of our infrastructure. Would we plan on using Mediawiki as the source of truth?

@hnowlan I agree that we should find a good compromise, the API-Gateway can't do everything that all services need, but at the same time if we find a good balance to avoid re-inventing the wheel each time that a new backend service is created it would (in my opinion) simplify people's life a lot.

The authentication part seems already done IIUC, but currently used only for rate-limiting (some code refactors are probably needed, but overall we should be at a good stage if we use OAuth 2.0, let me know if it is the wrong assumption).

The authorization part is more difficult I agree. One compromise could be the following:

  • The API-Gateway takes care of the OAuth authentication, and forwards headers/cookies to the backend service.
  • The backend service takes care of calling Mediawiki to verify certain conditions and then it decides to allow/deny the request.

The burden on the service side is a lot, especially if this use case is replicated N times for a lot of services, having it already implemented in the API-Gateway would be really nice. It would need to be reusable, but we could concentrate on a limited set of use cases as starter (like OAuth + few Mediawiki checks etc..) and expand in the future if needed.

11/10/2021 - Steering Committee

  • Chat on where all this work is going to end up (related to Captcha conversation)
  • no hard timelines but this could become something that gets escalated with the human rights recommendations reports
  • John B will discuss with the team
  • likely we will need resources to sort this out and in the meantime will update the API Gateway documentation to recommend that only APIs that do not require authentication go on the Gateway

@calbon given our latest convo, this is no longer needed. Okay for me to close?

• DAbad claimed this task.
• DAbad moved this task from Backlog to Done on the Foundational Technology Requests board.