Change Box<ClientSecret> types to OwnedClientSecret

This commit is contained in:
Jonas Platte 2024-05-30 04:28:59 -04:00 committed by GitHub
parent 2a4b3f5668
commit d9f08f585c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 6 deletions

View File

@ -4,6 +4,8 @@ Breaking changes:
- `RoomSummary::heroes` now properly contains only `UserId` instead of `String`
as before.
- Change type of `client_secret` field in `ThirdpartyIdCredentials`
from `Box<ClientSecret>` to `OwnedClientSecret`
Improvements:

View File

@ -9,7 +9,7 @@ use ruma_common::{
api::{error::IntoHttpError, EndpointError, OutgoingResponse},
serde::{from_raw_json_value, JsonObject, StringEnum},
thirdparty::Medium,
ClientSecret, OwnedSessionId, OwnedUserId,
OwnedClientSecret, OwnedSessionId, OwnedUserId,
};
use serde::{
de::{self, DeserializeOwned},
@ -546,7 +546,7 @@ pub struct ThirdpartyIdCredentials {
pub sid: OwnedSessionId,
/// Identity server client secret.
pub client_secret: Box<ClientSecret>,
pub client_secret: OwnedClientSecret,
/// Identity server URL.
pub id_server: String,
@ -560,7 +560,7 @@ impl ThirdpartyIdCredentials {
/// server address and access token.
pub fn new(
sid: OwnedSessionId,
client_secret: Box<ClientSecret>,
client_secret: OwnedClientSecret,
id_server: String,
id_access_token: String,
) -> Self {

View File

@ -1,5 +1,10 @@
# [unreleased]
Breaking changes:
- Change type of `client_secret` field in `ThreePidOwnershipProof`
from `Box<ClientSecret>` to `OwnedClientSecret`
# 0.9.0
Breaking changes:

View File

@ -11,7 +11,7 @@ pub mod v2 {
api::{request, response, Metadata},
metadata,
thirdparty::Medium,
ClientSecret, OwnedSessionId, OwnedUserId,
OwnedClientSecret, OwnedSessionId, OwnedUserId,
};
use serde::{Deserialize, Serialize};
@ -96,12 +96,12 @@ pub mod v2 {
pub sid: OwnedSessionId,
/// The client secret passed to the `requestToken` call.
pub client_secret: Box<ClientSecret>,
pub client_secret: OwnedClientSecret,
}
impl ThreePidOwnershipProof {
/// Creates a new `ThreePidOwnershipProof` with the given session ID and client secret.
pub fn new(sid: OwnedSessionId, client_secret: Box<ClientSecret>) -> Self {
pub fn new(sid: OwnedSessionId, client_secret: OwnedClientSecret) -> Self {
Self { sid, client_secret }
}
}