ramosbugs / openidconnect-rs

OpenID Connect Library for Rust
MIT License
404 stars 100 forks source link

Feature Request: Support `const` scopes #148

Closed mhutter closed 8 months ago

mhutter commented 8 months ago

Make this possible:

const SCOPE_GROUPS: Scope = Scope::new("groups");

Use case

The Scope items requested are not something that changes often, so it would be great to have a way to make them const.

While their constructor already is a const fn, they take a String, which cannot be const (due to being allocated on the heap)

Implementation idea

Since Scope is nothing more as a wrapper, it seems feasible to have it take a &str instead of a String.

mhutter commented 8 months ago

During writing I realized Scope is a reexport from oauth2