Commit e00b07b9 authored by James Edwards-Jones's avatar James Edwards-Jones

JwtController avoids activating session checks

This used without a session and issues a sessionless token, so we
should avoid causing access checks based on the session.
parent 9f6ff5dc
# frozen_string_literal: true # frozen_string_literal: true
class JwtController < ApplicationController class JwtController < ApplicationController
skip_around_action :set_session_storage
skip_before_action :authenticate_user! skip_before_action :authenticate_user!
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
before_action :authenticate_project_or_user before_action :authenticate_project_or_user
......
...@@ -108,6 +108,14 @@ describe JwtController do ...@@ -108,6 +108,14 @@ describe JwtController do
end end
end end
end end
it 'does not cause session based checks to be activated' do
expect(Gitlab::Session).not_to receive(:with_session)
get '/jwt/auth', params: parameters, headers: headers
expect(response).to have_gitlab_http_status(200)
end
end end
context 'using invalid login' do context 'using invalid login' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment