Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 12:10:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 12:10:34 +0300
commitb28d414aeffb5d1974747325a3be905dd42f2ad0 (patch)
treeab17aafbd1917022ae3b576d82d65c7ca753c783 /spec/services/auth
parentbb4e9366843397edc492e35c126f1f60cf7a5053 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/auth')
-rw-r--r--spec/services/auth/container_registry_authentication_service_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/services/auth/container_registry_authentication_service_spec.rb b/spec/services/auth/container_registry_authentication_service_spec.rb
index b456f7a2745..46cc027fcb3 100644
--- a/spec/services/auth/container_registry_authentication_service_spec.rb
+++ b/spec/services/auth/container_registry_authentication_service_spec.rb
@@ -84,5 +84,36 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
it_behaves_like 'a modified token'
end
+
+ describe '#access_token' do
+ let(:token) { described_class.access_token(%w[push], [project.full_path]) }
+
+ subject { { token: token } }
+
+ it_behaves_like 'a modified token'
+ end
+ end
+
+ context 'when not in migration mode' do
+ include_context 'container registry auth service context'
+
+ let_it_be(:project) { create(:project) }
+
+ before do
+ stub_feature_flags(container_registry_migration_phase1: false)
+ end
+
+ shared_examples 'an unmodified token' do
+ it_behaves_like 'a valid token'
+ it { expect(payload['access']).not_to include(have_key('migration_eligible')) }
+ end
+
+ describe '#access_token' do
+ let(:token) { described_class.access_token(%w[push], [project.full_path]) }
+
+ subject { { token: token } }
+
+ it_behaves_like 'an unmodified token'
+ end
end
end