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

[APPSEC-9143] Extract expires information from target map payload. #2797

Closed
wants to merge 1 commit into from

Conversation

GustavoCaso
Copy link
Member

@GustavoCaso GustavoCaso commented Apr 18, 2023

What does this PR do?

Propagate expires information to content instances.
Make sure to remove content information from config_state when content has expired.

Motivation

The config_states information have to change based on expiration information

Additional Notes

How to test the change?

CI

@GustavoCaso GustavoCaso requested a review from a team April 18, 2023 10:36
@github-actions github-actions bot added the core Involves Datadog core libraries label Apr 18, 2023
@GustavoCaso GustavoCaso changed the title Extract expires information from target map payload. [APPSEC-9143] Extract expires information from target map payload. Apr 18, 2023
@GustavoCaso GustavoCaso force-pushed the remote-check-expires-information branch from 64656b2 to da4cbe6 Compare April 18, 2023 10:39
Propagate expires information to content instances.
Make sure to remove content information from `config_state`
when content has expire.
@GustavoCaso GustavoCaso force-pushed the remote-check-expires-information branch from da4cbe6 to 888514d Compare April 18, 2023 10:43
@GustavoCaso GustavoCaso requested a review from lloeki April 18, 2023 10:43
@@ -90,8 +91,12 @@ def initialize(repository)
def contents_to_config_states(contents)
return [] if contents.empty?

contents.map do |content|
{
contents.each_with_object([]) do |content, acc|
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to change it to each_with_object because steep was complaining about using map and next


map = new

map.instance_eval do
@opaque_backend_state = opaque_backend_state
@version = version
@expires = DateTime.iso8601(expires) if expires
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that according to the Ruby documentation:

DateTime class is considered deprecated. Use Time class.

😅

@ivoanjo
Copy link
Member

ivoanjo commented Mar 27, 2024

Is this PR still relevant?

@GustavoCaso GustavoCaso closed this Apr 1, 2024
@GustavoCaso GustavoCaso deleted the remote-check-expires-information branch April 1, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants