Time-based authentication #1

Closed
opened 2024-04-06 00:03:55 +02:00 by alis · 2 comments
Owner

Enable configuration for time-based authorisation, e.g. only allow access during certain times, or expire after a defined time period.

Enable configuration for time-based authorisation, e.g. only allow access during certain times, or expire after a defined time period.
alis added the
enhancement
label 2024-04-06 00:03:55 +02:00
Author
Owner

Implement an optional array of time rules?

[
  { "startTime": "12:34", "endTime": "23:45", "weekdays": "1-4,7", "dates": "1-31", "months": "1-12", "action": "allow" },
  { "startTime": "14:00", "endTime": "15:00, "weekdays": "2", "dates": "1-31", "months": "1-12", "action": "deny" }
]

The ruleset should be applied in totality (rather than first-match), with a deny-first policy (deny overrides allow).

Examples:

  1. Allow weekday during working hours 8am-6pm:
{ "startTime": "08:00", "endTime": "18:00", "weekdays": "1-5", "dates": "1-31", "months": "1-12", "action": "allow" }
  1. Allow weekday evenings from 6-9 and all weekend:
{ "startTime": "18:00", "endTime": "21:00", "weekdays": "1-5", "dates": "1-31", "months": "1-12", "action": "allow" },
{ "startTime": "00:00", "endTime": "23:59", "weekdays": "6-7", "dates": "1-31", "months": "1-12", "action": "allow" }
Implement an optional array of time rules? ``` [ { "startTime": "12:34", "endTime": "23:45", "weekdays": "1-4,7", "dates": "1-31", "months": "1-12", "action": "allow" }, { "startTime": "14:00", "endTime": "15:00, "weekdays": "2", "dates": "1-31", "months": "1-12", "action": "deny" } ] ``` The ruleset should be applied in totality (rather than first-match), with a deny-first policy (deny overrides allow). Examples: 1. Allow weekday during working hours 8am-6pm: ``` { "startTime": "08:00", "endTime": "18:00", "weekdays": "1-5", "dates": "1-31", "months": "1-12", "action": "allow" } ``` 2. Allow weekday evenings from 6-9 and all weekend: ``` { "startTime": "18:00", "endTime": "21:00", "weekdays": "1-5", "dates": "1-31", "months": "1-12", "action": "allow" }, { "startTime": "00:00", "endTime": "23:59", "weekdays": "6-7", "dates": "1-31", "months": "1-12", "action": "allow" } ```
Author
Owner

Commited into main branch and ready for testing.

Still haven't implemented time limits though.

Commited into main branch and ready for testing. Still haven't implemented time limits though.
alis closed this issue 2024-04-12 23:14:49 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alis/Sinatra#1
No description provided.