This repository has been archived by the owner on Nov 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from rabbitmq/rabbitmq-server-505
Support topic authorisation
- Loading branch information
Showing
13 changed files
with
169 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# RabbitMQ HTTP Authn/Authz Backend Example | ||
|
||
`rabbitmq_auth_backend_django` is a very minimalistic [Django](https://www.djangoproject.com/) 1.10+ application | ||
that rabbitmq-auth-backend-http can authenticate against. It's really | ||
not designed to be anything other than an example. | ||
|
||
## Running the Example | ||
|
||
Run `start.sh` to launch it after [installing Django](https://docs.djangoproject.com/en/1.10/topics/install/). You may need to | ||
hack `start.sh` if you are not running Debian or Ubuntu. | ||
|
||
The app will use a local SQLite database. It uses the standard | ||
Django authentication database. All users get access to all vhosts and | ||
resources. | ||
|
||
## HTTP Endpoint Examples | ||
|
||
If you're not familiar with Django, urls.py and auth/views.py may be | ||
most illuminating. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 23 additions & 11 deletions
34
examples/rabbitmq_auth_backend_django/rabbitmq_auth_backend_django/urls.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
from django.conf.urls import patterns, include, url | ||
"""rabbitmq_auth_backend_django URL Configuration | ||
# Uncomment the next two lines to enable the admin: | ||
The `urlpatterns` list routes URLs to views. For more information please see: | ||
https://docs.djangoproject.com/en/1.10/topics/http/urls/ | ||
Examples: | ||
Function views | ||
1. Add an import: from my_app import views | ||
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') | ||
Class-based views | ||
1. Add an import: from other_app.views import Home | ||
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') | ||
Including another URLconf | ||
1. Import the include() function: from django.conf.urls import url, include | ||
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) | ||
""" | ||
from django.conf.urls import url | ||
from django.contrib import admin | ||
admin.autodiscover() | ||
import rabbitmq_auth_backend_django.auth.views as views | ||
|
||
urlpatterns = patterns('', | ||
# Example: | ||
(r'^auth/user', 'rabbitmq_auth_backend_django.auth.views.user'), | ||
(r'^auth/vhost', 'rabbitmq_auth_backend_django.auth.views.vhost'), | ||
(r'^auth/resource', 'rabbitmq_auth_backend_django.auth.views.resource'), | ||
(r'^admin/doc/', include('django.contrib.admindocs.urls')), | ||
(r'^admin/', include(admin.site.urls)), | ||
) | ||
urlpatterns = [ | ||
url(r'^auth/user', views.user), | ||
url(r'^auth/vhost', views.vhost), | ||
url(r'^auth/resource', views.resource), | ||
url(r'^auth/topic', views.topic), | ||
url(r'^admin/', admin.site.urls), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
python manage.py syncdb | ||
python manage.py migrate | ||
python manage.py runserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters