import { useState } from 'react'; import { saveCollectionSecurityConfig } from 'providers/ReduxStore/slices/collections/actions'; import classnames from 'classnames'; import StyledWrapper from './StyledWrapper'; import { useDispatch } from 'react-redux'; const SecuritySettings = ({ collection }) => { const dispatch = useDispatch(); const [selectedAppMode, setSelectedAppMode] = useState(collection?.securityConfig?.appMode || 'developer'); const handleAppModeChange = (e) => { setSelectedAppMode(e.target.value); }; const handleSave = () => { dispatch( saveCollectionSecurityConfig(collection?.uid, { appMode: selectedAppMode, runtime: selectedAppMode === 'developer' ? 'vm2' : selectedAppMode === 'safe' ? 'isolated-vm' : undefined }) ) .then(() => { toast.success('App Mode updated successfully'); }) .catch((err) => console.log(err) && toast.error('Failed to update JS AppMode')); }; return (
Scripting Sandbox
Bruno allows JavaScript code to be executed within Variables, Scripts, Tests, and Assertions.

JavaScript code is executed in a secure sandbox and cannot excess your filesystem or execute system commands.

JavaScript code has access to the filesystem, execute system commands and access sensitive information.

); }; export default SecuritySettings;