-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add docs example and update demo source code * Fail with debug * Fix tests * Update sql scripts * Update docs * Add checking for the password * Update documentation with launch/usage example * Launch flake8 instead of pep8 and pyflakes
- Loading branch information
Showing
17 changed files
with
413 additions
and
58 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 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.