Skip to content
Snippets Groups Projects

Admin Token API: Identify GitLab sessions

All threads resolved!

What does this MR do and why?

Adds support to the Admin Token API to identify the user of a _gitlab_session.

Issue: #512654 (closed)

:tools: with :heart: at Siemens

References

MR acceptance checklist

MR Checklist ( @nwittstruck)

How to set up and validate locally

  1. You'll need to create a personal access token to access the token and get a _gitlab_session that you'd like to query:

    1. Create a personal access token with admin_mode and api capabilities. Preferences > Access Tokens > Add a new token
    2. You'll need a _gitlab_session. The easiest way to get this is to get a session from your browser. Navigate to your gdk, e.g. https://gdk.test:3443 and sign in. After signing in, there should be a session key and a value in your cookie store. In Firefox, open the developer console and go to Storage > Cookies. It's mostly the same in Chrome/Safari. This should get you a key: _gitlab_session_abc123 and a value: long-string-with-numbers. You need to join both: _gitlab_session_abc123=long-string-with-numbers. For comparison, on gitlab.com, the key would be just _gitlab_session=. However, in development mode, a unique key is added to the prefix (in the example, abc123).
  2. Now you can retrieve information about this token:

curl -k --request POST \
--url 'https://gdk.test:3443/api/v4/admin/token' \
--header 'Authorization: Bearer <Admin Token from Step 2.1>' \
--header 'Content-Type: application/json' \
--data '{"token": "_gitlab_session_abc123=long-string-with-numbers"}'

Related to #512654 (closed)

