Skip to content

feat: add API to ensure CDN token validity#706

Open
nzentzis wants to merge 2 commits intomainfrom
noahz/add-valid-time
Open

feat: add API to ensure CDN token validity#706
nzentzis wants to merge 2 commits intomainfrom
noahz/add-valid-time

Conversation

@nzentzis
Copy link

This commit adds a new valid_for parameter that allows callers to assert that a CDN token should be valid for a specified time period.


def is_expired(self) -> bool:
return datetime.now(timezone.utc) >= self.expires_at
def is_expired(self, offset: timedelta | int | None = None) -> bool:
Copy link
Member

Choose a reason for hiding this comment

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

I am thinking we may want to add a default value of 1h or smth

Copy link
Author

Choose a reason for hiding this comment

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

That seems reasonable to me (though we'd probably want to add that on get_token rather than is_expired)

Copy link
Author

Choose a reason for hiding this comment

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

Updated

This commit adds a new `valid_for` parameter that allows callers to
assert that a CDN token should be valid for a specified time period.
@nzentzis nzentzis force-pushed the noahz/add-valid-time branch from b8a5655 to 3c484ef Compare January 13, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments