otupy.profiles.xbom.data.endpoint.Endpoint

class Endpoint(description=None, endpoint_type=None, transport=None, transfer=None, encoding=None, uri=None, provider=None)

Bases: Record

Describes a network interface used to access remote functions. Its definition tries to capture all the
different elements that are necessary to identify the communication facets of very different network

service architectures (e.g., REST, SOAP).

Note: since most of these fields are descriptive and intended to be used by external software, no specific data types are created from them.

Methods

as_cyclonedx

Convert Endpoint to CycloneDX properties format.

fromdict

Builds instance from dictionary

todict

Converts to dictionary

validate_fields

Attributes

description

This is a human-friendly description to understand the purpose and location of the service

encoding

Serialization or other form of data encoding to transfer high-level messages over the wire (e.g., json, xml, ...)

endpoint_type

The architecture or standard followed by this endpoint definition (e.g., REST, SOAP, WSDL)

provider

Owner of the web service

transfer

The communication protocol used to exchange messages with the endpoint

transport

Transport protocol used to access the endpoint (may be None if a default/mandatory choice is implied by the transfer protocol)

uri

The base URI used to contact the endpoint (it should include at least the IP address/hostname

__init__(description=None, endpoint_type=None, transport=None, transfer=None, encoding=None, uri=None, provider=None)
as_cyclonedx(prefix: str = 'otupy:endpoint') list

Convert Endpoint to CycloneDX properties format.

Args:

prefix: The prefix to use for property names.

Returns:

list: List of CycloneDX Property objects.

description: str = None

This is a human-friendly description to understand the purpose and location of the service

encoding: str = None

Serialization or other form of data encoding to transfer high-level messages over the wire (e.g., json, xml, …)

endpoint_type: str = None

The architecture or standard followed by this endpoint definition (e.g., REST, SOAP, WSDL)

classmethod fromdict(dic, e)

Builds instance from dictionary

It is used during deserialization to create an otupy instance from the text message. It takes an Encoder instance that is used to recursively build instances of the inner objects (the Encoder provides standard methods to create instances of base objects like strings, integers, boolean).

Parameters:
  • dic – The intermediary dictionary representation from which the object is built.

  • e – The Encoder that is being used.

Returns:

An instance of this class initialized from the dictionary values.

provider: str = None

Owner of the web service

todict(e)

Converts to dictionary

It is used to convert this object to an intermediary representation during serialization. It takes an Encoder argument that is used to recursively serialize inner data and structures (the Encoder provides standard methods for converting base types to dictionaries)..

Parameters:

e – The Encoder that is being used.

Returns:

A dictionary compliants to the Language Specification’s serialization rules.

transfer: str = None

The communication protocol used to exchange messages with the endpoint

transport: str = None

Transport protocol used to access the endpoint (may be None if a default/mandatory choice is implied by the transfer protocol)

uri: str = None

The base URI used to contact the endpoint (it should include at least the IP address/hostname