client-api: Add optional cookie field to sso_login*::Response
This commit is contained in:
parent
b8768c3f19
commit
abebde0cf1
@ -23,6 +23,7 @@ Improvements:
|
|||||||
login types.
|
login types.
|
||||||
- Add deprecated `address` and `medium` 3PID fields for `m.login.password`
|
- Add deprecated `address` and `medium` 3PID fields for `m.login.password`
|
||||||
login type.
|
login type.
|
||||||
|
- Add optional cookie field to `session::sso_login*::v3` responses.
|
||||||
|
|
||||||
# 0.17.4
|
# 0.17.4
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ pub mod v3 {
|
|||||||
//!
|
//!
|
||||||
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3loginssoredirect
|
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3loginssoredirect
|
||||||
|
|
||||||
use http::header::LOCATION;
|
use http::header::{LOCATION, SET_COOKIE};
|
||||||
use ruma_common::{
|
use ruma_common::{
|
||||||
api::{request, response, Metadata},
|
api::{request, response, Metadata},
|
||||||
metadata,
|
metadata,
|
||||||
@ -37,6 +37,10 @@ pub mod v3 {
|
|||||||
/// Redirect URL to the SSO identity provider.
|
/// Redirect URL to the SSO identity provider.
|
||||||
#[ruma_api(header = LOCATION)]
|
#[ruma_api(header = LOCATION)]
|
||||||
pub location: String,
|
pub location: String,
|
||||||
|
|
||||||
|
/// Cookie storing state to secure the SSO process.
|
||||||
|
#[ruma_api(header = SET_COOKIE)]
|
||||||
|
pub cookie: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
@ -49,7 +53,7 @@ pub mod v3 {
|
|||||||
impl Response {
|
impl Response {
|
||||||
/// Creates a new `Response` with the given SSO URL.
|
/// Creates a new `Response` with the given SSO URL.
|
||||||
pub fn new(location: String) -> Self {
|
pub fn new(location: String) -> Self {
|
||||||
Self { location }
|
Self { location, cookie: None }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ pub mod v3 {
|
|||||||
//!
|
//!
|
||||||
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3loginssoredirectidpid
|
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3loginssoredirectidpid
|
||||||
|
|
||||||
use http::header::LOCATION;
|
use http::header::{LOCATION, SET_COOKIE};
|
||||||
use ruma_common::{
|
use ruma_common::{
|
||||||
api::{request, response, Metadata},
|
api::{request, response, Metadata},
|
||||||
metadata,
|
metadata,
|
||||||
@ -43,6 +43,10 @@ pub mod v3 {
|
|||||||
/// Redirect URL to the SSO identity provider.
|
/// Redirect URL to the SSO identity provider.
|
||||||
#[ruma_api(header = LOCATION)]
|
#[ruma_api(header = LOCATION)]
|
||||||
pub location: String,
|
pub location: String,
|
||||||
|
|
||||||
|
/// Cookie storing state to secure the SSO process.
|
||||||
|
#[ruma_api(header = SET_COOKIE)]
|
||||||
|
pub cookie: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
@ -55,7 +59,7 @@ pub mod v3 {
|
|||||||
impl Response {
|
impl Response {
|
||||||
/// Creates a new `Response` with the given SSO URL.
|
/// Creates a new `Response` with the given SSO URL.
|
||||||
pub fn new(location: String) -> Self {
|
pub fn new(location: String) -> Self {
|
||||||
Self { location }
|
Self { location, cookie: None }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user