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

Oauth session #242

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
59b8bb8
Move AtpAgent
sugyan Nov 7, 2024
0ca7a86
Add Agent and SessionManager
sugyan Nov 8, 2024
7dc3a19
Temporary fix for bsky-sdk
sugyan Nov 8, 2024
ab0b4b8
Add OAuthSession
sugyan Nov 13, 2024
83a0be3
Update
sugyan Nov 14, 2024
2cebd0c
Update oauth_client::atproto
sugyan Nov 18, 2024
a18f555
initialize crate
avdb13 Nov 8, 2024
0fbfd5a
add resolvers
avdb13 Nov 8, 2024
fa96328
add store
avdb13 Nov 8, 2024
c365c66
fix `atrium-oauth`
avdb13 Nov 8, 2024
1b7a489
add error conversions
avdb13 Nov 8, 2024
c885f41
fix identity crate
avdb13 Nov 8, 2024
2a10eac
fix oauth-client crate
avdb13 Nov 8, 2024
5c0f923
small fix
avdb13 Nov 9, 2024
cded849
change `Resolver` type signature
avdb13 Nov 15, 2024
fab85a3
add `JwtTokenType` for `XrpcClient::authentication_token`
avdb13 Nov 14, 2024
162f396
Move AtpAgent
sugyan Nov 7, 2024
a99e974
replace `AtpSessionStore` with `MapStore`
avdb13 Nov 12, 2024
b594b59
replace `SimpleStore` with `MapStore`
avdb13 Nov 12, 2024
0087dcf
remove error conversions
avdb13 Nov 12, 2024
1c862bd
fix unit tests
avdb13 Nov 12, 2024
41f760f
split `Store` into `CellStore`/`MapStore`
avdb13 Nov 14, 2024
6dcf610
deprecate `AtpSessionStore` in favor of `CellStore`
avdb13 Nov 14, 2024
ca0666f
add `SessionStore` to `OAuthClient`
avdb13 Nov 12, 2024
b6d0a25
add server agent helpers
avdb13 Nov 12, 2024
cd5702a
introduce `OAuthSession`
avdb13 Nov 14, 2024
a39da51
extend request types
avdb13 Nov 12, 2024
7268be8
generate DPoP proof for access tokens
avdb13 Nov 14, 2024
0c1f06d
implement `HttpClient` for `OAuthSession`
avdb13 Nov 14, 2024
c0b35dd
correction
avdb13 Nov 14, 2024
eab30e8
wip
avdb13 Nov 14, 2024
402a914
add refresh token error
avdb13 Nov 14, 2024
c3c8d92
change generic parameter
avdb13 Nov 20, 2024
9a0c5cc
deprecate `CellStore`
avdb13 Nov 20, 2024
eedd0d9
testing example
avdb13 Nov 20, 2024
185cfdf
rebase fixes
avdb13 Nov 21, 2024
87b4b4f
`atrium-oauth` cleanup
avdb13 Nov 21, 2024
56375a6
`atrium-api` cleanup
avdb13 Nov 21, 2024
fc11bb8
`bsky-sdk` cleanup
avdb13 Nov 21, 2024
82a9398
Merge branch 'feature/agent-rework' into oauth-session
avdb13 Nov 24, 2024
dcfd1a1
use SessionStore in OAuthSession
avdb13 Nov 24, 2024
bdfbe28
allow refresh/logout by OAuthSession
avdb13 Nov 24, 2024
7a99b89
fix tests
avdb13 Nov 24, 2024
2e2690a
debug
avdb13 Nov 29, 2024
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
Prev Previous commit
Next Next commit
bsky-sdk cleanup
avdb13 committed Nov 24, 2024
commit fc11bb8db81e511232f89f6aa3e9daf9a6812226
3 changes: 3 additions & 0 deletions bsky-sdk/src/agent.rs
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ pub struct BskyAgent<T = ReqwestClient, S = MemoryMapStore<(), AtpSession>>
where
T: XrpcClient + Send + Sync,
S: MapStore<(), AtpSession> + Send + Sync,
S::Error: Send + Sync + 'static,
{
inner: Arc<AtpAgent<S, T>>,
}
@@ -68,6 +69,7 @@ impl<T, S> BskyAgent<T, S>
where
T: XrpcClient + Send + Sync,
S: MapStore<(), AtpSession> + Send + Sync,
S::Error: Send + Sync + 'static,
{
/// Get the agent's current state as a [`Config`].
pub async fn to_config(&self) -> Config {
@@ -250,6 +252,7 @@ impl<T, S> Deref for BskyAgent<T, S>
where
T: XrpcClient + Send + Sync,
S: MapStore<(), AtpSession> + Send + Sync,
S::Error: Send + Sync + 'static,
{
type Target = AtpAgent<S, T>;

1 change: 1 addition & 0 deletions bsky-sdk/src/agent/builder.rs
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ impl<T, S> BskyAtpAgentBuilder<T, S>
where
T: XrpcClient + Send + Sync,
S: MapStore<(), AtpSession> + Send + Sync,
S::Error: Send + Sync + 'static,
{
/// Set the configuration for the agent.
pub fn config(mut self, config: Config) -> Self {
3 changes: 3 additions & 0 deletions bsky-sdk/src/record.rs
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ pub trait Record<T, S>
where
T: XrpcClient + Send + Sync,
S: MapStore<(), AtpSession> + Send + Sync,
S::Error: Send + Sync + 'static,
{
fn list(
agent: &BskyAgent<T, S>,
@@ -47,6 +48,7 @@ macro_rules! record_impl {
where
T: XrpcClient + Send + Sync,
S: MapStore<(), AtpSession> + Send + Sync,
S::Error: Send + Sync + 'static,
{
async fn list(
agent: &BskyAgent<T, S>,
@@ -164,6 +166,7 @@ macro_rules! record_impl {
where
T: XrpcClient + Send + Sync,
S: MapStore<(), AtpSession> + Send + Sync,
S::Error: Send + Sync + 'static,
{
async fn list(
agent: &BskyAgent<T, S>,
1 change: 1 addition & 0 deletions bsky-sdk/src/record/agent.rs
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ impl<T, S> BskyAgent<T, S>
where
T: XrpcClient + Send + Sync,
S: MapStore<(), AtpSession> + Send + Sync,
S::Error: Send + Sync + 'static,
{
/// Create a record with various types of data.
/// For example, the Record families defined in [`KnownRecord`](atrium_api::record::KnownRecord) are supported.