1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00

Change session lifetimes to more closely match TTRSS

At least some clients seem to expect the default timeout of one day.
This commit is contained in:
J. King 2018-01-01 12:31:42 -05:00
parent 59fee52074
commit ddf55e0665
4 changed files with 14 additions and 5 deletions

View file

@ -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 - 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 - 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 - 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 - 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 hashes are normally SHA1; The Arsse uses SHA256 hashes
- Article attachments normally have unique IDs; The Arsse always gives attachments an ID of `"0"` - Article attachments normally have unique IDs; The Arsse always gives attachments an ID of `"0"`

View file

@ -32,12 +32,12 @@ class Conf {
public $userPreAuth = false; public $userPreAuth = false;
/** @var integer Desired length of temporary user passwords */ /** @var integer Desired length of temporary user passwords */
public $userTempPasswordLength = 20; 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 */ * @see https://en.wikipedia.org/wiki/ISO_8601#Durations */
public $userSessionTimeout = "PT1H"; public $userSessionTimeout = "PT24H";
/** @var string Maximum lifetime of log-in sessions regardless of activity, as an ISO 8601 duration (default: 24 hours); /** @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 */ * @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) */ /** @var string Class of the background feed update service driver in use (Forking by default) */
public $serviceDriver = Service\Forking\Driver::class; public $serviceDriver = Service\Forking\Driver::class;

View file

@ -11,6 +11,11 @@ use Phake;
trait SeriesCleanup { trait SeriesCleanup {
public function setUpSeries() { public function setUpSeries() {
// set up the configuration
Arsse::$conf->import([
'userSessionTimeout' => "PT1H",
'userSessionLifetime' => "PT24H",
]);
// set up the test data // set up the test data
$nowish = gmdate("Y-m-d H:i:s", strtotime("now - 1 minute")); $nowish = gmdate("Y-m-d H:i:s", strtotime("now - 1 minute"));
$yesterday = gmdate("Y-m-d H:i:s", strtotime("now - 1 day")); $yesterday = gmdate("Y-m-d H:i:s", strtotime("now - 1 day"));

View file

@ -12,6 +12,11 @@ use Phake;
trait SeriesSession { trait SeriesSession {
public function setUpSeries() { public function setUpSeries() {
// set up the configuration
Arsse::$conf->import([
'userSessionTimeout' => "PT1H",
'userSessionLifetime' => "PT24H",
]);
// set up the test data // set up the test data
$past = gmdate("Y-m-d H:i:s", strtotime("now - 1 minute")); $past = gmdate("Y-m-d H:i:s", strtotime("now - 1 minute"));
$future = gmdate("Y-m-d H:i:s", strtotime("now + 1 minute")); $future = gmdate("Y-m-d H:i:s", strtotime("now + 1 minute"));