@@ -8,8 +8,7 @@ use anyhow::Context as _;
8
8
use async_graphql:: { Context , Description , Enum , ID , Object } ;
9
9
use chrono:: { DateTime , Utc } ;
10
10
use mas_storage:: { oauth2:: OAuth2ClientRepository , user:: BrowserSessionRepository } ;
11
- use oauth2_types:: { oidc:: ApplicationType , scope:: Scope } ;
12
- use ulid:: Ulid ;
11
+ use oauth2_types:: oidc:: ApplicationType ;
13
12
use url:: Url ;
14
13
15
14
use super :: { BrowserSession , NodeType , SessionState , User , UserAgent } ;
@@ -200,33 +199,3 @@ impl OAuth2Client {
200
199
}
201
200
}
202
201
}
203
-
204
- /// An OAuth 2.0 consent represents the scope a user consented to grant to a
205
- /// client.
206
- #[ derive( Description ) ]
207
- pub struct OAuth2Consent {
208
- scope : Scope ,
209
- client_id : Ulid ,
210
- }
211
-
212
- #[ Object ( use_type_description) ]
213
- impl OAuth2Consent {
214
- /// Scope consented by the user for this client.
215
- pub async fn scope ( & self ) -> String {
216
- self . scope . to_string ( )
217
- }
218
-
219
- /// OAuth 2.0 client for which the user granted access.
220
- pub async fn client ( & self , ctx : & Context < ' _ > ) -> Result < OAuth2Client , async_graphql:: Error > {
221
- let state = ctx. state ( ) ;
222
- let mut repo = state. repository ( ) . await ?;
223
- let client = repo
224
- . oauth2_client ( )
225
- . lookup ( self . client_id )
226
- . await ?
227
- . context ( "Could not load client" ) ?;
228
- repo. cancel ( ) . await ?;
229
-
230
- Ok ( OAuth2Client ( client) )
231
- }
232
- }
0 commit comments