feat: Data object for Service properties
@lucamrgs já está trabalhando nisso.
Desde 23/9/2024.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- python
- Domínio
- backend-api-design
Direção de pesquisa
Comece pela classe DataClassification e pela propriedade de dados de Service e, em seguida, compare sua representação com o esquema JSON de services do CycloneDX 1.6 vinculado na issue. Confirme como source e destination devem aparecer e considere o trabalho concluído quando os dados de Service derem suporte aos campos obrigatórios do esquema e a serialização resultante corresponder a ele.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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!
- Linguagem predominante
- Python
- Estrelas
- 117
- Forks
- 67
- Merge médio
- 8min
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de CycloneDX/cyclonedx-python-lib
-
[PERF] Quadratic (O(N^2)) serialization time for large BOMs — `Bom.validate()` → `register_dependency()` linear scanTalvez já em andamento @inspired-geek assumiu há 118 dias. Abertaperformance
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 36/100
CycloneDX/cyclonedx-python-lib#1006 · 2 comentários ·
-
tests: test all model enumsTalvez livre de novo @jkowalleck assumiu há 133 dias e não há nenhum pull request aberto. AbertaQA
CycloneDX/cyclonedx-python-lib#991 · 1 responsável ·
-
feat(deps)!: make all de/serialization libraries optionalTalvez livre de novo @Simoh23999 assumiu há 81 dias e não há nenhum pull request aberto. Abertabreaking change dependencies
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
CycloneDX/cyclonedx-python-lib#979 · 2 comentários ·
-
feat: Add support for Component signatureTalvez já em andamento @wiebe-vandendriessche assumiu há 132 dias. Abertaenhancement help wanted schema 1.4
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
CycloneDX/cyclonedx-python-lib#978 · 4 comentários ·
-
chore: have coverage uploaded consitentlyTalvez livre de novo @jkowalleck assumiu há 180 dias e não há nenhum pull request aberto. Abertachore
CycloneDX/cyclonedx-python-lib#966 · 1 responsável ·
Todas as issues de CycloneDX/cyclonedx-python-lib
Issues semelhantes
-
`image_generation`: `max_retries` is ignored for OpenAI-compatible providers (always 2 retries)Talvez já em andamento @ericz7900 assumiu hoje. Abertallm translation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
rheeloaded/paperpull#117 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 65/100
agenda-tech-brasil/agenda-tech-brasil#1619 · 1 comentário ·
-
process
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 76/100
pyrite-wiki/pyrite#1036 ·
Mantenedores costumam responder em até 1 dia