Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update poem-openapi requirement from 2.0.26 to 3.0.0 #8

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ serde = ["dep:serde"]
itertools = { version = "0.11.0", default-features = false, features = ["use_std"] }
paste = { version = "1.0.12", default-features = false }
poem = { version = "1.3.55", default-features = false }
poem-openapi = { version = "2.0.26", default-features = false }
poem-openapi = { version = "3.0.0", default-features = false }
sea-orm = { version = "0.11.3", default-features = false, optional = true, features = ["macros"] }
serde = { version = "1.0.167", default-features = false, optional = true }
tokio-shield = { version = "0.1.0", default-features = false, optional = true }
Expand Down
16 changes: 9 additions & 7 deletions src/auth.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/// Define a custom authorization dependency based on [`poem_openapi::auth::Bearer`] that uses a
/// custom function to perform authorization.
/// Define a custom authorization dependency based on
/// [`poem_openapi::auth::Bearer`] that uses a custom function to perform
/// authorization.
///
/// To use this macro, you need both a tuple like struct that only contains the type for
/// a successful authorization (e.g. a struct with information about the authenticated user)
/// and a function that taks a request and a bearer token to check authorization.
/// To use this macro, you need both a tuple like struct that only contains the
/// type for a successful authorization (e.g. a struct with information about
/// the authenticated user) and a function that taks a request and a bearer
/// token to check authorization.
///
/// #### Example
/// ```
Expand Down Expand Up @@ -58,8 +60,8 @@ macro_rules! custom_auth {
($auth:path, $checker:expr) => {
#[::poem::async_trait]
impl<'a> ::poem_openapi::ApiExtractor<'a> for $auth {
const TYPE: ::poem_openapi::ApiExtractorType =
::poem_openapi::ApiExtractorType::SecurityScheme;
const TYPES: &'static [::poem_openapi::ApiExtractorType] =
&[::poem_openapi::ApiExtractorType::SecurityScheme];

type ParamType = ();
type ParamRawType = ();
Expand Down