-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Single-Lock Access for Legal Deposit Restrictions #6
Comments
support single-use session lock per url/ts (#6): - add redis based session locking - embedded resources -- any modifier other than mp_ and ajax requests skipped - keys used: * lock:{coll}/{ts}/{url} for each locked url pointing to the sesh_id * sesh:{sesh_id} for each session, containing list of locked urls - cookie only saved when lock is added, refreshed if new session key - sessions expire at end of day (rounded up to next day) - full tests for session limiting and expiration Docker: add Dockerfile for launching with UKWApp extensions, add .coveragerc and .dockerignore files
A preliminary version is now part of the integration test. A 403 Not Allowed message should be shown if a page is locked.
Using Redis instead so locks can persist across pywb restarts and support multiple instances. |
- support extending with custom rewriterapp by setting REWRITER_APP_CLASS - correctly default to 'config.yaml' if no config file specified
… for ukwa/ukwa-pywb#6) - 'ba_' - for <base> rewriting - 'je_' - 'javascript-embed' default for client-side rewriting in wombat better modifiers for css rewriting (server and client): - 'ce_' - 'css-embed' for any url() embeds in CSS - 'cs_' - for css stylesheet @import rewriting/other .css
- `/_locks` shows locks.html template listing all sessions and locks - `/_locks/clear` - clears locks for current session, if any - `/_locks/clear/<id>` - clears all locks for urls locked by session <id> - `/_locks/clear_url/<url>` - clears lock for <url>
Added to integration deployment. |
I added a few additional notes to this ticket. Ideally, it would be good to have some kind of automated test running on the integration test docker images, but I'm not quite sure how best to achieve that. |
Okay, I managed to use the Python Robot Framework to set up Selinium tests to check the lock. If it's possible to add a hook to clear all locks, that would make the testing a bit more robust. |
Ah ok, was going to suggest headless chome/ff and selenium.. haven't used robot before, seems like a nice integration. Can add the clear all and update the tests. It's also possible to set the timeout interval via |
- add clear/reset all endpoint /_locks/reset - update tests integration-tests: - set expiry to 30 seconds - increase wait time to ensure time for init - update to check for only one lock being set -- embeds are not locked - update tests to check expiry -- resources become unlocked after 30 seconds
Updated the tests to ensure only one lock created and that it expires. May be good to test with more complex pages as well. |
The detection of embedded resources has also been improved, though not perfect. It's not possible to detect conclusively just on basis of the modifier or url placement, so I think currently system, errs on side of being considered an embedded resource. One alternative/addition to looking at url modifier ( |
…OCKS_USERNAME and LOCKS_PASSWORD env vars are set update unit tests to test basic auth integration test: add /_logout test to test instant clearing of locks
- test locks with multiple browsers - ensure all acid tests pass - improve naming, messaging when sleeping - cleose browsers on startup, hopefully make test rerunnable ratelimitapp: only clamp expire time to N sec boundary if using full day, otherwise expire after N seconds (for easier testing)
Updated integration tests, see #8 Also supports basic auth for all lock admin ops if Additional unit tests can be run via |
single-use-lock (#6) enabled in collections only if 'single-use-lock: true' is set in per-collection config
- support extending with custom rewriterapp by setting REWRITER_APP_CLASS - correctly default to 'config.yaml' if no config file specified
… for ukwa/ukwa-pywb#6) - 'ba_' - for <base> rewriting - 'je_' - 'javascript-embed' default for client-side rewriting in wombat better modifiers for css rewriting (server and client): - 'ce_' - 'css-embed' for any url() embeds in CSS - 'cs_' - for css stylesheet @import rewriting/other .css
Add support in pywb to allow 'single session access' to every top-level page, but not embedded resources.
Current workflow to be supported:
EDIT Some clarifications:
The text was updated successfully, but these errors were encountered: