certat / do-portal

This project is in maintenance mode and will only receive bug fixes, but no new features. A new version of this software is being developed.
5 stars 5 forks source link

Logout on org page if a handle is gone #83

Closed ghost closed 4 years ago

ghost commented 5 years ago

If a RIPE org handle is not in the database anymore, and you access an organisation having such a handle, you get logged out.

On staging: organisation nr 5086

davewood commented 4 years ago

as a preparation step I added a selenium end2end test to create a mock RIPE handle and add it to a organization.

davewood commented 4 years ago

cannot reproduce. here is what I did

1) prepare organization and link it to a ripe org 2) delete RIPE org do_portal=# delete from fody.organisation_automatic where ripe_org_hdl='ripe_org_dddBHTpfw'; do_portal=# delete from fody.contact_automatic where organisation_automatic_id = 13; do_portal=# delete from fodyorg_x_organization where ripe_org_hdl='ripe_org_dddBHTpfw'; 3) reload page

result: im not logged out, the ripe org is not displayed anymore.

ghost commented 4 years ago

Not reproducible any more on staging in this way. Adding a non-existing ripe handle to an organization (in fodyorg_x_organization) now shows a Bad Gateway error message upon organization page access (organization 5086). Tested on staging.

  File "./app/models.py", line 981, in __init__
    raise AttributeError('no such handle', ripe_org_hdl)
davewood commented 4 years ago

well ... doing random stuff to the DB breaks things, thats no surprise. Is that a real world problem?

How does the update process of the RIPE org table look like?

ghost commented 4 years ago

RIPE Organization handles can disappear

MarkHofstetter commented 4 years ago

if the handle is gone from the database an empty resposnse with status 204 is now returned

BUT we should consinder running a garbage collector after importing the ripe data which deletes the "stale" handles (and maybe inform the user about it)

davewood commented 4 years ago

on login the backend sends the timeout interval.

if the user is idle (currently idleness is detected using these events -> mousemove keydown DOMMouseScroll mousewheel mousedown) for the configured time a logout request is sent.

https://github.com/certat/do-portal/commit/4a49ae07a056593db1e4cb6f99eb9ccf236653c7