Skip to content

FF cleanup: Only allow documented token types for GraphQL authentication

Andrew Evans requested to merge atevans-cleanup-graphql-minimal-auth into master

What does this MR do and why?

Only allow documented token types for GraphQL authentication. Cleans up graphql_minimal_auth_methods feature flag introduced in !150407 (merged)

Rollout issue: https://gitlab.com/gitlab-org/gitlab/-/issues/444929

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Set up a project locally with git lfs
  2. Get an LFS token via the ssh interface: ssh -p 2222 git@<LOCAL_HOSTNAME> git-lfs-authenticate <NAMESPACE>/<PROJECT_NAME>.git download
  3. Copy the token from the "header":{"Authorization":"Basic <COPY_THIS_TOKEN> section
  4. Make a GraphQL request to http(s)://<HOSTNAME>:<PORT>/api/graphql.git using the token in the Authorization: Basic <COPIED_TOKEN> header:
    curl -X "POST" "http://localhost:3000/api/graphql.git" -H 'Content-Type: application/json; charset=utf-8' -u 'USERNAME:COPIED_TOKEN' -d $'{"query": "query{currentUser{id username}}","variables": {}}'
  5. The request should no longer be authenticated; currentUser should return null and restricted resources should not be accessible.
Edited by Andrew Evans

Merge request reports

Loading