@@ -2,7 +2,7 @@ use crate::execution::evaluator::evaluate_transient_flow;
22use crate :: prelude:: * ;
33
44use crate :: base:: schema:: { FieldSchema , ValueType } ;
5- use crate :: base:: spec:: { NamedSpec , OutputMode , ReactiveOpSpec , SpecFormatter } ;
5+ use crate :: base:: spec:: { AuthEntryReference , NamedSpec , OutputMode , ReactiveOpSpec , SpecFormatter } ;
66use crate :: lib_context:: {
77 QueryHandlerContext , clear_lib_context, get_auth_registry, init_lib_context,
88} ;
@@ -630,6 +630,13 @@ fn add_transient_auth_entry(value: Pythonized<serde_json::Value>) -> PyResult<St
630630 . into_py_result ( )
631631}
632632
633+ #[ pyfunction]
634+ fn get_auth_entry ( key : String ) -> PyResult < Pythonized < serde_json:: Value > > {
635+ let auth_ref = AuthEntryReference :: new ( key) ;
636+ let json_value: serde_json:: Value = get_auth_registry ( ) . get ( & auth_ref) . into_py_result ( ) ?;
637+ Ok ( Pythonized ( json_value) )
638+ }
639+
633640#[ pyfunction]
634641fn get_app_namespace ( py : Python < ' _ > ) -> PyResult < String > {
635642 let app_namespace = py
@@ -671,6 +678,7 @@ fn cocoindex_engine(m: &Bound<'_, PyModule>) -> PyResult<()> {
671678 m. add_function ( wrap_pyfunction ! ( remove_flow_context, m) ?) ?;
672679 m. add_function ( wrap_pyfunction ! ( add_auth_entry, m) ?) ?;
673680 m. add_function ( wrap_pyfunction ! ( add_transient_auth_entry, m) ?) ?;
681+ m. add_function ( wrap_pyfunction ! ( get_auth_entry, m) ?) ?;
674682 m. add_function ( wrap_pyfunction ! ( get_app_namespace, m) ?) ?;
675683
676684 m. add_class :: < builder:: flow_builder:: FlowBuilder > ( ) ?;
0 commit comments