@@ -21,23 +21,22 @@ use matrix_sdk_base::SessionMeta;
2121use tokio:: sync:: { broadcast, Mutex , OnceCell } ;
2222
2323pub mod matrix;
24- #[ cfg( feature = "experimental-oidc" ) ]
2524pub mod oidc;
2625
27- use self :: matrix:: { MatrixAuth , MatrixAuthData } ;
28- #[ cfg( feature = "experimental-oidc" ) ]
29- use self :: oidc:: { Oidc , OidcAuthData , OidcCtx } ;
26+ use self :: {
27+ matrix:: { MatrixAuth , MatrixAuthData } ,
28+ oidc:: { Oidc , OidcAuthData , OidcCtx } ,
29+ } ;
3030use crate :: { Client , RefreshTokenError , SessionChange } ;
3131
32- #[ cfg( all( feature = "experimental-oidc" , feature = " e2e-encryption", not( target_arch = "wasm32" ) ) ) ]
32+ #[ cfg( all( feature = "e2e-encryption" , not( target_arch = "wasm32" ) ) ) ]
3333pub mod qrcode;
3434
3535/// Session tokens, for any kind of authentication.
3636#[ allow( missing_debug_implementations, clippy:: large_enum_variant) ]
3737pub enum SessionTokens {
3838 /// Tokens for a [`matrix`] session.
3939 Matrix ( matrix:: MatrixSessionTokens ) ,
40- #[ cfg( feature = "experimental-oidc" ) ]
4140 /// Tokens for an [`oidc`] session.
4241 Oidc ( oidc:: OidcSessionTokens ) ,
4342}
@@ -51,7 +50,6 @@ pub(crate) type ReloadSessionCallback =
5150/// All the data relative to authentication, and that must be shared between a
5251/// client and all its children.
5352pub ( crate ) struct AuthCtx {
54- #[ cfg( feature = "experimental-oidc" ) ]
5553 pub ( crate ) oidc : OidcCtx ,
5654
5755 /// Whether to try to refresh the access token automatically when an
@@ -93,7 +91,6 @@ pub enum AuthApi {
9391 Matrix ( MatrixAuth ) ,
9492
9593 /// The OpenID Connect API.
96- #[ cfg( feature = "experimental-oidc" ) ]
9794 Oidc ( Oidc ) ,
9895}
9996
@@ -105,7 +102,6 @@ pub enum AuthSession {
105102 Matrix ( matrix:: MatrixSession ) ,
106103
107104 /// A session using the OpenID Connect API.
108- #[ cfg( feature = "experimental-oidc" ) ]
109105 Oidc ( Box < oidc:: OidcSession > ) ,
110106}
111107
@@ -114,7 +110,6 @@ impl AuthSession {
114110 pub fn meta ( & self ) -> & SessionMeta {
115111 match self {
116112 AuthSession :: Matrix ( session) => & session. meta ,
117- #[ cfg( feature = "experimental-oidc" ) ]
118113 AuthSession :: Oidc ( session) => & session. user . meta ,
119114 }
120115 }
@@ -123,7 +118,6 @@ impl AuthSession {
123118 pub fn into_meta ( self ) -> SessionMeta {
124119 match self {
125120 AuthSession :: Matrix ( session) => session. meta ,
126- #[ cfg( feature = "experimental-oidc" ) ]
127121 AuthSession :: Oidc ( session) => session. user . meta ,
128122 }
129123 }
@@ -132,7 +126,6 @@ impl AuthSession {
132126 pub fn access_token ( & self ) -> & str {
133127 match self {
134128 AuthSession :: Matrix ( session) => & session. tokens . access_token ,
135- #[ cfg( feature = "experimental-oidc" ) ]
136129 AuthSession :: Oidc ( session) => & session. user . tokens . access_token ,
137130 }
138131 }
@@ -141,7 +134,6 @@ impl AuthSession {
141134 pub fn get_refresh_token ( & self ) -> Option < & str > {
142135 match self {
143136 AuthSession :: Matrix ( session) => session. tokens . refresh_token . as_deref ( ) ,
144- #[ cfg( feature = "experimental-oidc" ) ]
145137 AuthSession :: Oidc ( session) => session. user . tokens . refresh_token . as_deref ( ) ,
146138 }
147139 }
@@ -153,7 +145,6 @@ impl From<matrix::MatrixSession> for AuthSession {
153145 }
154146}
155147
156- #[ cfg( feature = "experimental-oidc" ) ]
157148impl From < oidc:: OidcSession > for AuthSession {
158149 fn from ( session : oidc:: OidcSession ) -> Self {
159150 Self :: Oidc ( session. into ( ) )
@@ -166,7 +157,6 @@ pub(crate) enum AuthData {
166157 /// Data for the native Matrix authentication API.
167158 Matrix ( MatrixAuthData ) ,
168159 /// Data for the OpenID Connect API.
169- #[ cfg( feature = "experimental-oidc" ) ]
170160 Oidc ( OidcAuthData ) ,
171161}
172162
@@ -178,7 +168,6 @@ impl AuthData {
178168 pub ( crate ) fn access_token ( & self ) -> Option < String > {
179169 let token = match self {
180170 Self :: Matrix ( d) => d. tokens . get ( ) . access_token ,
181- #[ cfg( feature = "experimental-oidc" ) ]
182171 Self :: Oidc ( d) => d. tokens . get ( ) ?. get ( ) . access_token ,
183172 } ;
184173
0 commit comments