Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab_shell_helpers.rb « helpers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aa0cec22727f3c5a969a5a9a39650f9696e87741 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

module GitlabShellHelpers
  extend self

  def gitlab_shell_internal_api_request_header(
    issuer: API::Helpers::GITLAB_SHELL_JWT_ISSUER, secret_token: Gitlab::Shell.secret_token)
    jwt_token = JSONWebToken::HMACToken.new(secret_token).tap do |token|
      token.issuer = issuer
    end

    { API::Helpers::GITLAB_SHELL_API_HEADER => jwt_token.encoded }
  end
end