Giter Site home page Giter Site logo

ip-address-filtering's Introduction

Build status

IP-Address-Filtering

Lightweight C# ASP.NET MVC and Web API IP address filtering library

The library allows validating IP address against:

  • Single IP address
  • List of multiple IP addresses
  • Single IP address range
  • Multiple IP address ranges

How to use

    public class DataController : ApiController
    {
        [HttpGet]
        [Route("api/data/{recordId}")]
        [IPAddressFilter("94.201.50.212", IPAddressFilteringAction.Restrict)]
        public HttpResponseMessage GetData(int recordId)
        {
            /* Create response logic here */
            return this.Request.CreateResponse<object>(HttpStatusCode.OK, new object());
        }
    }

ip-address-filtering's People

Contributors

bitdeli-chef avatar dejanstojanovic avatar icnocop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ip-address-filtering's Issues

Could not install package 'IPAddressFiltering 2.1.4'.

Hi.

When I try to install the latest nuget package in Visual Studio 2015 Update 3, I get the following error message:

Could not install package 'IPAddressFiltering 2.1.4'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Dynamic IP Address Filtering

Thank you for IPAddressFiltering.

I'd like to be able to dynamically specify an IP address or range of IP addresses.

For example:
[IPAddressFilter(Name="GetData")]

Then the IP addresses and associated restrictions could be read from an external file or a database table by the key "GetData".

In this way, the code doesn't have to be recompiled if an IP address changes for example.

Here is an example: http://stackoverflow.com/questions/473687/restrict-access-to-a-specific-controller-by-ip-address-in-asp-net-mvc-beta

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.