nebari-dev / nebari-self-registration

Apache License 2.0
1 stars 2 forks source link

Add support for date based expiration #16

Open marcelovilla opened 5 months ago

marcelovilla commented 5 months ago

Is your feature request related to a problem? Please describe. Currently, the configuration parameter account_expiration_days allows to specify an arbitrary number of days after which the registered user will be disabled via Keycloak.

Describe the solution you'd like It would be nice to have the option of specifying an arbitrary date of user expiration instead a number of days in some cases.

Describe alternatives you've considered We could expose another exclusive configuration option such as account_expiration_date or update the existing parameter to accept either an integer with the number of days or a proper date formatted string, and rename it to something like account_expiration.

Additional context

kenafoster commented 5 months ago

Interesting - this wasn't needed for the specific use case against which the plugin was initially developed but I definitely see the value in it. My vote would be exclusive configuration options account_expiration_days and account_expiration_date (easiest for administrators to understand and also backwards-compatible)

marcelovilla commented 5 months ago

Thanks, @kenafoster. I agree that having two exclusive fields might be more intuitive and we can always add some validations to the pydantic schema to make sure only one is provided. I'll start working on this and open a PR as soon as I have something for you to review