ROOT_DOMAIN_NAME = 'root'
EMAIL_CONSOLE_DOMAIN = ''
EMAIL_SERVICE_NAME = 'Cloudforet'
# ACCESS_TOKEN (default) / PASSWORD
RESET_PASSWORD_TYPE = 'ACCESS_TOKEN'
DATABASE_AUTO_CREATE_INDEX = True
DATABASES = {
    'default': {
        # 'db': '',
        # 'host': '',
        # 'port': 0,
        # 'username': '',
        # 'password': '',
        # 'ssl': False,
        # 'ssl_ca_certs': ''
    }
}

CACHES = {
    'default': {},
    'local': {
        'backend': 'spaceone.core.cache.local_cache.LocalCache',
        'max_size': 128,
        'ttl': 300
    }
}

IDENTITY = {
    'token': {
        'verify_code_timeout': 3600,
        'temporary_token_timeout': 86400,  # 24 hours
        'token_timeout': 1200,
        'refresh_timeout': 1800,
        'refresh_ttl': 18,
        'refresh_once': False
    }
}

HANDLERS = {
    # 'authentication': [{
    #     'backend': 'spaceone.core.handler.authentication_handler.AuthenticationGRPCHandler',
    #     'uri': 'grpc://localhost:50051/v1/Domain/get_public_key'
    # }],
    # 'authorization': [{
    #     'backend': 'spaceone.core.handler.authorization_handler.AuthorizationGRPCHandler',
    #     'uri': 'grpc://localhost:50051/v1/Authorization/verify'
    # }],
    # 'mutation': [{
    #     'backend': 'spaceone.core.handler.mutation_handler.SpaceONEMutationHandler'
    # }],
    # 'event': []
}

CONNECTORS = {
    'SpaceConnector': {
        'backend': 'spaceone.core.connector.space_connector.SpaceConnector',
        'endpoints': {
            'plugin': 'grpc://plugin:50051',
            'secret': 'grpc://secret:50051',
            'repository': 'grpc://repository:50051'
        }
    },
    'SMTPConnector': {
        'host': 'smtp.mail.com',
        'port': '1234',
        'user': 'cloudforet',
        'password': '1234',
        'from_email': 'support@cloudforet.com'
    }
}

ENDPOINTS = [
    # {
    #     'service': 'identity',
    #     'name': 'Identity Service',
    #     'endpoint': 'grpc://<endpoint>>:<port>/v1'
    # },
]

# Internal Endpoint
INTERNAL_ENDPOINTS = [
    {
        'service': 'identity',
        'name': 'Identity Service',
        'endpoint': 'grpc://identity.spaceone.svc.cluster.local:50051/v1'
    },
    {
        'service': 'secret',
        'name': 'Secret Service',
        'endpoint': 'grpc://secret.spaceone.svc.cluster.local:50051/v1'
    },
    {
        'service': 'repository',
        'name': 'Repository Service',
        'endpoint': 'grpc://repository.spaceone.svc.cluster.local:50051/v1'
    },
    {
        'service': 'plugin',
        'name': 'Plugin Service',
        'endpoint': 'grpc://plugin.spaceone.svc.cluster.local:50051/v1'
    },
    {
        'service': 'config',
        'name': 'Config Service',
        'endpoint': 'grpc://config.spaceone.svc.cluster.local:50051/v1'
    },
    {
        'service': 'inventory',
        'name': 'Inventory Service',
        'endpoint': 'grpc://inventory.spaceone.svc.cluster.local:50051/v1'
    },
    {
        'service': 'monitoring',
        'name': 'Monitoring Service',
        'endpoint': 'grpc://monitoring.spaceone.svc.cluster.local:50051/v1'
    },
    {
        'service': 'statistics',
        'name': 'Statistics Service',
        'endpoint': 'grpc://statistics.spaceone.svc.cluster.local:50051/v1'
    }
]
