Commit Graph

18 Commits

Author SHA1 Message Date
Omer Lachish
445f8e5c36
Fix invitation pending for existing users (#3261)
* default `is_invitation_pending` to false and actively set it to true
when inviting users, so that existing users won't show "Invitation
Pending"

* fix tests that broke due to default is_invitation_pending value

* update Flask-OAuthLib
2019-01-09 13:48:47 +02:00
Omer Lachish
823f172a9f
Invitation Pending changes (#3229)
* determine invitation_pending according to empty password. This commit will be reverted, I'm just deferring the implementation

* show '(Invitation Pending)' to users who haven't accepted their invitation yet

* allow resending invitations

* allow deletion of pending users from user list

* set invitation as not pending when following invite link

* prevent deleting activated users

* test that users who follow invitation links are set as non-pending invitations

* prevent re-using invitations

* invitees who use SSO will now also be marked as "non-pending"

* lint
2019-01-08 08:52:48 +02:00
Jannis Leidel
44dff83046 Add "Active at" column to user list. (#3026)
* add last_active_at to users page

* Use our JSON encoder as the SQLAlchemy JSON serializer.

* Fixed some inconsistencies in the user query class methods.

* Minor cosmetic fixes.

* Add some make tasks for easier development.

* Add user detail sync system based on Redis backend.

There is a periodic Celery task that updates a new “details” JSONB column in the “user” table with the data from Redis.

Currently this is only used for tracking the date of last activity of a user but can be extended with other user information later.

Updates a few dependencies.

* Normalize a few Flask extension API names.

* Reduce implementation complexity of JSONEncoder.

* Use request_started signal to make sure we have a request context.

Otherwise loading the user based on the request won’t work.

* Fix test that checks if disabled users can login.

This correctly uses a URL path that includes the current organization and checks for the error message.

The previous test seems to have been a red herring.

* Minor cosmetic fixes.

* Remove needs_sync in favor of just deleting things.

* Misc review fixes.

* Ignore line length.

* Split redash.models import several modules.

* Move walrus UTC DateTimeField into redash.models.types.

* Restore distinctly loading dashboards.

* Simplify default values for user details.

* Define __repr__ methods generically.

* Consistently have underscore methods at the top of model methods.

* Fix tests.

* Split redash.models import several modules.

* Update to latest walrus and redis-py.

* Update kombu to 4.2.2 for redis-py 3.x compatibility.

* Remove redis-cli container after running Make task.

* Move buffer condition after datetime/time conditions.

* Update walrus to 0.7.1.

* Refactor some query APIs.

This uses the flask-sqlalchemy helpers consistently and makes more use of mixins.

* Post rebase fixes.

* Use correct kombu version

* Fix migration down revision
2019-01-07 10:30:42 +02:00
Omer Lachish
2312db46f2 test that other sessions are invalidated when changing an e-mail. I had
to resort to comments in code in order to explain this. I'm a failure
today. 😭
2018-12-11 15:14:43 +02:00
Omer Lachish
b3495b8c00 test that user does not get logged out when changing email or password 2018-12-11 12:25:51 +02:00
Omer Lachish
38ed046c9f Fix disable error message (#3175)
* display correct error message when attempting to disable yourself
* 403 (Forbidden) feels like a better status code than 400 (Bad Request)
* fix broken test
* remove redundant error title
2018-12-10 14:02:50 +02:00
Arik Fraimovich
bd20ce12ac
Don't allow updating user's email to blacklisted domain. (#3127) 2018-11-26 21:22:14 +02:00
Arik Fraimovich
226dd65d53 Update users handlers tests. 2018-08-05 16:14:24 +03:00
Arik Fraimovich
3c7dd064ef Block users with temporary domains 2018-07-25 13:06:26 +03:00
Levko Kravets
ac6d6fc68a getredash/redash#2375 More tests + fix bug 2018-05-28 14:04:08 +03:00
Levko Kravets
2c84a383f3 getredash/redash#2375 Tests 2018-05-28 14:04:08 +03:00
Mike Fiedler
9076715d84
Ensure email is case-insensitive
While RFC 5321 alows for the username/mailbox art of the address to be
case-sensitive, it is hightly discouraged.

    The local-part of a mailbox MUST BE treated as case
    sensitive. Therefore, SMTP implementations MUST take care to
    preserve the case of mailbox local-parts. In particular, for
    some hosts, the user "smith" is different from the user
    "Smith". However, exploiting the case sensitivity of mailbox
    local-parts impedes interoperability and is discouraged.
    Mailbox domains follow normal DNS rules and are hence not
    case sensitive.
    -- https://tools.ietf.org/rfc/rfc5321.txt

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
2017-10-10 17:49:50 -04:00
Arik Fraimovich
9c1450f4c9 Fix users handlers tests 2016-12-07 02:13:20 -06:00
Arik Fraimovich
2bff12b376 Update all tests to use the same test_client 2016-12-07 02:13:20 -06:00
Jeff Widman
c198d22691 Format files to end in a single newline per PEP 8 2016-02-29 12:00:03 -08:00
Arik Fraimovich
f7b57fa580 Feature: new permissions system
This is one huge change for the permissions system and related:

* (Backward incompatible:) Remove the table based permissions in favour of the new model.
* Manage permission to view or query datasources based on groups.
* Add the concept of Organization. It's irrelevant for most deployments, but allows for
  multi-tenant support in re:dash.
* Replace ActivityLog with Event based rows (old data in activity_log table is retained).
* Enforce permissions on the server-side. There were some permissions that were only enforced
  on the client side. This is no more. All permissions are enforced by the server.
* Added new permission: 'super-admin' to access the status and Flask-Admin interface.
* Make sure that html is never cached by the browser - this is to make sure that the browser
  will always ask for the new Javascript/CSS resources (if such are available).
2015-12-31 10:43:33 +02:00
Arik Fraimovich
993a861c78 Users UI. 2015-09-06 10:15:25 +03:00
Arik Fraimovich
a11e100050 Tests for users API 2015-09-06 10:15:25 +03:00