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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
7b0e2bbc
Commit
7b0e2bbc
authored
May 31, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the use of CurrentSettings in ContainerRegistryAuthenticationService
parent
041b0215
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
app/services/auth/container_registry_authentication_service.rb
...ervices/auth/container_registry_authentication_service.rb
+7
-2
No files found.
app/services/auth/container_registry_authentication_service.rb
View file @
7b0e2bbc
module
Auth
module
Auth
class
ContainerRegistryAuthenticationService
<
BaseService
class
ContainerRegistryAuthenticationService
<
BaseService
include
CurrentSettings
include
Gitlab
::
CurrentSettings
AUDIENCE
=
'container_registry'
AUDIENCE
=
'container_registry'
...
@@ -19,7 +19,7 @@ module Auth
...
@@ -19,7 +19,7 @@ module Auth
token
=
JSONWebToken
::
RSAToken
.
new
(
registry
.
key
)
token
=
JSONWebToken
::
RSAToken
.
new
(
registry
.
key
)
token
.
issuer
=
registry
.
issuer
token
.
issuer
=
registry
.
issuer
token
.
audience
=
AUDIENCE
token
.
audience
=
AUDIENCE
token
.
expire_time
=
token
.
issued_at
+
current_application_settings
.
container_registry_token_expire_delay
.
minutes
token
.
expire_time
=
token
_expire_at
token
[
:access
]
=
names
.
map
do
|
name
|
token
[
:access
]
=
names
.
map
do
|
name
|
{
type:
'repository'
,
name:
name
,
actions:
%w(*)
}
{
type:
'repository'
,
name:
name
,
actions:
%w(*)
}
end
end
...
@@ -33,6 +33,7 @@ module Auth
...
@@ -33,6 +33,7 @@ module Auth
token
.
issuer
=
registry
.
issuer
token
.
issuer
=
registry
.
issuer
token
.
audience
=
params
[
:service
]
token
.
audience
=
params
[
:service
]
token
.
subject
=
current_user
.
try
(
:username
)
token
.
subject
=
current_user
.
try
(
:username
)
token
.
expire_time
=
ContainerRegistryAuthenticationService
.
token_expire_at
token
[
:access
]
=
accesses
.
compact
token
[
:access
]
=
accesses
.
compact
token
token
end
end
...
@@ -78,5 +79,9 @@ module Auth
...
@@ -78,5 +79,9 @@ module Auth
def
registry
def
registry
Gitlab
.
config
.
registry
Gitlab
.
config
.
registry
end
end
def
self
.
token_expire_at
Time
.
now
+
current_application_settings
.
container_registry_token_expire_delay
.
minutes
end
end
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