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
99c302f0
Commit
99c302f0
authored
Aug 13, 2019
by
Krasimir Angelov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ConanToken's #to_s to #to_jwt to be more explicit
parent
bee3a686
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
ee/lib/api/conan_packages.rb
ee/lib/api/conan_packages.rb
+2
-1
ee/lib/gitlab/conan_token.rb
ee/lib/gitlab/conan_token.rb
+1
-1
ee/spec/lib/gitlab/conan_token_spec.rb
ee/spec/lib/gitlab/conan_token_spec.rb
+2
-2
No files found.
ee/lib/api/conan_packages.rb
View file @
99c302f0
...
...
@@ -20,7 +20,8 @@ module API
detail
'This feature was introduced in GitLab 12.2'
end
get
'authenticate'
do
::
Gitlab
::
ConanToken
.
from_personal_access_token
(
access_token
)
token
=
::
Gitlab
::
ConanToken
.
from_personal_access_token
(
access_token
)
token
.
to_jwt
end
end
...
...
ee/lib/gitlab/conan_token.rb
View file @
99c302f0
...
...
@@ -31,7 +31,7 @@ module Gitlab
@user_id
=
user_id
end
def
to_
s
def
to_
jwt
hmac_token
.
encoded
end
...
...
ee/spec/lib/gitlab/conan_token_spec.rb
View file @
99c302f0
...
...
@@ -46,7 +46,7 @@ describe Gitlab::ConanToken do
end
end
describe
'#to_
s
'
do
describe
'#to_
jwt
'
do
it
'returns the encoded JWT'
do
allow
(
SecureRandom
).
to
receive
(
:uuid
).
and_return
(
'u-u-i-d'
)
...
...
@@ -55,7 +55,7 @@ describe Gitlab::ConanToken do
token
=
described_class
.
new
(
personal_access_token_id:
123
,
user_id:
456
)
expect
(
token
.
to_
s
).
to
eq
(
jwt
.
encoded
)
expect
(
token
.
to_
jwt
).
to
eq
(
jwt
.
encoded
)
end
end
end
...
...
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