Skip to content

Commit

Permalink
made variable public
Browse files Browse the repository at this point in the history
Signed-off-by: h4l0gen <ks3913688@gmail.com>
  • Loading branch information
h4l0gen committed May 28, 2024
1 parent c26b9e9 commit e63ba54
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: # noqa: SLF001

Check failure on line 493 in tuf/ngclient/_internal/trusted_metadata_set.py

View workflow job for this annotation

GitHub Actions / test / Lint Test

Ruff (RUF100)

tuf/ngclient/_internal/trusted_metadata_set.py:493:71: RUF100 Unused `noqa` directive (unused: `SLF001`)
raise exceptions.RepositoryError(
f"Expected '{SimpleEnvelope._DEFAULT_PAYLOAD_TYPE}', " # noqa: SLF001
f"Expected '{SimpleEnvelope.DEFAULT_PAYLOAD_TYPE}', " # noqa: SLF001

Check failure on line 495 in tuf/ngclient/_internal/trusted_metadata_set.py

View workflow job for this annotation

GitHub Actions / test / Lint Test

Ruff (RUF100)

tuf/ngclient/_internal/trusted_metadata_set.py:495:68: RUF100 Unused `noqa` directive (unused: `SLF001`)
f"got '{envelope.payload_type}'"
)

Expand Down

0 comments on commit e63ba54

Please sign in to comment.