Skip to content

Commit b5f94d0

Browse files
committed
extend request types
1 parent 4443b7a commit b5f94d0

File tree

9 files changed

+387
-39
lines changed

9 files changed

+387
-39
lines changed

atrium-common/src/store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ where
3636
T: MapStore<(), S> + Send + Sync,
3737
{
3838
async fn get_session(&self) -> Option<S> {
39-
self.get(&Default::default()).await.expect("Infallible")
39+
self.get(&()).await.expect("Infallible")
4040
}
4141
async fn set_session(&self, session: S) {
42-
self.set(Default::default(), session).await.expect("Infallible")
42+
self.set((), session).await.expect("Infallible")
4343
}
4444
async fn clear_session(&self) {
4545
self.clear().await.expect("Infallible")

atrium-oauth/oauth-client/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ mod http_client;
55
mod jose;
66
mod keyset;
77
mod oauth_client;
8+
mod oauth_session;
89
mod resolver;
910
mod server_agent;
1011
pub mod store;
1112
mod types;
1213
mod utils;
13-
mod oauth_session;
1414

1515
pub use atproto::{
1616
AtprotoClientMetadata, AtprotoLocalhostClientMetadata, AuthMethod, GrantType, Scope,

atrium-oauth/oauth-client/src/oauth_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::store::state::{InternalStateData, StateStore};
99
use crate::types::{
1010
AuthorizationCodeChallengeMethod, AuthorizationResponseType, AuthorizeOptions, CallbackParams,
1111
OAuthAuthorizationServerMetadata, OAuthClientMetadata,
12-
OAuthPusehedAuthorizationRequestResponse, PushedAuthorizationRequestParameters, TokenSet,
12+
OAuthPusehedAuthorizationRequestResponse, PushedAuthorizationRequestParameters,
1313
TryIntoOAuthClientMetadata,
1414
};
1515
use crate::utils::{compare_algos, generate_key, generate_nonce, get_random_values};

atrium-oauth/oauth-client/src/oauth_session.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,38 @@ use crate::{server_agent::OAuthServerAgent, store::session::Session};
1818
#[derive(Clone, Debug, Error)]
1919
pub enum Error {}
2020

21+
#[allow(dead_code)]
2122
pub struct OAuthSession<S, T, D, H>
2223
where
2324
S: SessionStore<Session>,
24-
// N: DpopStore + Send + Sync,
2525
T: XrpcClient + Send + Sync + 'static,
2626
D: DidResolver + Send + Sync,
2727
H: HandleResolver + Send + Sync,
2828
{
2929
did: Did,
30-
// dpop: DpopClient<T, N>,
3130
server: Arc<OAuthServerAgent<T, D, H>>,
3231
store: Arc<InnerStore<S>>,
3332
}
3433

3534
impl<S, T, D, H> OAuthSession<S, T, D, H>
3635
where
3736
S: SessionStore<Session>,
38-
// N: DpopStore + Send + Sync,
3937
T: XrpcClient + Send + Sync,
4038
D: DidResolver + Send + Sync,
4139
H: HandleResolver + Send + Sync,
4240
{
4341
pub fn new(
4442
did: Did,
45-
// dpop: DpopClient<T, N>,
4643
server: Arc<OAuthServerAgent<T, D, H>>,
4744
store: Arc<InnerStore<S>>,
4845
) -> Self {
49-
Self {
50-
did,
51-
// dpop,
52-
server,
53-
store,
54-
}
46+
Self { did, server, store }
5547
}
5648
}
5749

5850
impl<S, T, D, H> HttpClient for OAuthSession<S, T, D, H>
5951
where
6052
S: SessionStore<Session> + Send + Sync,
61-
// N: DpopStore + Send + Sync,
6253
T: XrpcClient + Send + Sync,
6354
D: DidResolver + Send + Sync,
6455
H: HandleResolver + Send + Sync,
@@ -74,7 +65,6 @@ where
7465
impl<S, T, D, H> XrpcClient for OAuthSession<S, T, D, H>
7566
where
7667
S: SessionStore<Session> + Send + Sync,
77-
// N: DpopStore + Send + Sync,
7868
T: XrpcClient + Send + Sync,
7969
D: DidResolver + Send + Sync,
8070
H: HandleResolver + Send + Sync,
@@ -99,7 +89,6 @@ where
9989
impl<S, T, D, H> SessionManager for OAuthSession<S, T, D, H>
10090
where
10191
S: SessionStore<Session> + Send + Sync,
102-
// N: DpopStore + Send + Sync,
10392
T: XrpcClient + Send + Sync,
10493
D: DidResolver + Send + Sync,
10594
H: HandleResolver + Send + Sync,

0 commit comments

Comments
 (0)