Comments (3)
Hey @da2ce7, can you please review this? If we implement it as I have described it, we will remove the option to provide an email, even if it's not mandatory, until we allow it in the profile settings (new feature).
This could be a helpful feature for some reason. I think email is the only way to communicate with users now, so even if we don't require it, it could be useful to allow the user to provide it.
from torrust-index.
I would rename mail
to email
.
Here are the different variants.
Registration Disabled:
# [registration]
Registration without email option:
[registration]
Registration optionally including an email address:
[registration]
[registration.email]
Registration with email:
[registration]
[registration.email]
required = true
Registration with optional email, but if email is supplied it is verified:
[registration]
[registration.email]
verified = true
Registration with email and email is verified:
[registration]
[registration.email]
required = true
verified = true
from torrust-index.
Hi @da2ce7, just to confirm, do you prefer to represent the omitted value for required
and verified
with an Option
or set the default value to false?
This would be the Rust struct using Options (omitting other configuration fields):
struct Config {
registration: Option<Registration> // default None. Registration disabled.
}
struct Registration {
mail: Option<Email> // default None. Registration without email.
}
struct Email {
required: Option<bool>, // default None.
verified: Option<bool>, // default None.
}
And this would be the Rust struct using defaults (omitting other configuration fields):
struct Config {
registration: Option<Registration> // default None. Registration disabled.
}
struct Registration {
mail: Option<Email> // default None. Registration without email.
}
struct Email {
required: bool, // default false
verified: bool, // default false
}
In practice, you must assume a true or false default value for Option. So I would use the direct option.
And these are the "debug" instances for each case (assuming no optional booleans):
Registration Disabled:
Config {
registration: None
}
Registration without email option:
Config {
registration: Some(Registration {
mail: None
})
}
Registration optionally including an email address:
Config {
registration: Some(Registration {
mail: Some({
required: false,
verified: false,
})
})
}
Registration with email:
Config {
registration: Some(Registration {
mail: Some({
required: true,
verified: false,
})
})
}
Registration with optional email, but if email is supplied it is verified:
Config {
registration: Some(Registration {
mail: Some({
required: false,
verified: true,
})
})
}
Registration with email and email is verified:
Config {
registration: Some(Registration {
mail: Some({
required: true,
verified: true,
})
})
}
And in JSON:
Registration Disabled:
{}
Registration without email option:
{
"registration": {}
}
Registration optionally including an email address:
{
"registration": {
"email": {}
}
}
Registration with email:
{
"registration": {
"email": {
"required": true
}
}
}
Registration with optional email, but if email is supplied it is verified:
{
"registration": {
"email": {
"verified": true
}
}
}
Registration with email and email is verified:
{
"registration": {
"email": {
"required": true,
"verified": true
}
}
}
from torrust-index.
Related Issues (20)
- Move from `log` to `tracing` crate
- Remove duplicate slash `/` in tracker URL inside to downloaded torrent file HOT 1
- Update tracker TOML configuration (breaking changes) HOT 1
- Update tracker configuration HOT 1
- Configuration overhaul: add version to the configuration
- Configuration overhaul: rename `log_level` to `threshold`
- Configuration overhaul: rename `auth::secret_key` to `auth::user_claim_token_pepper` HOT 1
- Configuration overhaul: split `TrackerMode`into two flags `private` and `listed`
- Configuration overhaul: print the final configuration to console
- Update database driver in Tracker configuration
- Config overhaul: use an explicit section for metadata HOT 1
- Config overhaul: make some fields mandatory HOT 2
- Config overhaul: rename config option `verified` to `verification_required`
- Fix docker warning in `Containerfile`
- Update tracker configuration
- Allow overwriting hardcoded casbin configuration
- Config overhaul: make secrets mandatory HOT 1
- Wrong error message for `PasswordTooLong` error
- New config option: max torrent upload size
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torrust-index.