@@ -55,15 +55,20 @@ def test_task_queue():
55
55
cfg = MontaguConfig (path )
56
56
try :
57
57
youtrack_token = os .environ ["YOUTRACK_TOKEN" ]
58
- os .environ ["VAULT_AUTH_GITHUB_TOKEN" ] = os .environ ["VAULT_TOKEN" ]
59
- with vault_dev .server () as s :
58
+ with vault_dev .Server (export_token = True ) as s :
60
59
cl = s .client ()
61
- enable_github_login (cl )
62
60
cl .write ("secret/youtrack/token" , value = youtrack_token )
63
61
vault_addr = f"http://localhost:{ s .port } "
64
62
65
63
orderly_web .start (orderly_config_path )
66
- cli .main (["start" , path , f"--option=vault.addr={ vault_addr } " ])
64
+ cli .main (
65
+ [
66
+ "start" ,
67
+ path ,
68
+ f"--option=vault.addr={ vault_addr } " ,
69
+ f"--option=vault.auth.args.token={ s .token } " ,
70
+ ]
71
+ )
67
72
68
73
# wait for API to be ready
69
74
http_get ("https://localhost/api/v1" )
@@ -101,21 +106,3 @@ def add_task_queue_user(cfg, orderly_config_path):
101
106
orderly_web .admin .grant (
102
107
orderly_config_path ,
"[email protected] " , [
"*/reports.run" ,
"*/reports.review" ,
"*/reports.read" ]
103
108
)
104
-
105
-
106
- def enable_github_login (cl , path = "github" ):
107
- cl .sys .enable_auth_method (method_type = "github" , path = path )
108
- policy = """
109
- path "secret/*" {
110
- capabilities = ["read", "list"]
111
- }
112
- """
113
-
114
- cl .sys .create_or_update_policy (
115
- name = "secret-reader" ,
116
- policy = policy ,
117
- )
118
-
119
- cl .auth .github .map_team (team_name = "robots" , policies = ["secret-reader" ], mount_point = path )
120
-
121
- cl .auth .github .configure (organization = "vimc" , mount_point = path )
0 commit comments