Skip to content

IP filter functionality for making orders - #19

Open
acidjunk wants to merge 3 commits into
masterfrom
ip_filter
Open

IP filter functionality for making orders#19
acidjunk wants to merge 3 commits into
masterfrom
ip_filter

Conversation

@acidjunk

Copy link
Copy Markdown
Owner

No description provided.

@acidjunk acidjunk left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@Georgi2704 some comments and if possible I would like to see a unit test also.

Comment thread server/apis/v1/users.py Outdated
@api.doc("Show all users to staff users.")
class UserResourceList(Resource):
@roles_accepted("admin")
# @roles_accepted("admin")

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

There are a lot of places now without auth...

Comment thread server/utils.py Outdated


def is_ip_allowed(request, shops_IP_whitelist, shop_id):
if (shop_id in shops_IP_whitelist):

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

more pythonesk to use: shops_IP_whitelist.get(shop_id)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i ll do that in the next commits

Comment thread server/apis/v1/orders.py Outdated
save(order)
return order, 201

@api.route('/iptest')

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

cleanup

Comment thread server/apis/v1/orders.py
abort(400, "Your IP is not allowed!")

# 5 gram check
# 5 gram checks

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

why?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

probably clicked backspace

Comment thread server/apis/v1/orders.py Outdated
# "order_info": fields.String(),
"total": fields.Float(required=True, description="Total"),
"customer_order_id": fields.Integer,
"customer_ord er_id": fields.Integer,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

this looks weird

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oops

Comment thread .idea/.gitignore Outdated
@@ -0,0 +1,8 @@
# Default ignored files

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

hmm: I normally list the complete ".idea" folder in my root .gitignore

A nice test of your git skills: remove the .idea folder fromthis branch and add the .idea folder to the root ignore file.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok i will do this

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.

2 participants