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 IP Restriction Mixin Django View #18

Open
ARYAN-NIKNEZHAD opened this issue Jul 27, 2024 · 0 comments
Open

✨ Add IP Restriction Mixin Django View #18

ARYAN-NIKNEZHAD opened this issue Jul 27, 2024 · 0 comments
Labels
demand request a new feature

Comments

@ARYAN-NIKNEZHAD
Copy link
Contributor

Description

We need to implement a mixin that restricts access to Django views based on client IP addresses. This mixin will help in adding an additional layer of security by allowing or denying access to specific IP addresses.

Requirements

  1. Mixin Functionality:

    • Create a mixin class IPRestrictionMixin that can be used with Django views.
    • Allow specifying allowed and denied IP addresses as class attributes.
    • Implement methods to check the client’s IP address against the allowed and denied lists.
    • Provide clear error messages when access is denied.
  2. Integration:

    • Ensure compatibility with existing authentication and permission systems.

Acceptance Criteria

  • The mixin should be easy to use and integrate with existing Django views.
  • It should support both allow-lists (IP addresses that are permitted) and deny-lists (IP addresses that are blocked).
  • Access should be restricted based on the client’s IP address.
@sepehr-akbarzadeh sepehr-akbarzadeh added the demand request a new feature label Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
demand request a new feature
Projects
None yet
Development

No branches or pull requests

2 participants