cjkent / osiris

Simple Serverless Web Apps in Kotlin
Apache License 2.0
39 stars 2 forks source link

Allow different ApplicationConfig for different environments #544

Open cjkent opened 4 years ago

cjkent commented 4 years ago

There is a single instance ApplicationConfig for all environments. This isn't sufficient for the cases where a Cognito User Pool is defined outside the Osiris application and a different user pool is used in different environments.

This is also true of VPC config - it is possible that different VPC config is required for different environments.

The API factory should take a (nullable?) argument specifying the environment name. Not sure how to make that compatible with existing projects with GeneratedApiFactory.

cjkent commented 4 years ago

The workaround for this is to define everything in the Osiris application - Cognito, VPC etc

cjkent commented 4 years ago

It would be good if this could seamlessly work in the case where there are no separate environments defined.

v79 commented 4 years ago

Would that allow me set up a configuration which bypasses Authentication when running locally, but keep it secure when deployed to AWS?

cjkent commented 4 years ago

Would that allow me set up a configuration which bypasses Authentication when running locally, but keep it secure when deployed to AWS?

That's what happens anyway. The local server is only intended for testing and there is no auth.

The authenticaion is done by AWS so there is actually no way to enforce auth when you're running locally.