Edited by Nicholas Wittstruck

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
  • Isaac Durham
  • requested review from @dbiryukov

  • requested review from @iamricecake

  • Nicholas Wittstruck added 269 commits

    added 269 commits

    Compare with previous version

  • Nicholas Wittstruck changed the description

    changed the description

  • Isaac Durham approved this merge request

    approved this merge request

  • added pipelinetier-2 label and removed pipelinetier-1 label

  • Before you set this MR to auto-merge

    This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3.

    Before you set this MR to auto-merge, please check the following:

    • You are the last maintainer of this merge request
    • The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
    • This pipeline is recent enough (created in the last 8 hours)

    If all the criteria above apply, please set auto-merge for this merge request.

    See pipeline tiers and merging a merge request for more details.

  • Hi @idurham :wave:,

    GitLab Bot has added the Technical Writing label because a Technical Writer has approved or merged this MR.

    This message was generated automatically. Improve it or delete it.

  • @nwittstruck Thank you :heart: for your contribution!

    I left my feedback mostly related to tests.

  • Nicholas Wittstruck added 487 commits

    added 487 commits

    • 50e04bd6...b129f7d7 - 484 commits from branch gitlab-org:master
    • 49f4377d - Admin Token API: Identify GitLab sessions
    • 068ff215 - Admin Token API: Identify GitLab sessions
    • 18418af8 - Admin Token API: Identify GitLab sessions

    Compare with previous version

  • Nicholas Wittstruck reset approvals from @idurham by pushing to the branch

    reset approvals from @idurham by pushing to the branch

  • Isaac Durham approved this merge request

    approved this merge request

  • Dmytro Biryukov changed milestone to %17.9

    changed milestone to %17.9

  • Dmytro Biryukov approved this merge request

    approved this merge request

  • @ayufan Could you please perform a review?

  • Dmytro Biryukov requested review from @ayufan

    requested review from @ayufan

  • Kamil Trzciński resolved all threads

    resolved all threads

  • Kamil Trzciński approved this merge request

    approved this merge request

  • Kamil Trzciński removed review request for @ayufan

    removed review request for @ayufan

  • Erick Bajao approved this merge request

    approved this merge request

  • Erick Bajao resolved all threads

    resolved all threads

  • 2 Warnings
    :warning: 34c6e247: The commit body should not contain more than 72 characters per line. For more information, take a look at our Commit message guidelines.
    :warning: The master pipeline status page reported failures in

    If these jobs fail in your merge request with the same errors, then they are not caused by your changes.
    Please check for any on-going incidents in the incident issue tracker or in the #master-broken Slack channel.

    1 Message
    :book: This merge request adds or changes documentation files and requires Technical Writing review. The review should happen before merge, but can be post-merge if the merge request is time sensitive.

    Documentation review

    The following files require a review from a technical writer:

    The review does not need to block merging this merge request. See the:

    Reviewer roulette

    Category Reviewer Maintainer
    backend @Quintasan profile link current availability (UTC+1) @ayufan profile link current availability (UTC+1)

    Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.

    If needed, you can retry the :repeat: danger-review job that generated this comment.

    Generated by :no_entry_sign: Danger

    Edited by ****
  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-cng: :white_check_mark: test report for 77460fbb

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Create      | 143    | 0      | 19      | 0     | 162   | ✅     |
    | Verify      | 53     | 0      | 19      | 0     | 72    | ✅     |
    | Govern      | 84     | 0      | 10      | 0     | 94    | ✅     |
    | Plan        | 86     | 0      | 8       | 0     | 94    | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Monitor     | 8      | 0      | 12      | 0     | 20    | ✅     |
    | Release     | 5      | 0      | 1       | 0     | 6     | ✅     |
    | Data Stores | 33     | 0      | 10      | 0     | 43    | ✅     |
    | Package     | 29     | 0      | 15      | 0     | 44    | ✅     |
    | Manage      | 1      | 0      | 9       | 0     | 10    | ✅     |
    | Fulfillment | 2      | 0      | 7       | 0     | 9     | ✅     |
    | Growth      | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Secure      | 2      | 0      | 5       | 0     | 7     | ✅     |
    | Configure   | 0      | 0      | 3       | 0     | 3     | ➖     |
    | ModelOps    | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Ai-powered  | 0      | 0      | 2       | 0     | 2     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 448    | 0      | 123     | 0     | 571   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-test-on-gdk: :white_check_mark: test report for 77460fbb

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Verify      | 52     | 0      | 20      | 1     | 72    | ✅     |
    | Govern      | 79     | 0      | 13      | 0     | 92    | ✅     |
    | Manage      | 1      | 0      | 9       | 0     | 10    | ✅     |
    | Create      | 138    | 0      | 20      | 0     | 158   | ✅     |
    | Plan        | 82     | 0      | 8       | 0     | 90    | ✅     |
    | Configure   | 0      | 0      | 3       | 0     | 3     | ➖     |
    | Package     | 24     | 0      | 14      | 0     | 38    | ✅     |
    | Fulfillment | 2      | 0      | 7       | 0     | 9     | ✅     |
    | Secure      | 4      | 0      | 3       | 0     | 7     | ✅     |
    | Monitor     | 8      | 0      | 12      | 0     | 20    | ✅     |
    | Data Stores | 33     | 0      | 10      | 0     | 43    | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Release     | 5      | 0      | 1       | 0     | 6     | ✅     |
    | Ai-powered  | 0      | 0      | 2       | 0     | 2     | ➖     |
    | ModelOps    | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Growth      | 0      | 0      | 2       | 0     | 2     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 430    | 0      | 125     | 1     | 555   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    Edited by ****
  • Nicholas Wittstruck added 1845 commits

    added 1845 commits

    • 18418af8...3f14b8f1 - 1842 commits from branch gitlab-org:master
    • 34c6e247 - Admin Token API: Identify GitLab sessions
    • 0a3645c4 - Admin Token API: Identify GitLab sessions
    • 77460fbb - Admin Token API: Identify GitLab sessions

    Compare with previous version

  • Nicholas Wittstruck reset approvals from @ayufan, @iamricecake, and @dbiryukov by pushing to the branch

    reset approvals from @ayufan, @iamricecake, and @dbiryukov by pushing to the branch

  • Erick Bajao resolved all threads

    resolved all threads

  • Erick Bajao approved this merge request

    approved this merge request

  • Erick Bajao enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • merged

  • Erick Bajao mentioned in commit 0e15b697

    mentioned in commit 0e15b697

  • Hi @nwittstruck :wave:

    :tada: See where you rank! Check your spot on the contributor leaderboard and unlock rewards.


    How was your code review experience with this merge request? Please tell us how we can continue to iterate and improve:

    1. React with a :thumbsup: or a :thumbsdown: on this comment to describe your experience.
    2. Create a new comment starting with @gitlab-bot feedback below, and leave any additional feedback you have for us in the comment.

    As a benefit of being a GitLab Community Contributor, you have access to GitLab Duo, our AI-powered features. With Code Suggestions, Chat, Root Cause Analysis and more AI-powered features, GitLab Duo helps to boost your efficiency and effectiveness by reducing the time required to write and understand code and pipelines. Visit the GitLab Duo documentation to learn more about the benefits.

    Thanks for your help! :heart:

    This message was generated automatically. Improve it or delete it.

  • mentioned in issue #512654 (closed)

  • added workflowstaging label and removed workflowcanary label

  • Please register or sign in to reply
    Loading