I think it would be possible to improve compile-time validation of the configuration, by embedding the current “configuration state” in the type system. This would allow us:
- to remove the run-time validity check mentioned in the README (attempting to allow credentials without an origin)
- to better comunicate the configuration defaults. I tried using the crate without calling
.allow_methods(...) because I was expecting that, by default, all methods were supported; however, with trial and error, I discovered that the default is actually to allow no methods. It would be useful if the user was required to always call .allow_methods(...), maybe even with &[] as an argument: this way it's very clear that they want to allow no methods.
I'll experiment a bit with my idea and then I'll post my findings here.
I think it would be possible to improve compile-time validation of the configuration, by embedding the current “configuration state” in the type system. This would allow us:
.allow_methods(...)because I was expecting that, by default, all methods were supported; however, with trial and error, I discovered that the default is actually to allow no methods. It would be useful if the user was required to always call.allow_methods(...), maybe even with&[]as an argument: this way it's very clear that they want to allow no methods.I'll experiment a bit with my idea and then I'll post my findings here.