Skip to content
Snippets Groups Projects
Commit 50e04bd6 authored by Nicholas Wittstruck's avatar Nicholas Wittstruck
Browse files

Admin Token API: Identify GitLab sessions

Updates the documentation according to reviewer feedback.

Issue: #512654

Changelog: added
parent b47321f7
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ Prerequisites:
> - [Runner authentication tokens added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173987) in GitLab 17.7.
> - [Pipeline trigger tokens added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/174030) in GitLab 17.7.
> - [CI/CD Job Tokens added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/175234) in GitLab 17.9.
> - [GitLab sessions added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/178022) in GitLab 17.9.
> - [GitLab session cookies added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/178022) in GitLab 17.9.
Gets information for a given token. This endpoint supports the following tokens:
......@@ -45,7 +45,7 @@ Gets information for a given token. This endpoint supports the following tokens:
- [Runner authentication tokens](../../security/tokens/index.md#runner-authentication-tokens)
- [Pipeline trigger tokens](../../ci/triggers/index.md#create-a-pipeline-trigger-token)
- [CI/CD Job Tokens](../../security/tokens/index.md#cicd-job-tokens)
- [GitLab sessions](../../user/profile/active_sessions.md)
- [GitLab session cookies](../../user/profile/active_sessions.md)
```plaintext
POST /api/v4/admin/token
......
......@@ -102,10 +102,10 @@
context 'with a valid gitlab session in ActiveSession' do
let(:session_id) { 'session_id' }
let(:plaintext) { "_gitlab_session=#{session_id}" }
let(:rack_session) { Rack::Session::SessionId.new(session_id) }
let(:session_hash) { { 'warden.user.user.key' => [[user.id], user.authenticatable_salt] } }
before do
rack_session = Rack::Session::SessionId.new(session_id)
allow(ActiveSession).to receive(:sessions_from_ids).with([rack_session.private_id]).and_return([session_hash])
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment