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
7a6ba30d
Commit
7a6ba30d
authored
May 31, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test token expirability
parent
7b0e2bbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
spec/services/auth/container_registry_authentication_service_spec.rb
...es/auth/container_registry_authentication_service_spec.rb
+15
-0
No files found.
spec/services/auth/container_registry_authentication_service_spec.rb
View file @
7a6ba30d
...
...
@@ -17,6 +17,21 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
shared_examples
'a valid token'
do
it
{
is_expected
.
to
include
(
:token
)
}
it
{
expect
(
payload
).
to
include
(
'access'
)
}
context
'a expirable'
do
let
(
:expires_at
)
{
Time
.
at
(
payload
[
'exp'
])
}
let
(
:expire_delay
)
{
10
}
context
'for default configuration'
do
it
{
expect
(
expires_at
).
to_not
be_within
(
2
.
seconds
).
of
(
Time
.
now
+
expire_delay
.
minutes
)
}
end
context
'for changed configuration'
do
before
{
stub_application_setting
(
container_registry_token_expire_delay:
expire_delay
)
}
it
{
expect
(
expires_at
).
to
be_within
(
2
.
seconds
).
of
(
Time
.
now
+
expire_delay
.
minutes
)
}
end
end
end
shared_examples
'a accessible'
do
...
...
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