Skip to content

Commit

Permalink
Merge pull request #82 from libris/feature/last-login
Browse files Browse the repository at this point in the history
Feature/Last Login
  • Loading branch information
mblomdahl authored Oct 30, 2017
2 parents 79f4cc1 + c2310a3 commit 5e90288
Show file tree
Hide file tree
Showing 17 changed files with 348 additions and 148 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ DB Models
Changelog
=========

v. 0.4.6
--------

* Minor traceability improvements (`#78 <https://github.com/libris/xl_auth/issues/78>`_)


v. 0.4.5
--------

Expand Down
165 changes: 96 additions & 69 deletions messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: xl_auth 0.4.4\n"
"Project-Id-Version: xl_auth 0.4.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2017-10-25 14:02+0200\n"
"POT-Creation-Date: 2017-10-30 14:10+0100\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 @@ -17,6 +17,15 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.5.1\n"

#: tests/end2end/test_deleting_client.py:34 xl_auth/client/views.py:64
#, python-format
msgid "Successfully deleted OAuth2 Client \"%(name)s\"."
msgstr ""

#: tests/end2end/test_deleting_client.py:51
msgid "Clients"
msgstr ""

#: tests/end2end/test_deleting_permission.py:24 tests/end2end/test_deleting_permission.py:51
#: tests/end2end/test_editing_permission.py:29 tests/end2end/test_editing_permission.py:63
#: tests/end2end/test_editing_permission.py:91 tests/end2end/test_editing_user.py:183
Expand All @@ -43,49 +52,6 @@ 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 @@ -107,6 +73,23 @@ msgstr ""
msgid "Code cannot be modified"
msgstr ""

#: 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:63
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_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_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 All @@ -130,7 +113,7 @@ msgstr ""

#: tests/end2end/test_editing_permission.py:75 tests/end2end/test_registering_permission.py:69
#: tests/forms/test_permission.py:64 tests/forms/test_permission.py:77 xl_auth/permission/forms.py:64
#: xl_auth/permission/forms.py:112
#: xl_auth/permission/forms.py:114
#, python-format
msgid "Permissions for user \"%(username)s\" on collection \"%(code)s\" already registered"
msgstr ""
Expand All @@ -144,22 +127,22 @@ msgstr ""

#: 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/permissions/home.html:32 xl_auth/templates/users/home.html:34
#: xl_auth/templates/users/home.html:79 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/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/permissions/home.html:32 xl_auth/templates/users/home.html:34
#: xl_auth/templates/users/home.html:79 xl_auth/templates/users/profile.html:58
#: xl_auth/templates/users/profile.html:61 xl_auth/templates/users/profile.html:65
msgid "No"
msgstr ""

#: tests/end2end/test_editing_user.py:101 tests/end2end/test_editing_user.py:125
#: xl_auth/templates/users/home.html:17 xl_auth/templates/users/home.html:60 xl_auth/user/forms.py:13
#: xl_auth/templates/users/home.html:17 xl_auth/templates/users/home.html:62 xl_auth/user/forms.py:13
msgid "Email"
msgstr ""

Expand All @@ -179,8 +162,8 @@ msgstr ""
msgid "User \"%(username)s\" does not exist"
msgstr ""

#: tests/end2end/test_editing_user.py:190 xl_auth/templates/users/home.html:41
#: xl_auth/templates/users/home.html:84 xl_auth/templates/users/profile.html:17
#: tests/end2end/test_editing_user.py:190 xl_auth/templates/users/home.html:43
#: xl_auth/templates/users/home.html:88 xl_auth/templates/users/profile.html:17
msgid "Change Password"
msgstr ""

Expand All @@ -189,15 +172,15 @@ msgstr ""
msgid "Welcome"
msgstr ""

#: tests/end2end/test_logging_in.py:35 xl_auth/public/views.py:45
#: tests/end2end/test_logging_in.py:59 xl_auth/public/views.py:46
msgid "You are logged out."
msgstr ""

#: tests/end2end/test_logging_in.py:49 tests/forms/test_public.py:45 xl_auth/public/forms.py:37
#: tests/end2end/test_logging_in.py:73 tests/forms/test_public.py:45 xl_auth/public/forms.py:37
msgid "Invalid password"
msgstr ""

#: tests/end2end/test_logging_in.py:64 tests/forms/test_public.py:35 xl_auth/public/forms.py:33
#: tests/end2end/test_logging_in.py:88 tests/forms/test_public.py:35 xl_auth/public/forms.py:33
msgid "Unknown username/email"
msgstr ""

Expand Down Expand Up @@ -242,13 +225,21 @@ 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
#: tests/forms/test_user.py:132 tests/forms/test_user.py:169 xl_auth/client/forms.py:40
#: xl_auth/client/forms.py:67 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_client.py:60 tests/forms/test_client.py:153
msgid "Field must be between 3 and 64 characters long."
msgstr ""

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

#: tests/forms/test_collection.py:30
msgid "Field must be between 1 and 5 characters long."
msgstr ""
Expand Down Expand Up @@ -289,31 +280,43 @@ msgstr ""
msgid "User does not exist"
msgstr ""

