Added sharing config with auto/disabled options #951
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Perfect! I've successfully implemented the requested changes to add a
sharing
config option that can be set to"auto"
or"disabled"
while maintaining backward compatibility with the deprecatedautoshare
field.Summary of Changes
Updated config schema (
src/config/config.ts
):sharing
field with enum values"auto"
|"disabled"
autoshare
field as deprecated with@deprecated
commentisSharingEnabled()
helper function that respects both new and old config fieldsUpdated sharing logic in multiple files:
src/session/index.ts
): Now usesConfig.isSharingEnabled()
instead of directly checkingcfg.autoshare
src/cli/cmd/run.ts
): Updated to use the new helper function and added error message when sharing is disabled but--share
flag is usedBackward compatibility:
autoshare
field is still respected for existing configurationssharing
is explicitly set, it takes precedence overautoshare
sharing
is not set, falls back toautoshare
behaviorUsage Examples
New configuration (recommended):
Legacy configuration (still works):
Mixed configuration (sharing takes precedence):
This implementation allows enterprise users to disable sharing entirely by setting
"sharing": "disabled"
in their configuration files, addressing the security concerns raised in the GitHub issue while maintaining full backward compatibility with existing configurations.Closes #938
view session | view log