@@ -68,7 +68,7 @@ def get_bearer_token(stackit_service_account_key_path: str):
6868
6969
7070def get_cluster_egress_ip (
71- project_id : str , cluster_name : str , config : OrgSettings
71+ project_id : str , cluster_name : str , config : OrgSettings
7272) -> list [str ]:
7373 """Fetches the egress IP of a specific cluster."""
7474 url = f"https://ske.api.stackit.cloud/v2/projects/{ project_id } /regions/eu01/clusters/{ cluster_name } "
@@ -89,7 +89,7 @@ def get_cluster_egress_ip(
8989
9090
9191def get_all_projects (
92- organization_id : str , config : OrgSettings
92+ organization_id : str , config : OrgSettings
9393) -> list [tuple [str , str ]]:
9494 """Fetches all projects from the Resource Manager API."""
9595 url = "https://resource-manager.api.stackit.cloud/v2/projects"
@@ -109,7 +109,7 @@ def get_all_projects(
109109
110110
111111def get_project_details (
112- project_ids : list [str ], config : StackITSettings
112+ project_ids : list [str ], config : StackITSettings
113113) -> list [tuple [str , str ]]:
114114 """Fetches project details for a list of project ids from the Resource Manager API."""
115115 projects = []
@@ -161,9 +161,9 @@ def get_acls(project_id: str, instance_id: str, config: StackITSettings):
161161
162162
163163def check_database_acl_of_project (
164- project_id : str ,
165- cluster_egress_range : list [str ],
166- settings : StackITSettings ,
164+ project_id : str ,
165+ cluster_egress_range : list [str ],
166+ settings : StackITSettings ,
167167) -> bool :
168168 all_acls_are_correct = True
169169 # Determine the correct egress IP based on the project name
@@ -189,9 +189,9 @@ def check_database_acl_of_project(
189189
190190
191191def get_egress_range (
192- project_name : str ,
193- prod_cluster_egress_range : list [str ],
194- non_prod_cluster_egress_range : list [str ],
192+ project_name : str ,
193+ prod_cluster_egress_range : list [str ],
194+ non_prod_cluster_egress_range : list [str ],
195195) -> list [str ]:
196196 if "NON-PROD" in project_name .upper ():
197197 cluster_egress_range = non_prod_cluster_egress_range
@@ -233,7 +233,7 @@ def validate_org(organization_id: str):
233233 )
234234
235235 if not check_database_acl_of_project (
236- project_id , cluster_egress_range , settings
236+ project_id , cluster_egress_range , settings
237237 ):
238238 all_acls_are_correct = False
239239
@@ -247,15 +247,15 @@ def validate_org(organization_id: str):
247247
248248@app .command ()
249249def validate_projects (
250- project_ids : list [str ],
251- prod_egress_range : list [str ] | None = typer .Option (
252- help = "Egress IP Range of the Production Cluster. Env: PROD_EGRESS_RANGE" ,
253- default = None ,
254- ),
255- non_prod_egress_range : list [str ] | None = typer .Option (
256- help = "Egress IP Range of the Non-Prod Cluster. Env: NON_PROD_EGRESS_RANGE" ,
257- default = None ,
258- ),
250+ project_ids : list [str ],
251+ prod_egress_range : list [str ] | None = typer .Option (
252+ help = "Egress IP Range of the Production Cluster. Env: PROD_EGRESS_RANGE" ,
253+ default = None ,
254+ ),
255+ non_prod_egress_range : list [str ] | None = typer .Option (
256+ help = "Egress IP Range of the Non-Prod Cluster. Env: NON_PROD_EGRESS_RANGE" ,
257+ default = None ,
258+ ),
259259):
260260 logger .info ("Starting Stackit ACL check script..." )
261261 settings = StackITSettings ()
@@ -266,7 +266,7 @@ def validate_projects(
266266 project_name , prod_egress_range , non_prod_egress_range
267267 )
268268 if not check_database_acl_of_project (
269- project_id , cluster_egress_range , settings
269+ project_id , cluster_egress_range , settings
270270 ):
271271 all_acls_are_correct = False
272272
0 commit comments