-
Notifications
You must be signed in to change notification settings - Fork 28
Adds DateTime Extension Support #328
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
Adds DateTime Extension Support #328
Conversation
Signed-off-by: Mudit Chaudhary <[email protected]>
Signed-off-by: Mudit Chaudhary <[email protected]>
Signed-off-by: Mudit Chaudhary <[email protected]>
Signed-off-by: Mudit Chaudhary <[email protected]>
Signed-off-by: Mudit Chaudhary <[email protected]>
/** Convert DateTime to Cedar expr that can be used in a Cedar policy. */ | ||
@Override | ||
public String toCedarExpr() { | ||
return "datetime(\"" + dateTime + "\")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worried about this being valid, but should be fine since dateTime is validated on construction, cannot be mutated externally since it's private and it's set once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It's final
and only assigned after validation so should be ok. This is what we do for IpAddress
as well
Signed-off-by: Mudit Chaudhary <[email protected]>
Signed-off-by: Mudit Chaudhary <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Overview
Adds DateTime Extension Support (RFC 80)
Changes
Implements new
com.cedarpolicy.value.DateTime
classDateTime
value inString
representationIntegrates
DateTime
support in serialization layerValueSerializer
to handleDateTime
serializationDateTime
deserialization support inValueDeserializer
Testing
DateTime
validation, serialization, and edge casesDateTime
functionalityUpdates CHANGELOG
Example Usage