driplineorg / driplineorg/dripline-python

allow (require?) limiting of available cmd targets

Open
#67 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Currently, an OP_CMD can call any method of an endpoint. It would probably be good to restrict this in one or both of the following ways:

1. any function which starts with an underscore (`_`) should be rejected with an error. The same should be true for setting attributes with the same name pattern.

2. it should only be possible to call a restricted subset of "whitelisted" methods. I'm not sure exactly how this would work, but I think the nicest way would be to apply a decorator to functions we want to whitelist. We could also consider the other side and have a decorator which prevents a method from being called directly by an OP_CMD.

Item 1 should be easy to just add to the logic in `Endpoint`. Item 2 will require more thought and some experimenting.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.