Skip to content

Commit

Permalink
Export device authorization flow types in top-level namespace
Browse files Browse the repository at this point in the history
Previously, some of the types were exported at the top level, and
some were exported in the `devicecode` module, with no clear reason for
the separation. With this change, all related types are exported at
the top level, while the `devicecode` module continues to be exported
for backward compatibility.
  • Loading branch information
ramosbugs committed Jun 4, 2023
1 parent 6b21af5 commit 1ba2862
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@
//!
//! - [`actix-web-oauth2`](https://github.com/pka/actix-web-oauth2) (version 2.x of this crate)
//!
use chrono::serde::ts_seconds_option;
use chrono::{DateTime, Utc};
use std::borrow::Cow;
use std::error::Error;
use std::fmt::Error as FormatterError;
Expand All @@ -429,12 +427,16 @@ use std::marker::PhantomData;
use std::sync::Arc;
use std::time::Duration;

use chrono::serde::ts_seconds_option;
use chrono::{DateTime, Utc};
use http::header::{HeaderMap, HeaderValue, ACCEPT, AUTHORIZATION, CONTENT_TYPE};
use http::status::StatusCode;
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use url::{form_urlencoded, Url};

use crate::devicecode::DeviceAccessTokenPollResult;

///
/// Basic OAuth2 implementation with no extensions
/// ([RFC 6749](https://tools.ietf.org/html/rfc6749)).
Expand All @@ -456,10 +458,6 @@ compile_error!("wasm32 is not supported with the `curl` feature. Use the `reqwes
/// ([RFC 8628](https://tools.ietf.org/html/rfc8628)).
///
pub mod devicecode;
use devicecode::{
DeviceAccessTokenPollResult, DeviceAuthorizationResponse, DeviceCodeErrorResponse,
DeviceCodeErrorResponseType, ExtraDeviceAuthorizationFields,
};

///
/// OAuth 2.0 Token Revocation implementation
Expand Down Expand Up @@ -497,12 +495,18 @@ pub mod ureq;
pub use http;
pub use url;

pub use devicecode::{
DeviceAuthorizationResponse, DeviceCodeErrorResponse, DeviceCodeErrorResponseType,
EmptyExtraDeviceAuthorizationFields, ExtraDeviceAuthorizationFields,
StandardDeviceAuthorizationResponse,
};

pub use types::{
AccessToken, AuthUrl, AuthorizationCode, ClientId, ClientSecret, CsrfToken,
DeviceAuthorizationUrl, DeviceCode, EndUserVerificationUrl, IntrospectionUrl,
PkceCodeChallenge, PkceCodeChallengeMethod, PkceCodeVerifier, RedirectUrl, RefreshToken,
ResourceOwnerPassword, ResourceOwnerUsername, ResponseType, RevocationUrl, Scope, TokenUrl,
UserCode,
UserCode, VerificationUriComplete,
};

pub use revocation::{RevocableToken, RevocationErrorResponseType, StandardRevocableToken};
Expand Down

0 comments on commit 1ba2862

Please sign in to comment.