Move TokenType to ruma-common

This commit is contained in:
Isaiah Inuwa 2020-12-26 11:49:42 -06:00 committed by Jonas Platte
parent 7bfeddf40e
commit 4831585223
6 changed files with 19 additions and 22 deletions

View File

@ -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:

View File

@ -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),
}

View File

@ -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

View 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),
}

View File

@ -2,6 +2,7 @@
#![warn(missing_docs, missing_debug_implementations)]
pub mod authentication;
pub mod directory;
pub mod encryption;
pub mod presence;

View File

@ -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),
}