File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 9696 Short : "Start HTTP server" ,
9797 Long : `Start an HTTP server that listens for MCP requests over HTTP.` ,
9898 RunE : func (_ * cobra.Command , _ []string ) error {
99+ ttl := viper .GetDuration ("repo-access-cache-ttl" )
99100 httpConfig := ghhttp.HTTPServerConfig {
100101 Version : version ,
101102 Host : viper .GetString ("host" ),
@@ -104,6 +105,8 @@ var (
104105 EnableCommandLogging : viper .GetBool ("enable-command-logging" ),
105106 LogFilePath : viper .GetString ("log-file" ),
106107 ContentWindowSize : viper .GetInt ("content-window-size" ),
108+ LockdownMode : viper .GetBool ("lockdown-mode" ),
109+ RepoAccessCacheTTL : & ttl ,
107110 }
108111
109112 return ghhttp .RunHTTPServer (httpConfig )
Original file line number Diff line number Diff line change @@ -33,3 +33,19 @@ func GetToolsets(ctx context.Context) []string {
3333 }
3434 return nil
3535}
36+
37+ // lockdownCtxKey is a context key for lockdown mode
38+ type lockdownCtxKey struct {}
39+
40+ // WithLockdownMode adds lockdown mode state to the context
41+ func WithLockdownMode (ctx context.Context , enabled bool ) context.Context {
42+ return context .WithValue (ctx , lockdownCtxKey {}, enabled )
43+ }
44+
45+ // IsLockdownMode retrieves the lockdown mode state from the context
46+ func IsLockdownMode (ctx context.Context ) bool {
47+ if enabled , ok := ctx .Value (lockdownCtxKey {}).(bool ); ok {
48+ return enabled
49+ }
50+ return false
51+ }
You can’t perform that action at this time.
0 commit comments