Skip to content

Commit

Permalink
Merge branch 'release/0.4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
mblomdahl committed Oct 26, 2017
2 parents 46198c6 + 79f4cc1 commit 182c1cd
Show file tree
Hide file tree
Showing 26 changed files with 1,164 additions and 107 deletions.
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ DB Models
Changelog
=========

v. 0.4.5
--------

* Bug fixes (`#75 <https://github.com/libris/xl_auth/issues/75>`_,
`#76 <https://github.com/libris/xl_auth/issues/76>`_)


v. 0.4.4
--------

Expand Down
150 changes: 106 additions & 44 deletions messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xl_auth 0.4.4\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2017-10-25 13:18+0200\n"
"POT-Creation-Date: 2017-10-25 14:02+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -29,7 +29,8 @@ msgstr ""
#: tests/end2end/test_deleting_permission.py:26 tests/end2end/test_editing_collection.py:158
#: tests/end2end/test_editing_permission.py:31 tests/end2end/test_editing_permission.py:66
#: tests/end2end/test_editing_user.py:189 tests/end2end/test_editing_user.py:215
#: xl_auth/templates/collections/home.html:42 xl_auth/templates/permissions/home.html:37
#: xl_auth/templates/clients/home.html:35 xl_auth/templates/collections/home.html:42
#: xl_auth/templates/permissions/home.html:37
msgid "Edit"
msgstr ""

Expand All @@ -42,6 +43,49 @@ msgstr ""
msgid "Successfully deleted permissions for \"%(username)s\" on collection \"%(code)s\"."
msgstr ""

#: tests/end2end/test_editing_client.py:82 tests/end2end/test_editing_client.py:115
#: tests/end2end/test_editing_collection.py:102 tests/end2end/test_registering_collection.py:102
#: xl_auth/client/forms.py:14 xl_auth/collection/forms.py:18 xl_auth/templates/clients/home.html:17
#: xl_auth/templates/users/home.html:18 xl_auth/templates/users/home.html:61
msgid "Name"
msgstr ""

#: tests/end2end/test_editing_client.py:82 tests/end2end/test_editing_client.py:148
#: tests/end2end/test_editing_client.py:215 tests/end2end/test_editing_client.py:248
#: tests/end2end/test_editing_collection.py:102 tests/end2end/test_editing_user.py:146
#: tests/end2end/test_registering_collection.py:79 tests/end2end/test_registering_collection.py:102
#: tests/forms/test_client.py:48 tests/forms/test_client.py:71 tests/forms/test_client.py:94
#: tests/forms/test_client.py:105 tests/forms/test_client.py:141 tests/forms/test_client.py:164
#: tests/forms/test_client.py:187 tests/forms/test_client.py:198 tests/forms/test_collection.py:21
#: tests/forms/test_collection.py:38 tests/forms/test_permission.py:31
#: tests/forms/test_permission.py:39 tests/forms/test_permission.py:47
#: tests/forms/test_permission.py:55
msgid "This field is required."
msgstr ""

#: tests/end2end/test_editing_client.py:115 tests/forms/test_client.py:60
#: tests/forms/test_client.py:153
msgid "Field must be between 3 and 64 characters long."
msgstr ""

#: tests/end2end/test_editing_client.py:148 tests/end2end/test_editing_client.py:181
#: xl_auth/client/forms.py:15 xl_auth/templates/clients/home.html:18
msgid "Description"
msgstr ""

#: tests/end2end/test_editing_client.py:182 tests/forms/test_client.py:83
#: tests/forms/test_client.py:176
msgid "Field must be between 3 and 350 characters long."
msgstr ""

#: tests/end2end/test_editing_client.py:215 xl_auth/client/forms.py:11
msgid "Redirect URIs"
msgstr ""

#: tests/end2end/test_editing_client.py:248 xl_auth/client/forms.py:12
msgid "Default scopes"
msgstr ""

#: tests/end2end/test_editing_collection.py:53 tests/end2end/test_registering_collection.py:52
msgid "category"
msgstr ""
Expand All @@ -63,20 +107,6 @@ msgstr ""
msgid "Code cannot be modified"
msgstr ""

#: tests/end2end/test_editing_collection.py:102 tests/end2end/test_registering_collection.py:102
#: xl_auth/collection/forms.py:18 xl_auth/templates/users/home.html:18
#: xl_auth/templates/users/home.html:61
msgid "Name"
msgstr ""

#: tests/end2end/test_editing_collection.py:102 tests/end2end/test_editing_user.py:146
#: tests/end2end/test_registering_collection.py:79 tests/end2end/test_registering_collection.py:102
#: tests/forms/test_collection.py:21 tests/forms/test_collection.py:38
#: tests/forms/test_permission.py:31 tests/forms/test_permission.py:39
#: tests/forms/test_permission.py:47 tests/forms/test_permission.py:55
msgid "This field is required."
msgstr ""

#: tests/end2end/test_editing_collection.py:124 tests/end2end/test_registering_collection.py:125
#: xl_auth/collection/forms.py:19 xl_auth/templates/collections/home.html:23
#: xl_auth/templates/collections/home.html:68
Expand Down Expand Up @@ -112,19 +142,19 @@ msgstr ""
msgid "Users"
msgstr ""

#: tests/end2end/test_editing_user.py:45 xl_auth/templates/permissions/home.html:30
#: xl_auth/templates/permissions/home.html:31 xl_auth/templates/permissions/home.html:32
#: xl_auth/templates/users/home.html:33 xl_auth/templates/users/home.html:76
#: xl_auth/templates/users/profile.html:58 xl_auth/templates/users/profile.html:61
#: xl_auth/templates/users/profile.html:65
#: tests/end2end/test_editing_user.py:45 xl_auth/templates/clients/home.html:29
#: xl_auth/templates/permissions/home.html:30 xl_auth/templates/permissions/home.html:31
#: xl_auth/templates/permissions/home.html:32 xl_auth/templates/users/home.html:33
#: xl_auth/templates/users/home.html:76 xl_auth/templates/users/profile.html:58
#: xl_auth/templates/users/profile.html:61 xl_auth/templates/users/profile.html:65
msgid "Yes"
msgstr ""

#: tests/end2end/test_editing_user.py:45 xl_auth/templates/permissions/home.html:30
#: xl_auth/templates/permissions/home.html:31 xl_auth/templates/permissions/home.html:32
#: xl_auth/templates/users/home.html:33 xl_auth/templates/users/home.html:76
#: xl_auth/templates/users/profile.html:58 xl_auth/templates/users/profile.html:61
#: xl_auth/templates/users/profile.html:65
#: tests/end2end/test_editing_user.py:45 xl_auth/templates/clients/home.html:31
#: xl_auth/templates/permissions/home.html:30 xl_auth/templates/permissions/home.html:31
#: xl_auth/templates/permissions/home.html:32 xl_auth/templates/users/home.html:33
#: xl_auth/templates/users/home.html:76 xl_auth/templates/users/profile.html:58
#: xl_auth/templates/users/profile.html:61 xl_auth/templates/users/profile.html:65
msgid "No"
msgstr ""

Expand Down Expand Up @@ -171,6 +201,10 @@ msgstr ""
msgid "Unknown username/email"
msgstr ""

#: tests/end2end/test_registering_client.py:31 xl_auth/templates/clients/home.html:11
msgid "New Client"
msgstr ""

#: tests/end2end/test_registering_collection.py:31 tests/end2end/test_registering_collection.py:171
#: xl_auth/templates/collections/home.html:15
msgid "New Collection"
Expand Down Expand Up @@ -205,6 +239,16 @@ msgstr ""
msgid "Email already registered"
msgstr ""

#: tests/forms/test_client.py:25 tests/forms/test_client.py:118 tests/forms/test_collection.py:124
#: tests/forms/test_collection.py:135 tests/forms/test_permission.py:144
#: tests/forms/test_permission.py:174 tests/forms/test_user.py:63 tests/forms/test_user.py:106
#: tests/forms/test_user.py:132 tests/forms/test_user.py:169 xl_auth/client/forms.py:41
#: xl_auth/client/forms.py:68 xl_auth/collection/forms.py:41 xl_auth/collection/forms.py:73
#: xl_auth/permission/forms.py:59 xl_auth/permission/forms.py:100 xl_auth/user/forms.py:44
#: xl_auth/user/forms.py:97 xl_auth/user/forms.py:123 xl_auth/user/forms.py:150
msgid "You do not have sufficient privileges for this operation."
msgstr ""

#: tests/forms/test_collection.py:30
msgid "Field must be between 1 and 5 characters long."
msgstr ""
Expand All @@ -217,15 +261,6 @@ msgstr ""
msgid "Field must be between 2 and 255 characters long."
msgstr ""

#: tests/forms/test_collection.py:124 tests/forms/test_collection.py:135
#: tests/forms/test_permission.py:144 tests/forms/test_permission.py:174 tests/forms/test_user.py:63
#: tests/forms/test_user.py:106 tests/forms/test_user.py:132 tests/forms/test_user.py:169
#: xl_auth/collection/forms.py:41 xl_auth/collection/forms.py:73 xl_auth/permission/forms.py:59
#: xl_auth/permission/forms.py:100 xl_auth/user/forms.py:44 xl_auth/user/forms.py:97
#: xl_auth/user/forms.py:123 xl_auth/user/forms.py:150
msgid "You do not have sufficient privileges for this operation."
msgstr ""

#: tests/forms/test_permission.py:22 xl_auth/permission/forms.py:104 xl_auth/permission/views.py:61
#: xl_auth/permission/views.py:87
#, python-format
Expand Down Expand Up @@ -269,6 +304,20 @@ msgstr ""
msgid "Replaced by %(replaced_by_code)s"
msgstr ""

#: xl_auth/client/forms.py:13 xl_auth/templates/clients/home.html:19
msgid "Confidential"
msgstr ""

#: xl_auth/client/views.py:44
#, python-format
msgid "Client \"%(name)s\" created."
msgstr ""

#: xl_auth/client/views.py:68
#, python-format
msgid "Thank you for updating client details for \"%(id)s\"."
msgstr ""

#: xl_auth/collection/forms.py:19
msgid "Bibliography"
msgstr ""
Expand Down Expand Up @@ -366,16 +415,33 @@ msgstr ""
msgid "Log out"
msgstr ""

#: xl_auth/templates/collections/edit.html:5
msgid "Edit Existing Collection"
#: xl_auth/templates/clients/edit.html:5
msgid "Edit OAuth2 Client"
msgstr ""

#: xl_auth/templates/collections/edit.html:29 xl_auth/templates/permissions/edit.html:35
#: xl_auth/templates/users/administer.html:25 xl_auth/templates/users/change_password.html:21
#: xl_auth/templates/users/edit_details.html:17
#: xl_auth/templates/clients/edit.html:31 xl_auth/templates/collections/edit.html:29
#: xl_auth/templates/permissions/edit.html:35 xl_auth/templates/users/administer.html:25
#: xl_auth/templates/users/change_password.html:21 xl_auth/templates/users/edit_details.html:17
msgid "Save"
msgstr ""

#: xl_auth/templates/clients/home.html:4 xl_auth/templates/clients/home.html:8
msgid "OAuth2 Clients"
msgstr ""

#: xl_auth/templates/clients/home.html:20 xl_auth/templates/users/home.html:20
#: xl_auth/templates/users/home.html:63
msgid "Admin"
msgstr ""

#: xl_auth/templates/clients/register.html:5
msgid "Register New OAuth2 Client"
msgstr ""

#: xl_auth/templates/collections/edit.html:5
msgid "Edit Existing Collection"
msgstr ""

#: xl_auth/templates/collections/home.html:6 xl_auth/templates/collections/home.html:54
#: xl_auth/templates/collections/home.html:88
msgid "Go to"
Expand Down Expand Up @@ -498,10 +564,6 @@ msgstr ""
msgid "Active Users"
msgstr ""

