server icon indicating copy to clipboard operation
server copied to clipboard

[EPIC] [API] Fields Call

Open zyronix opened this issue 3 years ago • 0 comments

To make the Web UI as dynamic as possible a fields call should be implemented. The Fields call can be used to determine what kind of type a field is. For example: a text field, binary, choices, lengths. But also have descriptions/tooltips attached to fields.

  • [ ] Research possible solution
  • [ ] Build PoC
  • [ ] Implement all fields

Possible solutions:

  • https://github.com/OAI/OpenAPI-Specification/issues/256
  • https://github.com/OAI/OpenAPI-Specification/issues/182
  • https://stackoverflow.com/questions/71121399/how-do-i-incorporate-json-schema-into-my-openapi-file
  • https://github.com/wework/json-schema-to-openapi-schema
  • https://stackoverflow.com/questions/47649038/json-schema-conditional-dependency-on-value
    get /fields
    -> {
        'hashlist':
            'name': {'type': 'str(128)', 'description': ''}
        'agent':
           'agenttype': {'type': 'int', 'choices': {
                 
                    CPU: {value: 1, description: cpu}}
                    GPU: {value: 1, description: cpu}
                
        }
        notification-triggers
        {
            'actions':
                {
                    'deleteHashlist':
                        {
                            type: object[Hashlist[url=/apiv2/hashlist/]] #voorbeeldjes bijzoeken
                            type: int
                            object: Hashlist
                            value: optional
                        }
                }
        }
        task
        {
            name
            agentBinaryType: {
                display_type: str
                choice: [array[agentBinaryVersion]]
            }
        }
    }

    # inter dependacies between query parameters
    * ./meta/task/create
    post: OPTIONS ./task/
    {
        {name: type str}
        {agentbinary{
            id=1,name=hashcat:
                {
                    v1.2.3: id=1
                    v1.2.4: id=2
                }
            generic:
                {
                    v123: id =4
                    v542: id = 5
                }
        }}
    }
    patch: OPTIONS ./task/:id
    {
        name
        meta: {create {'name', agentbinary,}}
    }

Required helper functions:

  • [ ] Set user password

zyronix avatar Mar 20 '23 09:03 zyronix