#: tests/models/test_collection.py:81 xl_auth/collection/models.py:38
#: tests/models/test_collection.py:99 xl_auth/collection/models.py:40
#, python-format
msgid "Replaces %(replaces_code)s, then replaced by %(replaced_by_code)s"
msgstr ""

#: tests/models/test_collection.py:84 xl_auth/collection/models.py:41
#: tests/models/test_collection.py:102 xl_auth/collection/models.py:43
#, python-format
msgid "Replaces %(replaces_code)s"
msgstr ""

#: tests/models/test_collection.py:87 xl_auth/collection/models.py:43
#: tests/models/test_collection.py:105 xl_auth/collection/models.py:45
#, python-format
msgid "Replaced by %(replaced_by_code)s"
msgstr ""

#: xl_auth/client/forms.py:11
msgid "Redirect URIs"
msgstr ""

#: xl_auth/client/forms.py:12
msgid "Default scopes"
msgstr ""

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

#: xl_auth/client/forms.py:15 xl_auth/templates/clients/home.html:18
msgid "Description"
msgstr ""

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

#: xl_auth/client/views.py:68
#: xl_auth/client/views.py:85
#, python-format
msgid "Thank you for updating client details for \"%(id)s\"."
msgstr ""
Expand Down Expand Up @@ -407,7 +410,7 @@ msgid "xl_auth"
msgstr ""

#: xl_auth/templates/collections/home.html:4 xl_auth/templates/nav.html:25
#: xl_auth/templates/users/home.html:19 xl_auth/templates/users/home.html:62
#: xl_auth/templates/users/home.html:19 xl_auth/templates/users/home.html:64
msgid "Collections"
msgstr ""

Expand All @@ -419,7 +422,19 @@ msgstr ""
msgid "Edit OAuth2 Client"
msgstr ""

#: xl_auth/templates/clients/edit.html:31 xl_auth/templates/collections/edit.html:29
#: xl_auth/templates/clients/edit.html:9
msgid "OAuth2 Client Credentials"
msgstr ""

#: xl_auth/templates/clients/edit.html:12
msgid "Client ID"
msgstr ""

#: xl_auth/templates/clients/edit.html:13
msgid "Client Secret"
msgstr ""

#: xl_auth/templates/clients/edit.html:39 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"
Expand All @@ -430,10 +445,18 @@ 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
#: xl_auth/templates/users/home.html:65
msgid "Admin"
msgstr ""

#: xl_auth/templates/clients/home.html:40
msgid "Delete"
msgstr ""

#: xl_auth/templates/clients/home.html:42
msgid "Delete client"
msgstr ""

#: xl_auth/templates/clients/register.html:5
msgid "Register New OAuth2 Client"
msgstr ""
Expand Down Expand Up @@ -461,8 +484,8 @@ msgid "Friendly Name"
msgstr ""

#: xl_auth/templates/collections/home.html:25 xl_auth/templates/collections/home.html:70
#: xl_auth/templates/permissions/home.html:21 xl_auth/templates/users/home.html:21
#: xl_auth/templates/users/home.html:64
#: xl_auth/templates/permissions/home.html:21 xl_auth/templates/users/home.html:22
#: xl_auth/templates/users/home.html:67
msgid "Created At"
msgstr ""

Expand Down Expand Up @@ -564,11 +587,15 @@ msgstr ""
msgid "Active Users"
msgstr ""

#: xl_auth/templates/users/home.html:37 xl_auth/templates/users/home.html:80
#: xl_auth/templates/users/home.html:21 xl_auth/templates/users/home.html:66
msgid "Last Login At"
msgstr ""

#: xl_auth/templates/users/home.html:39 xl_auth/templates/users/home.html:84
msgid "Edit Details"
msgstr ""

#: xl_auth/templates/users/home.html:55
#: xl_auth/templates/users/home.html:57
msgid "Inactive Users"
msgstr ""

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""Add 'modified_at' and 'last_login_at' fields.
Revision ID: f3e929832ba3
Revises: c9e1cd58c4a7
Create Date: 2017-10-30 13:54:26.596122
"""

from __future__ import absolute_import, division, print_function, unicode_literals

import sqlalchemy as sa
from alembic import op

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


def upgrade():
"""Add 'modified_at' column for Collection/Permission/User, and 'last_login_at' for User."""
with op.batch_alter_table('collections', schema=None) as batch_op:
batch_op.add_column(sa.Column('modified_at', sa.DateTime(), nullable=True))

with op.batch_alter_table('permissions', schema=None) as batch_op:
batch_op.add_column(sa.Column('modified_at', sa.DateTime(), nullable=True))

with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('last_login_at', sa.DateTime(), nullable=True))
batch_op.add_column(sa.Column('modified_at', sa.DateTime(), nullable=True))


def downgrade():
"""Drop 'modified_at' and 'last_login_at' columns."""
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('modified_at')
batch_op.drop_column('last_login_at')

with op.batch_alter_table('permissions', schema=None) as batch_op:
batch_op.drop_column('modified_at')

with op.batch_alter_table('collections', schema=None) as batch_op:
batch_op.drop_column('modified_at')
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.5",
"version": "0.4.6",
"author": "National Library of Sweden",
"license": "Apache-2.0",
"description": "OAuth2 authorization for LibrisXL, replacing BibDB counterpart",
Expand Down
Loading

0 comments on commit 5e90288

Please sign in to comment.