Skip to content

Idea: better compile-time config validation #5

@RBerga06

Description

@RBerga06

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions