-
Notifications
You must be signed in to change notification settings - Fork 69
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
Create working demo #5
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d7d502f
Add docs example and update demo source code
bmwant 134c44a
Fail with debug
bmwant 20a9d5c
Fix tests
bmwant 908848e
Update sql scripts
bmwant 4e63418
Update docs
bmwant a6eeb97
Add checking for the password
bmwant 6707c1a
Update documentation with launch/usage example
bmwant 05aa3a7
Launch flake8 instead of pep8 and pyflakes
bmwant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
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
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,5 @@ | ||
CREATE USER aiohttp_security WITH PASSWORD 'aiohttp_security'; | ||
DROP DATABASE IF EXISTS aiohttp_security; | ||
CREATE DATABASE aiohttp_security; | ||
ALTER DATABASE aiohttp_security OWNER TO aiohttp_security; | ||
GRANT ALL PRIVILEGES ON DATABASE aiohttp_security TO aiohttp_security; |
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,38 @@ | ||
-- create users table | ||
CREATE TABLE IF NOT EXISTS users | ||
( | ||
id integer NOT NULL, | ||
login character varying(256) NOT NULL, | ||
passwd character varying(256) NOT NULL, | ||
is_superuser boolean NOT NULL DEFAULT false, | ||
disabled boolean NOT NULL DEFAULT false, | ||
CONSTRAINT user_pkey PRIMARY KEY (id), | ||
CONSTRAINT user_login_key UNIQUE (login) | ||
); | ||
|
||
-- and permissions for them | ||
CREATE TABLE IF NOT EXISTS permissions | ||
( | ||
id integer NOT NULL, | ||
user_id integer NOT NULL, | ||
perm_name character varying(64) NOT NULL, | ||
CONSTRAINT permission_pkey PRIMARY KEY (id), | ||
CONSTRAINT user_permission_fkey FOREIGN KEY (user_id) | ||
REFERENCES users (id) MATCH SIMPLE | ||
ON UPDATE NO ACTION ON DELETE CASCADE | ||
); | ||
|
||
-- insert some data | ||
INSERT INTO users(id, login, passwd, is_superuser, disabled) | ||
VALUES (1, 'admin', '$5$rounds=535000$2kqN9fxCY6Xt5/pi$tVnh0xX87g/IsnOSuorZG608CZDFbWIWBr58ay6S4pD', TRUE, FALSE); | ||
INSERT INTO users(id, login, passwd, is_superuser, disabled) | ||
VALUES (2, 'moderator', '$5$rounds=535000$2kqN9fxCY6Xt5/pi$tVnh0xX87g/IsnOSuorZG608CZDFbWIWBr58ay6S4pD', FALSE, FALSE); | ||
INSERT INTO users(id, login, passwd, is_superuser, disabled) | ||
VALUES (3, 'user', '$5$rounds=535000$2kqN9fxCY6Xt5/pi$tVnh0xX87g/IsnOSuorZG608CZDFbWIWBr58ay6S4pD', FALSE, FALSE); | ||
|
||
INSERT INTO permissions(id, user_id, perm_name) | ||
VALUES (1, 2, 'protected'); | ||
INSERT INTO permissions(id, user_id, perm_name) | ||
VALUES (2, 2, 'public'); | ||
INSERT INTO permissions(id, user_id, perm_name) | ||
VALUES (3, 3, 'public'); |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I insist that password should be salted.
But I'm ok with storing the salt inside
passwd
field, http://pythonhosted.org/passlib/ is the best way to deal with passwords.BTW where we do password check?