Add docstrings for pytm model entities
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu trong pytm/pytm.py với lớp Actor và phương thức init của lớp này, sau đó xác định các lớp thực thể mô hình pytm khác được yêu cầu đề cập. Theo các tham chiếu docstring lớp và hàm theo kiểu Google-style được liên kết, rồi sử dụng ./tm.py --list-elements và ./tm.py --describe để xác minh rằng các thực thể được ghi tài liệu cung cấp mô tả hữu ích.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The CLI based development workflow using ./tm.py --list-elements + ./tm.py --describe <element> is not convenient for threat model creation.
An easier and more efficient workflow to work with model entities (this includes custom model entities) makes use of/depends on docstrings.
E.g. when using google docstring format the Actor class (docstring reference) + __init__ method (google format docstring reference) could be documented like
class Actor(Element):
"""An entity usually initiating actions.
Attributes:
port (int): Default TCP port for outgoing data flows.
protocol (str): Default network protocol for outgoing data flows.
data (list): List of pytm.Data objects in outgoing data flows.
inputs (list): List of incoming Dataflows.
outputs (list): List of outgoing Dataflows.
isAdmin (bool): Indicates if the actor is an administrator.
"""
port = varInt(-1, doc="Default TCP port for outgoing data flows")
protocol = varString("", doc="Default network protocol for outgoing data flows")
data = varData([], doc="pytm.Data object(s) in outgoing data flows")
inputs = varElements([], doc="incoming Dataflows")
outputs = varElements([], doc="outgoing Dataflows")
isAdmin = varBool(False)
def __init__(self, name, **kwargs):
"""
Initialize an Actor object.
Args:
name (str): The name of the actor.
**kwargs: Additional keyword arguments.
port (int): Default TCP port for outgoing data flows.
protocol (str): Default network protocol for outgoing data flows.
data (list): List of pytm.Data objects in outgoing data flows.
inputs (list): List of incoming Dataflows.
outputs (list): List of outgoing Dataflows.
isAdmin (bool): Indicates if the actor is an administrator.
"""
super().__init__(name, **kwargs)
TM._actors.append(self)
and would result IDE-wise in something like this:
https://github.com/user-attachments/assets/9ede76e1-3689-4906-bd39-b2af7e0333af
- Ngôn ngữ chính
- Python
- Star
- 1.2k
- Fork
- 237
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OWASP/pytm
-
Dataflow defaults overwrite values the model set explicitlyCó thể đã có người làm @markthomaschurch đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Calling TM.dfd() a second time returns an empty diagramCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Datastore icon is missing from SVG diagrams (absolute PNG path)Có thể đã có người làm @markthomaschurch đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 20/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Long boundary names render a literal "\n" in the DFDCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 3 ngày
-
`TM.check()` overwrites explicit Dataflow `protocol`, `dstPort` and `controls.isEncrypted` with sink defaults (regression in 1.4.0)Có thể đã có người làm @Svastikkka đã nhận 14 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 75/100
OWASP/pytm#373 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
btclib-org/btclib-wallet#872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
saltstack/salt#70789 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
btclib-org/btclib#3093 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
patrickballard/wheelgap#269 ·
-
priority: low python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
LearningCircuit/local-deep-research#8635 ·
Maintainer thường phản hồi trong vòng 1 ngày