Skip to content

Commit

Permalink
Merge pull request #2647 from h4l0gen/make_variable_publlic
Browse files Browse the repository at this point in the history
made variable public
  • Loading branch information
jku authored May 30, 2024
2 parents 2f80ad5 + 83974c7 commit ac981a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tuf/api/dsse.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SimpleEnvelope(Generic[T], BaseSimpleEnvelope):
"""

_DEFAULT_PAYLOAD_TYPE = "application/vnd.tuf+json"
DEFAULT_PAYLOAD_TYPE = "application/vnd.tuf+json"

@classmethod
def from_bytes(cls, data: bytes) -> "SimpleEnvelope[T]":
Expand Down Expand Up @@ -119,7 +119,7 @@ def from_signed(cls, signed: T) -> "SimpleEnvelope[T]":
except Exception as e:
raise SerializationError from e

return cls(json_bytes, cls._DEFAULT_PAYLOAD_TYPE, {})
return cls(json_bytes, cls.DEFAULT_PAYLOAD_TYPE, {})

def get_signed(self) -> T:
"""Extract and deserialize payload JSON bytes from envelope.
Expand Down
4 changes: 2 additions & 2 deletions tuf/ngclient/_internal/trusted_metadata_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,9 @@ def _load_from_simple_envelope(

envelope = SimpleEnvelope[T].from_bytes(data)

if envelope.payload_type != SimpleEnvelope._DEFAULT_PAYLOAD_TYPE: # noqa: SLF001
if envelope.payload_type != SimpleEnvelope.DEFAULT_PAYLOAD_TYPE:
raise exceptions.RepositoryError(
f"Expected '{SimpleEnvelope._DEFAULT_PAYLOAD_TYPE}', " # noqa: SLF001
f"Expected '{SimpleEnvelope.DEFAULT_PAYLOAD_TYPE}', "
f"got '{envelope.payload_type}'"
)

Expand Down

0 comments on commit ac981a6

Please sign in to comment.