Skip to content
Snippets Groups Projects

Extract Workhorse <-> GitLab JWT authentication to make it reusable

Merged Krasimir Angelov requested to merge 61927-internal-api-jwt-auth into master
1 unresolved thread

What does this MR do?

This MR is extracted from https://gitlab.com/gitlab-org/gitlab-ce/issues/61927 in order to break the later in smaller chunks.

It extracts the code used for the JWT based authentication between Workhorse and GitLab so that we can reuse it for the Pages internal API.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #61927 (moved)

Edited by Kamil Trzciński

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
1 # frozen_string_literal: true
2
3 require 'spec_helper'
4
5 describe Gitlab::JwtAuthenticatable do
6 let(:test_class) do
7 Class.new do
8 include Gitlab::JwtAuthenticatable
9
10 def self.secret_path
11 Rails.root.join('tmp', 'tests', '.jwt_shared_secret')
  • @krasio

    For future. It would be better to generate a temporary directory, that is gonna be removed with after do.

      describe '#show' do
        let(:tmpdir) { Dir.mktmpdir('profiler-test') }
    
        ...
    
        after do
          FileUtils.rm_rf(tmpdir)
        end
  • Please register or sign in to reply
  • Kamil Trzciński resolved all threads

    resolved all threads

  • Kamil Trzciński approved this merge request

    approved this merge request

  • Kamil Trzciński marked the checklist item Code review guidelines as completed

    marked the checklist item Code review guidelines as completed

  • Kamil Trzciński marked the checklist item Merge request performance guidelines as completed

    marked the checklist item Merge request performance guidelines as completed

  • Kamil Trzciński marked the checklist item Style guides as completed

    marked the checklist item Style guides as completed

  • mentioned in commit fd561023

  • Krasimir Angelov mentioned in merge request !32732 (merged)

    mentioned in merge request !32732 (merged)

  • Please register or sign in to reply
    Loading