From ddf55e0665358b08d1b7919492f1c1cda7bfe90d Mon Sep 17 00:00:00 2001 From: "J. King" Date: Mon, 1 Jan 2018 12:31:42 -0500 Subject: [PATCH] Change session lifetimes to more closely match TTRSS At least some clients seem to expect the default timeout of one day. --- README.md | 1 - lib/Conf.php | 8 ++++---- tests/lib/Database/SeriesCleanup.php | 5 +++++ tests/lib/Database/SeriesSession.php | 5 +++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 77addd6..ca5f924 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,6 @@ We are not aware of any other extensions to the TTRSS protocol. If you know of a - Input that cannot be parsed as JSON normally returns a `NOT_LOGGED_IN` error; The Arsse returns a non-standard `MALFORMED_INPUT` error instead - Feed, category, and label names are normally unrestricted; The Arsse rejects empty strings, as well as strings composed solely of whitespace - Discovering multiple feeds during `subscribeToFeed` processing normally produces an error; The Arsse instead chooses the first feed it finds -- Log-in session lifetime is intentionally shorter in The Arsse - Providing the `setArticleLabel` operation with an invalid label normally silently fails; The Arsse returns an `INVALID_USAGE` error instead - Article hashes are normally SHA1; The Arsse uses SHA256 hashes - Article attachments normally have unique IDs; The Arsse always gives attachments an ID of `"0"` diff --git a/lib/Conf.php b/lib/Conf.php index 6e5903e..0fe1052 100644 --- a/lib/Conf.php +++ b/lib/Conf.php @@ -32,12 +32,12 @@ class Conf { public $userPreAuth = false; /** @var integer Desired length of temporary user passwords */ public $userTempPasswordLength = 20; - /** @var string Period of inactivity after which log-in sessions should be considered invalid, as an ISO 8601 duration (default: 1 hour) + /** @var string Period of inactivity after which log-in sessions should be considered invalid, as an ISO 8601 duration (default: 24 hours) * @see https://en.wikipedia.org/wiki/ISO_8601#Durations */ - public $userSessionTimeout = "PT1H"; - /** @var string Maximum lifetime of log-in sessions regardless of activity, as an ISO 8601 duration (default: 24 hours); + public $userSessionTimeout = "PT24H"; + /** @var string Maximum lifetime of log-in sessions regardless of activity, as an ISO 8601 duration (default: 7 days); * @see https://en.wikipedia.org/wiki/ISO_8601#Durations */ - public $userSessionLifetime = "PT24H"; + public $userSessionLifetime = "P7D"; /** @var string Class of the background feed update service driver in use (Forking by default) */ public $serviceDriver = Service\Forking\Driver::class; diff --git a/tests/lib/Database/SeriesCleanup.php b/tests/lib/Database/SeriesCleanup.php index 759b298..8e7eb83 100644 --- a/tests/lib/Database/SeriesCleanup.php +++ b/tests/lib/Database/SeriesCleanup.php @@ -11,6 +11,11 @@ use Phake; trait SeriesCleanup { public function setUpSeries() { + // set up the configuration + Arsse::$conf->import([ + 'userSessionTimeout' => "PT1H", + 'userSessionLifetime' => "PT24H", + ]); // set up the test data $nowish = gmdate("Y-m-d H:i:s", strtotime("now - 1 minute")); $yesterday = gmdate("Y-m-d H:i:s", strtotime("now - 1 day")); diff --git a/tests/lib/Database/SeriesSession.php b/tests/lib/Database/SeriesSession.php index 2f9c93c..26cf58a 100644 --- a/tests/lib/Database/SeriesSession.php +++ b/tests/lib/Database/SeriesSession.php @@ -12,6 +12,11 @@ use Phake; trait SeriesSession { public function setUpSeries() { + // set up the configuration + Arsse::$conf->import([ + 'userSessionTimeout' => "PT1H", + 'userSessionLifetime' => "PT24H", + ]); // set up the test data $past = gmdate("Y-m-d H:i:s", strtotime("now - 1 minute")); $future = gmdate("Y-m-d H:i:s", strtotime("now + 1 minute"));