use std::collections::HashMap;
use serde_json::Value;
#[derive(Default)]
pub struct RevokeExtras {
pub client_assertion_payload: Option<HashMap<String, Value>>,
pub revocation_body: Option<HashMap<String, String>>,
}
impl RevokeExtras {
pub fn add_client_assertion_claim(mut self, key: impl Into<String>, value: Value) -> Self {
match self.client_assertion_payload.as_mut() {
Some(cap) => {
cap.insert(key.into(), value);
}
None => {
let mut new = HashMap::new();
new.insert(key.into(), value);
self.client_assertion_payload = Some(new);
}
}
self
}
pub fn add_revocation_body_param(
mut self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self {
match self.revocation_body.as_mut() {
Some(rb) => {
rb.insert(key.into(), value.into());
}
None => {
let mut new = HashMap::new();
new.insert(key.into(), value.into());
self.revocation_body = Some(new);
}
}
self
}
}