diff options
Diffstat (limited to 'spec/support/helpers/gitlab_shell_helpers.rb')
-rw-r--r-- | spec/support/helpers/gitlab_shell_helpers.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/helpers/gitlab_shell_helpers.rb b/spec/support/helpers/gitlab_shell_helpers.rb new file mode 100644 index 00000000000..aa0cec22727 --- /dev/null +++ b/spec/support/helpers/gitlab_shell_helpers.rb @@ -0,0 +1,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 |