openidconnect-rs
openidconnect-rs copied to clipboard
Provide AuthorizationRequest::add_scope variant that does not consume scope
[Disclaimer: I'm pretty new to Rust, I sincerely hope this all makes sense :-)]
I'm using openidconnect-rs in a project where the OpenID Connect scope is configurable; it is read from a config file or the environment as a space separated string. In order to add all scopes to the authorization URL, I have to call add_scope repeatedly and since add_scope consumes the scope, I have to clone it. This seems rather inefficient to me, since this has to be done for each session that is created.
So I think a variant that accepts an Rc<Scope> or Arc<Scope> would be helpful.