ory / ladon

A SDK for access control policies: authorization for the microservice and IoT age. Inspired by AWS IAM policies. Written for Go.

Home Page:https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=ladon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add startTime and endTime

D3n0Duz opened this issue · comments

Do you want to request a feature or report a bug?
It would be very useful to have a startTime where the authorization is allowed or denied also an endTime.

What is the current behavior?
Currently, I was not able to see these informations.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?
Having a time-lapse where we can do an action on a resource.

Which version of the software is affected?
1.2.0

Would this work via context?

Yes it could work and Warden would then decide if the access is allowed based on the time-lapse context.

What do you think of something like this? 😄

"context": {
    "startTime": "2020-01-02T15:04:05Z07:00",
    "endTime": "2022-01-02T15:04:05Z07:00"
}

Since the context field looks optional in the request, if the user doesn't use it, having the endTime to * inserted in the database and the startTime to the current date could be an option?

Yeah sure, such a context would work! I guess we need a system in place to check before/after of timestamps?

Yes, according to the timestamp we can grant access if it's in the correct range. I also think that a check would be needed at this level.

I guess it would be nice if this could be generalized a bit? I think there are three types of comparison for timestamps: before, after, equal

To do a range, you would have two timestamps, one with "before" and one with "after". Configuration of the context could probably be along the lines of:

          "conditions": {
            "the-date-key": {
                "type": "BeforeTime",
                "options": {
                    "timestamp": "2022-01-02T15:04:05Z07:00"
                }
            }
          }

And then we have different types, BeforeTime, AfterTime, EqualsTime.

What ya think?

It makes sense, good idea for the EqualsTime.
We'll need strong validations in place.

Did we briefly covered the feature?
If so, I am ready to contribute. 😊

So sorry, this slipped my inbox! Contributions welcomed of course :)

I am closing this issue as it has not received any engagement from the community or maintainers in a long time. That does not imply that the issue has no merit. If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • open a new issue with updated details and a plan on resolving the issue.

We are cleaning up issues every now and then, primarily to keep the 4000+ issues in our backlog in check and to prevent maintainer burnout. Burnout in open source maintainership is a widespread and serious issue. It can lead to severe personal and health issues as well as enabling catastrophic attack vectors.

Thank you to anyone who participated in the issue! 🙏✌️