Move TokenType to ruma-common
This commit is contained in:
parent
7bfeddf40e
commit
4831585223
@ -62,6 +62,7 @@ Breaking changes:
|
||||
* Replace `r0::room::create_room::InitialStateEvent` with `ruma_events::InitialStateEvent`
|
||||
* `error::ErrorKind` no longer implements `Copy`, `FromStr`
|
||||
* Switch from `AnyEvent` to `AnyRoomEvent` in `r0::search::search_events`
|
||||
* Move `r0::account::request_openid_token::TokenType` to `ruma-common` crate
|
||||
|
||||
Improvements:
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_common::authentication::TokenType;
|
||||
use ruma_identifiers::{ServerNameBox, UserId};
|
||||
use ruma_serde::StringEnum;
|
||||
|
||||
ruma_api! {
|
||||
metadata: {
|
||||
@ -59,13 +59,3 @@ impl Response {
|
||||
Self { access_token, token_type, matrix_server_name, expires_in }
|
||||
}
|
||||
}
|
||||
|
||||
/// Access token types.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
||||
pub enum TokenType {
|
||||
/// Bearer token type
|
||||
Bearer,
|
||||
|
||||
#[doc(hidden)]
|
||||
_Custom(String),
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ Improvements:
|
||||
* Add `directory::{Filter, PublicRoomsChunk, RoomNetwork}` (moved from
|
||||
`ruma_client_api::r0::directory`)
|
||||
* Add `push::{PusherData, PushFormat}` (moved from `ruma_client_api::r0::push`)
|
||||
* Add `authentication::TokenType` (moved from
|
||||
`ruma_client_api::r0::account:request_openid_token`)
|
||||
|
||||
# 0.2.0
|
||||
|
||||
|
13
ruma-common/src/authentication.rs
Normal file
13
ruma-common/src/authentication.rs
Normal file
@ -0,0 +1,13 @@
|
||||
//! Common types for authentication.
|
||||
|
||||
use ruma_serde::StringEnum;
|
||||
|
||||
/// Access token types.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
||||
pub enum TokenType {
|
||||
/// Bearer token type
|
||||
Bearer,
|
||||
|
||||
#[doc(hidden)]
|
||||
_Custom(String),
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
|
||||
#![warn(missing_docs, missing_debug_implementations)]
|
||||
|
||||
pub mod authentication;
|
||||
pub mod directory;
|
||||
pub mod encryption;
|
||||
pub mod presence;
|
||||
|
@ -3,7 +3,7 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_common::StringEnum;
|
||||
use ruma_common::authentication::TokenType;
|
||||
use ruma_identifiers::ServerName;
|
||||
|
||||
ruma_api! {
|
||||
@ -57,13 +57,3 @@ impl Response {
|
||||
Self { token }
|
||||
}
|
||||
}
|
||||
|
||||
/// Access token types.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
||||
pub enum TokenType {
|
||||
/// Bearer token type
|
||||
Bearer,
|
||||
|
||||
#[doc(hidden)]
|
||||
_Custom(String),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user