Skip to content

feat: Change getCacheKey implementation for more unique keys#560

Merged
bshaffer merged 17 commits intomainfrom
remove-oauth-dependency
Jul 10, 2024
Merged

feat: Change getCacheKey implementation for more unique keys#560
bshaffer merged 17 commits intomainfrom
remove-oauth-dependency

Conversation

@Hectorhammett
Copy link
Copy Markdown
Contributor

We made changes to how we calculate the cacheKeys in order to avoid collision for the oncoming support for the Caching update.

closes: #559

@Hectorhammett Hectorhammett force-pushed the remove-oauth-dependency branch 3 times, most recently from 6ccea31 to 126d7ec Compare June 6, 2024 18:33
@Hectorhammett Hectorhammett force-pushed the remove-oauth-dependency branch from 126d7ec to 4317d4f Compare June 6, 2024 18:38
@Hectorhammett Hectorhammett requested a review from bshaffer June 6, 2024 18:40
@Hectorhammett Hectorhammett marked this pull request as ready for review June 6, 2024 18:40
@Hectorhammett Hectorhammett requested a review from a team June 6, 2024 18:40
Copy link
Copy Markdown
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

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

Good job! I think we can improve a few things. Additionally, I'd like to see PHPDoc comments for the getCacheKey method which explains which fields are included in the cache key.

@Hectorhammett Hectorhammett force-pushed the remove-oauth-dependency branch from a0dc04d to 8415d95 Compare June 7, 2024 20:25
@Hectorhammett Hectorhammett requested a review from bshaffer June 7, 2024 20:27
@Hectorhammett Hectorhammett requested a review from bshaffer June 13, 2024 20:41
@bshaffer bshaffer requested a review from westarle June 19, 2024 18:56
@bshaffer
Copy link
Copy Markdown
Contributor

@westarle We are looking to merge this soon, and would love you to take a look!

Copy link
Copy Markdown
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

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

nits and minor suggestions only!

@Hectorhammett Hectorhammett requested a review from bshaffer July 3, 2024 15:10
@Hectorhammett Hectorhammett requested a review from bshaffer July 9, 2024 18:31
@Hectorhammett Hectorhammett requested a review from bshaffer July 10, 2024 14:31
return ($this->imdsv2SessionTokenUrl ?? '') .
'.' . ($this->securityCredentialsUrl ?? '') .
'.' . $this->regionUrl .
'.' . $this->regionalCredVerificationUrl;
Copy link
Copy Markdown
Contributor

@bshaffer bshaffer Jul 10, 2024

Choose a reason for hiding this comment

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

I just had a thought... one way you could get rid of the . without having a separate function is to do something like this:

return implode('.', array_filter([
    $this->imdsv2SessionTokenUrl,
    $this->securityCredentialsUrl,
    $this->regionUrl,
    $this->regionalCredVerificationUrl
]));

But I don't think that's necessary... what we have here looks LGTM to me

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Brent, you a genius, I do like that better haha.

@bshaffer bshaffer merged commit a35c4db into main Jul 10, 2024
@bshaffer bshaffer deleted the remove-oauth-dependency branch July 10, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit Cache Keys to determine if they are unique enough while caching auth tokens

2 participants