@@ -18,14 +18,16 @@ class GlobalFabricRTIEnvVarNames:
18
18
functions_deployment_default_port = "FUNCTIONS_CUSTOMHANDLER_PORT" # Azure Functions uses this port name
19
19
http_path = "FABRIC_RTI_HTTP_PATH"
20
20
stateless_http = "FABRIC_RTI_STATELESS_HTTP"
21
+ use_obo_flow = "USE_OBO_FLOW"
21
22
22
23
23
24
DEFAULT_FABRIC_API_BASE = "https://api.fabric.microsoft.com/v1"
24
25
DEFAULT_FABRIC_RTI_TRANSPORT = "stdio"
25
26
DEFAULT_FABRIC_RTI_HTTP_PORT = 3000
26
27
DEFAULT_FABRIC_RTI_HTTP_PATH = "/mcp"
27
28
DEFAULT_FABRIC_RTI_HTTP_HOST = "127.0.0.1"
28
- DEFAULT_FABRIC_RTI_STATELESS_HTTP = False
29
+ DEFAULT_FABRIC_RTI_STATELESS_HTTP = True
30
+ DEFAULT_USE_OBO_FLOW = False
29
31
30
32
31
33
@dataclass (slots = True , frozen = True )
@@ -36,6 +38,7 @@ class GlobalFabricRTIConfig:
36
38
http_port : int
37
39
http_path : str
38
40
stateless_http : bool
41
+ use_obo_flow : bool
39
42
40
43
@staticmethod
41
44
def from_env () -> GlobalFabricRTIConfig :
@@ -56,6 +59,7 @@ def from_env() -> GlobalFabricRTIConfig:
56
59
stateless_http = bool (
57
60
os .getenv (GlobalFabricRTIEnvVarNames .stateless_http , DEFAULT_FABRIC_RTI_STATELESS_HTTP )
58
61
),
62
+ use_obo_flow = bool (os .getenv (GlobalFabricRTIEnvVarNames .use_obo_flow , DEFAULT_USE_OBO_FLOW )),
59
63
)
60
64
61
65
@staticmethod
@@ -69,6 +73,7 @@ def existing_env_vars() -> List[str]:
69
73
GlobalFabricRTIEnvVarNames .http_port ,
70
74
GlobalFabricRTIEnvVarNames .http_path ,
71
75
GlobalFabricRTIEnvVarNames .stateless_http ,
76
+ GlobalFabricRTIEnvVarNames .use_obo_flow ,
72
77
]
73
78
for env_var in env_vars :
74
79
if os .getenv (env_var ) is not None :
@@ -85,7 +90,8 @@ def with_args() -> GlobalFabricRTIConfig:
85
90
parser .add_argument ("--http" , action = "store_true" , help = "Use HTTP transport" )
86
91
parser .add_argument ("--host" , type = str , help = "HTTP host to listen on" )
87
92
parser .add_argument ("--port" , type = int , help = "HTTP port to listen on" )
88
- parser .add_argument ("--stateless-http" , type = bool , help = "Enable or disable stateless HTTP" )
93
+ parser .add_argument ("--stateless-http" , action = "store_true" , help = "Enable or disable stateless HTTP" )
94
+ parser .add_argument ("--use-obo-flow" , action = "store_true" , help = "Enable or disable OBO flow" )
89
95
args , _ = parser .parse_known_args ()
90
96
91
97
transport = base_config .transport
@@ -97,6 +103,7 @@ def with_args() -> GlobalFabricRTIConfig:
97
103
stateless_http = args .stateless_http if args .stateless_http is not None else base_config .stateless_http
98
104
http_host = args .host if args .host is not None else base_config .http_host
99
105
http_port = args .port if args .port is not None else base_config .http_port
106
+ use_obo_flow = args .use_obo_flow if args .use_obo_flow is not None else base_config .use_obo_flow
100
107
101
108
return GlobalFabricRTIConfig (
102
109
fabric_api_base = base_config .fabric_api_base ,
@@ -105,8 +112,9 @@ def with_args() -> GlobalFabricRTIConfig:
105
112
http_port = http_port ,
106
113
http_path = base_config .http_path ,
107
114
stateless_http = stateless_http ,
115
+ use_obo_flow = use_obo_flow ,
108
116
)
109
117
110
118
111
119
# Global configuration instance
112
- config = GlobalFabricRTIConfig .with_args ()
120
+ global_config = GlobalFabricRTIConfig .with_args ()
0 commit comments