File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
packages/cubejs-backend-native/src
rust/cubesql/cubesql/src/sql Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,14 @@ impl AuthContext for NativeSQLAuthContext {
7878 fn as_any ( & self ) -> & dyn Any {
7979 self
8080 }
81+
82+ fn user ( & self ) -> Option < & String > {
83+ self . user . as_ref ( )
84+ }
85+
86+ fn security_context ( & self ) -> Option < & serde_json:: Value > {
87+ self . security_context . as_ref ( )
88+ }
8189}
8290
8391#[ async_trait]
@@ -140,6 +148,14 @@ impl GatewayAuthContext for NativeGatewayAuthContext {
140148 fn as_any ( & self ) -> & dyn Any {
141149 self
142150 }
151+
152+ fn user ( & self ) -> Option < & String > {
153+ None
154+ }
155+
156+ fn security_context ( & self ) -> Option < & serde_json:: Value > {
157+ self . security_context . as_ref ( )
158+ }
143159}
144160
145161#[ derive( Debug , Serialize ) ]
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ use serde::Serialize;
88// Any type will allow us to split (with downcast) auth context
99pub trait GatewayAuthContext : Debug + Send + Sync {
1010 fn as_any ( & self ) -> & dyn Any ;
11+
12+ fn user ( & self ) -> Option < & String > ;
13+
14+ fn security_context ( & self ) -> Option < & serde_json:: Value > ;
1115}
1216
1317pub type GatewayAuthContextRef = Arc < dyn GatewayAuthContext > ;
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ use crate::CubeError;
88// Any type will allow us to split (with downcast) auth context into HTTP (standalone) or Native
99pub trait AuthContext : Debug + Send + Sync {
1010 fn as_any ( & self ) -> & dyn Any ;
11+
12+ fn user ( & self ) -> Option < String > ;
13+
14+ fn security_context ( & self ) -> Option < & serde_json:: Value > ;
1115}
1216
1317pub type AuthContextRef = Arc < dyn AuthContext > ;
You can’t perform that action at this time.
0 commit comments