Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pubtools/sign/signers/msgsigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def _construct_headers(
"owner_id": self.creator,
"mtype": sig_type.value,
"source": "metadata",
"expires": self.timeout * self.retries * 1000,
}

@lslebodn lslebodn Jan 26, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, you are not anymore interested in the 1st message when you do retry.
So IMHO self.timeout * 1000 should be enough

The class Message has dedicated properties related to expiration

 property ttl: float

    The time to live of the message measured in seconds. Expired messages may be dropped.
 property expiry_time: float

    The absolute expiry time of the message in seconds using the Unix time_t [IEEE1003] encoding.

Is the current code really equivalent?

@lslebodn lslebodn Jan 27, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFTR Addressed in #62 62

if extra_attrs:
headers.update(extra_attrs)
Expand Down
1 change: 1 addition & 0 deletions tests/test_msg_batch_signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def test_create_msg_batch_message(f_config_msg_batch_signer_ok):
headers={
"service": "pubtools-sign",
"environment": "prod",
"expires": 3000,
"owner_id": "pubtools-sign-test",
"mtype": "batch",
"source": "metadata",
Expand Down
3 changes: 3 additions & 0 deletions tests/test_msg_signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ def test__construct_headers(f_config_msg_signer_ok):
assert ret == {
"service": "pubtools-sign",
"environment": "prod",
"expires": 3000,
"owner_id": "pubtools-sign-test",
"mtype": SignRequestType.CONTAINER,
"source": "metadata",
Expand Down Expand Up @@ -522,6 +523,7 @@ def test_create_msg_message(f_config_msg_signer_ok):
"service": "pubtools-sign",
"environment": "prod",
"owner_id": "pubtools-sign-test",
"expires": 3000,
"mtype": SignRequestType.CONTAINER,
"source": "metadata",
},
Expand All @@ -544,6 +546,7 @@ def test_create_msg_message(f_config_msg_signer_ok):
"service": "pubtools-sign",
"environment": "prod",
"owner_id": "pubtools-sign-test",
"expires": 3000,
"mtype": SignRequestType.CLEARSIGN,
"source": "metadata",
},
Expand Down