Example #1
0
class DevConfig(Config):
    root: str = '/dev'
    workspace: str = 'dev'
    environment_variables: dict = field(
        default_factory=lambda: {'ASSETS_URL': "https://draft.morassuti.com"}
    )
    cors: CORSConfig = CORSConfig(allow_origin='*', max_age=600)
Example #2
0
 def __init__(self, **kwargs):
     config = Config(cors=CORSConfig(allow_origin='https://www.test.fr',
                                     allow_headers=['X-Special-Header'],
                                     max_age=600,
                                     expose_headers=['X-Special-Header'],
                                     allow_credentials=True))
     super().__init__(configs=config, **kwargs)
Example #3
0
 def test_export_terraform_with_cors(self):
     config = Config(cors=CORSConfig(allow_origin='www.test.fr'))
     simple = SimpleMS(configs=config)
     CwsTerraformDeployer(simple)
     output = io.StringIO()
     self.export_cmd(simple, output)
     output.seek(0)
     print(output.read())
     output.seek(0)
     assert len(re.sub(r"\s", "", output.read())) == 44
Example #4
0
class ProdConfig(Config):
    workspace: str = 'prod'
    environment_variables: dict = field(
        default_factory=lambda: {'ASSETS_URL': "https://www.morassuti.com"}
    )
    cors: CORSConfig = CORSConfig(allow_origin='*', max_age=600)
Example #5
0
 def __init__(self, **kwargs):
     config = Config(cors=CORSConfig(
         allow_origin=['www.test.fr', 'www.test.com']))
     super().__init__(configs=config, **kwargs)
Example #6
0
 def __init__(self, **kwargs):
     config = Config(cors=CORSConfig(allow_origin='*'))
     super().__init__(configs=config, **kwargs)