Permalink
Browse files

add example code for using pyramid_ipauth

  • Loading branch information...
1 parent 2a21b0c commit 386a63de527f37e6e86d6405365471545173f101 @rfk rfk committed Oct 20, 2011
Showing with 17 additions and 2 deletions.
  1. +4 −1 demoapp/__init__.py
  2. +6 −0 etc/demoapp-dev.ini
  3. +7 −1 etc/demoapp-prod.ini
View
@@ -23,8 +23,11 @@ def main(global_config, **settings):
config = Configurator(root_factory=Root, settings=settings,
authorization_policy=authz_policy)
- # add auth via repoze.who
+ # adds authorization
+ # option 1: auth via repoze.who
config.include("pyramid_whoauth")
+ # option 2: auth based on IP address
+ #config.include("pyramid_ipauth")
# adds cornice
config.include("cornice")
View
@@ -130,3 +130,9 @@ plugins =
[who:mdproviders]
plugins =
+# ip-based auth config
+[ipauth]
+principals = moz:internal
+proxies = 127.0.0.1 127.0.0.2
+ipaddrs = 124.124.*.*
+
View
@@ -107,7 +107,7 @@ use = repoze.who.plugins.basicauth:make_plugin
realm = 'Sync'
[who:plugin:dummyauth]
-use = cornice.security:DummyAuthenticator
+use = pyramid_whoauth.tests:DummyAuthenticator
[who:general]
request_classifier = repoze.who.classifiers:default_request_classifier
@@ -129,3 +129,9 @@ plugins =
[who:mdproviders]
plugins =
+# ip-based auth config
+[ipauth]
+principals = moz:internal
+proxies = 127.0.0.1 127.0.0.2
+ipaddrs = 124.124.*.*
+

0 comments on commit 386a63d

Please sign in to comment.