forked from Scifabric/pybossa
-
Notifications
You must be signed in to change notification settings - Fork 0
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 Scifabric#1301 from PyBossa/add-external-user-id
New migration to support external User IDs.
- Loading branch information
Showing
23 changed files
with
881 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Add user external ID | ||
Revision ID: 8ce9b3da799e | ||
Revises: 4f12d8650050 | ||
Create Date: 2016-07-27 12:12:46.392252 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '8ce9b3da799e' | ||
down_revision = '4f12d8650050' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
field = 'external_uid' | ||
|
||
|
||
def upgrade(): | ||
op.add_column('task_run', sa.Column(field, sa.String)) | ||
op.add_column('project', sa.Column('secret_key', sa.String)) | ||
query = 'update project set secret_key=md5(random()::text);' | ||
op.execute(query) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column('task_run', field) | ||
op.drop_column('project', 'secret_key') |
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,22 @@ | ||
================ | ||
Changelog v2.3.0 | ||
================ | ||
|
||
|
||
This new version adds a few cool features to PYBOSSA. Basically, it allows to use | ||
PYBOSSA backend as your crowdsourcing engine for native iOS and Android phone apps. | ||
|
||
The idea is that those apps, usually have their own user base, with their own IDs. | ||
|
||
As a result, you don't want to force your user base to register again in another | ||
service just to help you with your crowdsourcing research. Therefore, PYBOSSA comes | ||
to the rescue allowing you to login those users in a PYBOSSA project using a secure | ||
token (JWT). | ||
|
||
The process is really simple, you create a PYBOSSA project, you copy the secret key | ||
created by PYBOSSA for your project and you use it to authenticate your requests. Then | ||
when a user sends a Task Run you pass your authentication token and your internal user | ||
ID. As simple as that. PYBOSSA will handle everything as usual. | ||
|
||
* Add support for external User IDs. | ||
* Add JWT authentication for projects. |
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,37 @@ | ||
# -*- coding: utf8 -*- | ||
# This file is part of PyBossa. | ||
# | ||
# Copyright (C) 2016 SciFabric LTD. | ||
# | ||
# PyBossa is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# PyBossa is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with PyBossa. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
INVALID_HEADER_MISSING = {'code': 'invalid_header', | ||
'description': 'Missing Authorization header'} | ||
|
||
INVALID_HEADER_BEARER = {'code': 'invalid_header', | ||
'description': 'Authorization header \ | ||
must start with Bearer'} | ||
|
||
INVALID_HEADER_TOKEN = {'code': 'invalid_header', | ||
'description': 'Token not found'} | ||
|
||
INVALID_HEADER_BEARER_TOKEN = {'code': 'invalid_header', | ||
'description': 'Authorization header must \ | ||
be Bearer + \\s + token'} | ||
|
||
WRONG_PROJECT_SIGNATURE = {'code': 'Wrong project', | ||
'description': 'Signature verification failed'} | ||
|
||
DECODE_ERROR_SIGNATURE = {'code': 'Decode error', | ||
'description': 'Signature verification failed'} |
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
Oops, something went wrong.