debian-mirror-gitlab/spec/support/helpers/gitlab_shell_helpers.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
400 B
Ruby
Raw Normal View History

2022-10-11 01:57:18 +05:30
# 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