Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

New API: Don't hardcode metadata files extension

Đang mở
#1,333 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api, documentation

Hướng nghiên cứu

Đọc tuf/api/metadata.py xung quanh chỗ sử dụng JSON được hardcode đã liên kết và xem xét PR serializer trừu tượng đã liên kết. Lập danh mục các giả định về JSON trong các lớp metadata và tài liệu; công việc được xem là hoàn tất khi các giả định đó được loại bỏ và một loại tệp metadata khác được hỗ trợ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Description of issue or feature request:
In a review of a pr adding additional classes in the metadata API, @sechkova noticed that we have hardcoded
the usage of JSON files representing our metadata files after the implementation of abstract (de)serializer here.

For context: Teodoras comment

Current behavior:
Hardcoded *.json file names in a lot of places: https://github.com/theupdateframework/tuf/blob/52207862008cc54db8a43e1543a653be0d0333f7/tuf/api/metadata.py#L468

Expected behavior:
Don't hardcode the file names representing our metadata files with their file extensions.

TODO:

  • Remove hardcoded json strings from the code in all classes.
  • Fix our documentation to not give examples with JSON files or have a sentence like For JSON metadata files, here is how it will look like...
  • Add support for other metadata file types inside the metadata classes.
    This could be achieved with a configuration option in a Repository class or helper functions for each of the metadata classes.
Ngôn ngữ chính
Python
Star
1.7k
Fork
304
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
17

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của theupdateframework/python-tuf

Tất cả issue của theupdateframework/python-tuf

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.