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