Add serialize support to userinfo (ex to write it to a database)

This commit is contained in:
Matthew Scheirer 2017-11-15 22:52:50 -05:00
parent 3c802be578
commit 7bb71aa7fe
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ pub(crate) fn secure(url: &Url) -> Result<(), Error> {
}
// TODO I wish we could impl default for this, but you cannot have a config without issuer etc
#[derive(Debug, Deserialize, Serialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct Config {
#[serde(with = "url_serde")] pub issuer: Url,
#[serde(with = "url_serde")] pub authorization_endpoint: Url,

View File

@ -439,7 +439,7 @@ pub struct Options {
/// The userinfo struct contains all possible userinfo fields regardless of scope. [See spec.](https://openid.net/specs/openid-connect-basic-1_0.html#StandardClaims)
// TODO is there a way to use claims_supported in config to simplify this struct?
#[derive(Deserialize, Validate)]
#[derive(Serialize, Deserialize, Validate)]
pub struct Userinfo {
pub sub: String,
#[serde(default)] pub name: Option<String>,
@ -510,7 +510,7 @@ impl Prompt {
}
/// Address Claim struct. Can be only formatted, only the rest, or both.
#[derive(Deserialize)]
#[derive(Serialize, Deserialize)]
pub struct Address {
#[serde(default)] pub formatted: Option<String>,
#[serde(default)] pub street_address: Option<String>,