Comments (4)
Sounds like #1 is perhaps the best approach. There may be other reasons in the future we would want a custom schema. Let's just make sure the build script prints a visible warning (use colors if possible) that warns when the schema is not regenerated.
from monkey.
Sounds like #1 is perhaps the best approach. There may be other reasons in the future we would want a custom schema. Let's just make sure the build script prints a visible warning (use colors if possible) that warns when the schema is not regenerated.
from monkey.
The problem started when we updated the plugin build script to generate the config schema based on the options model. Before this, the schemas were generated manually. Now the build script uses pydantic's model_json_schema to generate the schema.
The ransomware target directory options are nullable types. The manually generated schema modeled this by using ["null", "string"]
as the type of the field. The pydantic generated schema uses anyOf
with one of the options as type: null
. This anyOf
is rendered by RJSF as a dropdown list.
Pydantic issue discussing anyOf
for nullable types
PR adding RJSF's support for nullable types
RJSF documentation on nullable types
from monkey.
Potential solutions:
- Provide a manually generated schema for Ransomware, and update the build script to only generate the config schema if one doesn't already exist
- Use a custom generator that flattens out the
anyOf
when generating the schema - Flatten out the
anyOf
in the Island UI when retrieving the schema from the API - Submit a PR to RJSF to handle this
anyOf
case
from monkey.
Related Issues (20)
- Migrate to monkeytoolbox
- Enable `reset_modules_cache` for plugins
- Prompt user to update
- Add journeys feature to the map
- Ransomware wallpaper text may get cut
- Refresh the token based on user activity HOT 1
- Migrate to Agent Plugin Interface
- Migrate to Agent Plugin Toolbox
- Plugin selection screen
- Reimplement configuration features
- Implement plugin options screen
- Track traffic
- Binaries not getting signed HOT 1
- Refactor the `{build,get}_monkey_commandline{_linux,_windows,}()` debacle
- Add light/dark mode
- Run next lint in pre-commit hooks
- Refactor styles to follow MUI HOT 1
- Support multiple users and roles
- Improve error page styles
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monkey.