#: xl_auth/templates/users/home.html:20 xl_auth/templates/users/home.html:63
msgid "Admin"
msgstr ""

#: xl_auth/templates/users/home.html:37 xl_auth/templates/users/home.html:80
msgid "Edit Details"
msgstr ""
Expand Down
10 changes: 6 additions & 4 deletions migrations/script.py.mako
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
"""${message}
"""${message}.

Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}

"""
from alembic import op

from __future__ import absolute_import, division, print_function, unicode_literals

import sqlalchemy as sa
from alembic import op
${imports if imports else ""}

# revision identifiers, used by Alembic.
# Revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
Expand Down
38 changes: 38 additions & 0 deletions migrations/versions/bc2c31758e2a_add_oauth2_client_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""Add OAuth2 Client table.
Revision ID: bc2c31758e2a
Revises: b09534921ab0
Create Date: 2017-10-26 14:57:37.549116
"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = 'bc2c31758e2a'
down_revision = 'b09534921ab0'
branch_labels = None
depends_on = None


def upgrade():
"""Add OAuth2 Client table."""
op.create_table('clients',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('client_id', sa.String(length=64), nullable=False),
sa.Column('client_secret', sa.String(length=256), nullable=False),
sa.Column('created_by', sa.Integer(), nullable=False),
sa.Column('is_confidential', sa.Boolean(), nullable=False),
sa.Column('redirect_uris', sa.Text(), nullable=False),
sa.Column('default_scopes', sa.Text(), nullable=False),
sa.Column('name', sa.String(length=64), nullable=True),
sa.Column('description', sa.String(length=400), nullable=True),
sa.ForeignKeyConstraint(['created_by'], ['users.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('client_id'),
sa.UniqueConstraint('client_secret'))


def downgrade():
"""Drop OAuth2 Client table."""
op.drop_table('clients')
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Make user password and friends non-nullable.
Revision ID: c9e1cd58c4a7
Revises: bc2c31758e2a
Create Date: 2017-10-26 16:19:22.453941
"""

from __future__ import absolute_import, division, print_function, unicode_literals

import sqlalchemy as sa
from alembic import op

# Revision identifiers, used by Alembic.
revision = 'c9e1cd58c4a7'
down_revision = 'bc2c31758e2a'
branch_labels = None
depends_on = None


def upgrade():
"""Make columns 'active', 'is_admin' and 'password' non-nullable."""
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.alter_column('active', existing_type=sa.BOOLEAN(), nullable=False)
batch_op.alter_column('is_admin', existing_type=sa.BOOLEAN(), nullable=False)
batch_op.alter_column('password', existing_type=sa.BLOB(), nullable=False)


def downgrade():
"""Make things nullable again."""
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.alter_column('password', existing_type=sa.BLOB(), nullable=True)
batch_op.alter_column('is_admin', existing_type=sa.BOOLEAN(), nullable=True)
batch_op.alter_column('active', existing_type=sa.BOOLEAN(), nullable=True)
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xl_auth",
"version": "0.4.4",
"version": "0.4.5",
"author": "National Library of Sweden",
"license": "Apache-2.0",
"description": "OAuth2 authorization for LibrisXL, replacing BibDB counterpart",
Expand Down
12 changes: 11 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from xl_auth.database import db as _db
from xl_auth.settings import TestConfig

from .factories import CollectionFactory, PermissionFactory, SuperUserFactory, UserFactory
from .factories import (ClientFactory, CollectionFactory, PermissionFactory, SuperUserFactory,
UserFactory)


@pytest.yield_fixture(scope='function')
Expand Down Expand Up @@ -81,3 +82,12 @@ def permission(db):
permission = PermissionFactory()
db.session.commit()
return permission


# noinspection PyShadowingNames
@pytest.fixture
def client(db):
"""A client for the tests."""
client = ClientFactory()
db.session.commit()
return client
Loading

0 comments on commit 182c1cd

Please sign in to comment.