File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ # https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html#allow-any-project-to-access-your-project
2
+ def test_enable_limit_access_to_this_project (gl , project ):
3
+ scope = project .job_token_scope .get ()
4
+
5
+ scope .enabled = True
6
+ scope .save ()
7
+
8
+ scope .refresh ()
9
+
10
+ # https://docs.gitlab.com/ee/api/project_job_token_scopes.html#get-a-projects-cicd-job-token-access-settings
11
+ # suggests inbound_enabled True, means other projects have access, i.e. Limit Access to is OFF
12
+ assert not scope .inbound_enabled
13
+
14
+
15
+ def test_disable_limit_access_to_this_project (gl , project ):
16
+ scope = project .job_token_scope .get ()
17
+
18
+ scope .enabled = False
19
+ scope .save ()
20
+
21
+ scope .refresh ()
22
+
23
+ # https://docs.gitlab.com/ee/api/project_job_token_scopes.html#get-a-projects-cicd-job-token-access-settings
24
+ # suggests inbound_enabled True, means other projects have access, i.e. Limit Access to is OFF
25
+ assert scope .inbound_enabled
26
+
27
+
1
28
def test_add_project_to_job_token_scope_allowlist (gl , project ):
2
29
project_to_add = gl .projects .create ({"name" : "Ci_Cd_token_add_proj" })
3
30
You can’t perform that action at this time.
0 commit comments