Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cf2219fc
Commit
cf2219fc
authored
Nov 16, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix kwargs deprecation warnings for jwt_token helper
parent
223fcfc6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
spec/support/helpers/multipart_helpers.rb
spec/support/helpers/multipart_helpers.rb
+1
-1
spec/support/helpers/workhorse_helpers.rb
spec/support/helpers/workhorse_helpers.rb
+3
-3
No files found.
spec/support/helpers/multipart_helpers.rb
View file @
cf2219fc
...
...
@@ -37,7 +37,7 @@ module MultipartHelpers
# *without* the "#{key}." prefix
result
.
deep_transform_keys!
{
|
k
|
k
.
remove
(
"
#{
key
}
."
)
}
{
"
#{
key
}
.gitlab-workhorse-upload"
=>
jwt_token
(
'upload'
=>
result
)
"
#{
key
}
.gitlab-workhorse-upload"
=>
jwt_token
(
data:
{
'upload'
=>
result
}
)
}
end
...
...
spec/support/helpers/workhorse_helpers.rb
View file @
cf2219fc
...
...
@@ -85,15 +85,15 @@ module WorkhorseHelpers
return
{}
if
upload_params
.
empty?
{
"
#{
key
}
.gitlab-workhorse-upload"
=>
jwt_token
(
'upload'
=>
upload_params
)
}
{
"
#{
key
}
.gitlab-workhorse-upload"
=>
jwt_token
(
data:
{
'upload'
=>
upload_params
}
)
}
end
def
jwt_token
(
data
=
{},
issuer:
'gitlab-workhorse'
,
secret:
Gitlab
::
Workhorse
.
secret
,
algorithm:
'HS256'
)
def
jwt_token
(
data
:
{},
issuer:
'gitlab-workhorse'
,
secret:
Gitlab
::
Workhorse
.
secret
,
algorithm:
'HS256'
)
JWT
.
encode
({
'iss'
=>
issuer
}.
merge
(
data
),
secret
,
algorithm
)
end
def
workhorse_rewritten_fields_header
(
fields
)
{
Gitlab
::
Middleware
::
Multipart
::
RACK_ENV_KEY
=>
jwt_token
(
'rewritten_fields'
=>
fields
)
}
{
Gitlab
::
Middleware
::
Multipart
::
RACK_ENV_KEY
=>
jwt_token
(
data:
{
'rewritten_fields'
=>
fields
}
)
}
end
def
workhorse_disk_accelerated_file_params
(
key
,
file
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment