client-api: Make id_server
and id_access_token
in ThirdpartyIdCredentials
optional fields
This commit is contained in:
parent
b8f0cb8fac
commit
afb5ae0102
@ -6,6 +6,7 @@ Breaking changes:
|
||||
as before.
|
||||
- Change type of `client_secret` field in `ThirdpartyIdCredentials`
|
||||
from `Box<ClientSecret>` to `OwnedClientSecret`
|
||||
- Make `id_server` and `id_access_token` in `ThirdpartyIdCredentials` optional
|
||||
|
||||
Improvements:
|
||||
|
||||
|
@ -542,29 +542,25 @@ pub struct IncomingCustomThirdPartyId {
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
pub struct ThirdpartyIdCredentials {
|
||||
/// Identity server session ID.
|
||||
/// Identity server (or homeserver) session ID.
|
||||
pub sid: OwnedSessionId,
|
||||
|
||||
/// Identity server client secret.
|
||||
/// Identity server (or homeserver) client secret.
|
||||
pub client_secret: OwnedClientSecret,
|
||||
|
||||
/// Identity server URL.
|
||||
pub id_server: String,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub id_server: Option<String>,
|
||||
|
||||
/// Identity server access token.
|
||||
pub id_access_token: String,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub id_access_token: Option<String>,
|
||||
}
|
||||
|
||||
impl ThirdpartyIdCredentials {
|
||||
/// Creates a new `ThirdpartyIdCredentials` with the given session ID, client secret, identity
|
||||
/// server address and access token.
|
||||
pub fn new(
|
||||
sid: OwnedSessionId,
|
||||
client_secret: OwnedClientSecret,
|
||||
id_server: String,
|
||||
id_access_token: String,
|
||||
) -> Self {
|
||||
Self { sid, client_secret, id_server, id_access_token }
|
||||
/// Creates a new `ThirdpartyIdCredentials` with the given session ID and client secret.
|
||||
pub fn new(sid: OwnedSessionId, client_secret: OwnedClientSecret) -> Self {
|
||||
Self { sid, client_secret, id_server: None, id_access_token: None }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user