Closed abhi1693 closed 2 years ago
@theriverman Can you please validate this?
Hi, @abhi1693
Thanks for the PR, this is indeed a bug due to my poor solution. However, I'm not perfectly happy with this proposed change:
self.__MINIO_USE_HTTPS: bool = get_setting("MINIO_USE_HTTPS", False)
I haven't set default values for these settings parameters because I would like to enforce the user to explicitly configure it. We can't assume whether their used MinIO instance will be http or https, so the best option is keeping this responsibility in the user's hand.
I propose to go with something like this
mandatory_parameters = (self.__MINIO_ENDPOINT, self.__MINIO_ACCESS_KEY, self.__MINIO_SECRET_KEY)
if any([bool(x) is False for x in mandatory_parameters]) or (get_setting("MINIO_USE_HTTPS") is None):
raise ConfigurationError(
"A mandatory parameter (ENDPOINT, ACCESS_KEY, SECRET_KEY or USE_HTTP) hasn't been configured properly"
)
I had the
MINIO_USE_HTTPS=False
in my settings and the library failed to start asvalidate_settings
requiresUSE_HTTPS
asTrue
which should not be enforced on the user.I have removed it from mandatory settings and set it's default value as
False