Skip to content
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

Google proto timestamps support #510

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Google proto timestamps support #510

wants to merge 1 commit into from

Conversation

guicassolato
Copy link
Collaborator

@guicassolato guicassolato commented Nov 27, 2024

Adds support for selecting values that match google.golang.org/protobuf/types/known/timestamppb.Timestamp type (i.e. { "seconds": Number, "nanos": Number }) from the Authorization JSON. The source values are converted to their corresponding timestamp string representation in RFC3339 format.

Breaking change:

Users that previously trusted on selectors/CEL expressions such as request.time to resolve to { "seconds": Number, "nanos": Number } shall now expect RFC3339 instead.

Users can still dig into the details of a timestamp value in the middle of an expression or for extracting only one of the parts of the timestamp (e.g. request.time.seconds). However, RFC3339 will be used whenever extracting a value known to be a perfect representation of a timestamp in Google's protobuf format, for example, when building dynamic URLs and request parameters for fetching metadata from external sources, when extending properties of identity objects, and dynamic authorization response attributes (e.g. injected HTTP headers, etc) from these values.

Although google.golang.org/protobuf/types/known/timestamppb.Timestamp declares both seconds and nanos as optional. For the conversion to RFC3339 to trigger, at least one of these properties must be present in the source value, and no other property other than these two.

@guicassolato guicassolato self-assigned this Nov 27, 2024
…json - converted to rfc3339

Signed-off-by: Guilherme Cassolato <[email protected]>
@guicassolato guicassolato marked this pull request as ready for review November 28, 2024 12:58
@guicassolato guicassolato requested a review from a team November 28, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

1 participant