1+ use bon:: Builder ;
12use oauth2:: {
23 AuthUrl , Client , ClientId , ClientSecret , EndpointMaybeSet , EndpointNotSet , IntrospectionUrl ,
34 RedirectUrl , RevocationUrl , StandardRevocableToken , TokenUrl ,
@@ -37,11 +38,18 @@ pub enum OauthProviderPkceCodeChallenge {
3738 S256 ,
3839}
3940
40- #[ derive( Clone , Debug ) ]
41+ #[ expect( clippy:: duplicated_attributes) ]
42+ #[ derive( Builder , Clone , Debug ) ]
43+ #[ builder(
44+ on( String , into) ,
45+ on( SecretString , into) ,
46+ state_mod( vis = "pub(crate)" )
47+ ) ]
4148pub struct OauthProvider {
4249 pub id : String ,
4350 pub name : String ,
4451 pub slug : Option < String > ,
52+ #[ builder( default = OauthProviderVisibility :: Public ) ]
4553 pub visibility : OauthProviderVisibility ,
4654 pub client_id : String ,
4755 pub client_secret : Option < SecretString > ,
@@ -55,6 +63,7 @@ pub struct OauthProvider {
5563 pub introspection_url_params : Option < String > ,
5664 pub revocation_url : Option < String > ,
5765 pub revocation_url_params : Option < String > ,
66+ #[ builder( default = OauthProviderPkceCodeChallenge :: S256 ) ]
5867 pub pkce_code_challenge : OauthProviderPkceCodeChallenge ,
5968 pub icon_url : Option < String > ,
6069}
0 commit comments