Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method for generating signed Smart CDN URLs #33

Merged
merged 10 commits into from
Nov 28, 2024

Conversation

Acconut
Copy link
Member

@Acconut Acconut commented Nov 22, 2024

We recently added support for signed Smart CDN URLs (see https://transloadit.com/docs/topics/signature-authentication/#smart-cdn) and would like our SDKs to offer methods for generating these signed URLs.

This PR adds such a method, alongside documentation and tests.

@Acconut Acconut self-assigned this Nov 22, 2024
params["exp"] = str(int(time.time() * 1000) + expires_in)

# Sort params alphabetically
sorted_params = dict(sorted(params.items()))
Copy link
Member

Choose a reason for hiding this comment

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

Sort algos can work differently across languages, is that a problem?

Copy link
Member Author

Choose a reason for hiding this comment

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

As far as I could research, this behaves the same way our server-side implementations do.

Copy link
Collaborator

@cdr-chakotay cdr-chakotay left a comment

Choose a reason for hiding this comment

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

With the sorting discussion being resolved: LGTM

transloadit/client.py Outdated Show resolved Hide resolved
@Acconut Acconut merged commit 7a5f0dc into main Nov 28, 2024
16 checks passed
@Acconut Acconut deleted the smart-cdn-url-signature branch November 28, 2024 10:20
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.

4 participants