feat: Data object for Service properties
Los mantenedores suelen responder en 1 día
@lucamrgs ya está trabajando en esto.
Desde el 23/9/2024.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- backend-api-design
Línea de trabajo
Comienza con la clase DataClassification y la propiedad de datos de Service, y compara después su representación con el esquema de servicios JSON de CycloneDX 1.6 enlazado en el issue. Confirma cómo se espera que aparezcan el origen y el destino, y considera completado el trabajo cuando los datos de Service admitan los campos requeridos por el esquema y la serialización resultante coincida con él.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Dear implementers,
it appears to me that the Data object for the Services property is not correctly implemented (see https://cyclonedx.org/docs/1.6/json/#services_items_data).
I am trying to instantiate a Service, and upon populating the data property, I get this hint from the docs
The DataClassification class is defined as
@serializable.serializable_class
class DataClassification:
"""
This is our internal representation of the `dataClassificationType` complex type within the CycloneDX standard.
DataClassification might be deprecated since CycloneDX 1.5, but it is not deprecated in this library.
In fact, this library will try to provide a compatibility layer if needed.
.. note::
See the CycloneDX Schema for dataClassificationType:
https://cyclonedx.org/docs/1.4/xml/#type_dataClassificationType
"""
def __init__(
self, *,
flow: DataFlow,
classification: str
) -> None:
self.flow = flow
self.classification = classification
@property
@serializable.xml_attribute()
def flow(self) -> DataFlow:
"""
Specifies the flow direction of the data.
Valid values are: inbound, outbound, bi-directional, and unknown.
Direction is relative to the service.
- Inbound flow states that data enters the service
- Outbound flow states that data leaves the service
- Bi-directional states that data flows both ways
- Unknown states that the direction is not known
Returns:
`DataFlow`
"""
return self._flow
@flow.setter
def flow(self, flow: DataFlow) -> None:
self._flow = flow
@property
@serializable.xml_name('.')
@serializable.xml_string(serializable.XmlStringSerializationType.NORMALIZED_STRING)
def classification(self) -> str:
"""
Data classification tags data according to its type, sensitivity, and value if altered, stolen, or destroyed.
Returns:
`str`
"""
return self._classification
@classification.setter
def classification(self, classification: str) -> None:
self._classification = classification
def __eq__(self, other: object) -> bool:
if isinstance(other, DataClassification):
return hash(other) == hash(self)
return False
def __lt__(self, other: object) -> bool:
if isinstance(other, DataClassification):
return _ComparableTuple((
self.flow, self.classification
)) < _ComparableTuple((
other.flow, other.classification
))
return NotImplemented
def __hash__(self) -> int:
return hash((self.flow, self.classification))
def __repr__(self) -> str:
return f'<DataClassification flow={self.flow}>'
Which seems to be missing the "source" and "destination" properties.
This my poetry.lock entry for cyclonedx-python-lib
name = "cyclonedx-python-lib"
version = "7.6.0"
description = "Python library for CycloneDX"
optional = false
python-versions = "<4.0,>=3.8"
files = [
{file = "cyclonedx_python_lib-7.6.0-py3-none-any.whl", hash = "sha256:30655e89e5f987dc8d57835919748d71589fafeb33ff1dec45048eb72eda3cf9"},
{file = "cyclonedx_python_lib-7.6.0.tar.gz", hash = "sha256:fa481d5f0d82728cb6a32e55f8ba9c666ba75a2bd99eb643228e3011c56bb5c4"},
]
Would it be possible for you to adjust this, or let me know what I could do otherwise? Thank you!
- Lenguaje dominante
- Python
- Estrellas
- 117
- Forks
- 67
- Merge medio
- 21 h 9 min
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CycloneDX/cyclonedx-python-lib
-
[PERF] Quadratic (O(N^2)) serialization time for large BOMs — `Bom.validate()` → `register_dependency()` linear scanPosiblemente ocupada @inspired-geek la tomó hace 110 días. Abiertoperformance
Dificultad 3/5 1-2 días Aptitud para principiantes 36/100
CycloneDX/cyclonedx-python-lib#1006 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
tests: test all model enumsQuizá libre de nuevo @jkowalleck la tomó hace 125 días y no hay ningún pull request abierto. AbiertoQA
CycloneDX/cyclonedx-python-lib#991 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
feat(deps)!: make all de/serialization libraries optionalQuizá libre de nuevo @Simoh23999 la tomó hace 73 días y no hay ningún pull request abierto. Abiertobreaking change dependencies
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
CycloneDX/cyclonedx-python-lib#979 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
feat: Add support for Component signaturePosiblemente ocupada @wiebe-vandendriessche la tomó hace 124 días. Abiertoenhancement help wanted schema 1.4
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
CycloneDX/cyclonedx-python-lib#978 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
chore: have coverage uploaded consitentlyQuizá libre de nuevo @jkowalleck la tomó hace 172 días y no hay ningún pull request abierto. Abiertochore
CycloneDX/cyclonedx-python-lib#966 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de CycloneDX/cyclonedx-python-lib
Issues similares
-
Let's Encrypt certificate neededAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
GAM-team/got-your-back#547 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
UKGovernmentBEIS/inspect_ai#5821 ·
Los mantenedores suelen responder en 1 día
-
docs help wanted
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
-
evidence wanted good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
open-coder-ai/agentseam#195 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día