mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 06:45:08 +00:00
chore(service): service class type hints (#2695)
This commit is contained in:
@@ -4,6 +4,7 @@ from prowler.providers.aws.aws_provider import (
|
||||
generate_regional_clients,
|
||||
get_default_region,
|
||||
)
|
||||
from prowler.providers.aws.lib.audit_info.models import AWS_Audit_Info
|
||||
|
||||
|
||||
class AWSService:
|
||||
@@ -14,7 +15,7 @@ class AWSService:
|
||||
- Also handles if the AWS Service is Global
|
||||
"""
|
||||
|
||||
def __init__(self, service, audit_info, global_service=False):
|
||||
def __init__(self, service: str, audit_info: AWS_Audit_Info, global_service=False):
|
||||
# Audit Information
|
||||
self.audit_info = audit_info
|
||||
self.audited_account = audit_info.audited_account
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
from prowler.lib.logger import logger
|
||||
from prowler.providers.azure.lib.audit_info.models import Azure_Audit_Info
|
||||
|
||||
|
||||
class AzureService:
|
||||
def __init__(
|
||||
self,
|
||||
service,
|
||||
audit_info,
|
||||
service: str,
|
||||
audit_info: Azure_Audit_Info,
|
||||
):
|
||||
self.clients = self.__set_clients__(
|
||||
audit_info.identity.subscriptions, audit_info.credentials, service
|
||||
|
||||
@@ -6,10 +6,17 @@ from googleapiclient import discovery
|
||||
|
||||
from prowler.lib.logger import logger
|
||||
from prowler.providers.gcp.gcp_provider import generate_client
|
||||
from prowler.providers.gcp.lib.audit_info.models import GCP_Audit_Info
|
||||
|
||||
|
||||
class GCPService:
|
||||
def __init__(self, service, audit_info, region="global", api_version="v1"):
|
||||
def __init__(
|
||||
self,
|
||||
service: str,
|
||||
audit_info: GCP_Audit_Info,
|
||||
region="global",
|
||||
api_version="v1",
|
||||
):
|
||||
# We receive the service using __class__.__name__ or the service name in lowercase
|
||||
# e.g.: APIKeys --> we need a lowercase string, so service.lower()
|
||||
self.service = service.lower() if not service.islower() else service
|
||||
|
||||
Reference in New Issue
Block a user