1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use std::collections::HashMap;

use josekit::jwk::Jwk;

/// # UserinfoRequestParams
/// Parameters for customizing Userinfo request
pub struct UserinfoOptions<'a> {
    /// Request method: POST or GET
    pub method: &'a str,
    /// How to send the access token. Valid values: `header` or `body` (POST request)
    pub via: &'a str,
    /// Additional params to sent with the userinfo request
    pub params: Option<HashMap<String, String>>,
    /// When provided the client will send a DPoP Proof JWT.
    pub dpop: Option<&'a Jwk>,
}

impl Default for UserinfoOptions<'_> {
    fn default() -> Self {
        Self {
            method: "GET",
            via: "header",
            params: None,
            dpop: None,
        }
    }
}