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

Refactor PostPolicy implementation #1023

Merged

Conversation

balamurugana
Copy link
Member

@balamurugana balamurugana commented Nov 19, 2020

No description provided.

@balamurugana balamurugana marked this pull request as draft November 19, 2020 19:04
@balamurugana balamurugana changed the title Refactor post policy implementation Refactor PostPolicy implementation Nov 19, 2020
@balamurugana balamurugana force-pushed the Refactor-PostPolicy-implementation branch 5 times, most recently from 73a21f4 to 98ed2d5 Compare November 24, 2020 16:43
@balamurugana balamurugana marked this pull request as ready for review November 24, 2020 16:44
@balamurugana balamurugana force-pushed the Refactor-PostPolicy-implementation branch 2 times, most recently from 7c4904a to ff58958 Compare November 27, 2020 03:48


def _trim_dollar(value):
"""Trime dollar character if present."""
Copy link
Member

Choose a reason for hiding this comment

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

nit: typo

Suggested change
"""Trime dollar character if present."""
"""Trim dollar character if present."""

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

policy = PostPolicy(
bucket_name, datetime.utcnow() + timedelta(days=no_of_days),
)
policy.add_starts_with_condition("key", prefix)
Copy link
Member

Choose a reason for hiding this comment

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

we should include setting of other Policy attributes like content-length range, content-type, etc to this test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@balamurugana
Copy link
Member Author

I also simplified form-data construction.

@balamurugana balamurugana force-pushed the Refactor-PostPolicy-implementation branch from 89cc226 to edc5751 Compare November 30, 2020 11:05
Copy link
Member

@donatello donatello left a comment

Choose a reason for hiding this comment

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

LGTM

@balamurugana balamurugana merged commit 2b97a6e into minio:master Dec 1, 2020
@balamurugana balamurugana deleted the Refactor-PostPolicy-implementation branch December 1, 2020 02:47
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