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

CredsStore validation for RegistryAuthLocator #1303

Merged
merged 8 commits into from
Mar 18, 2019

Conversation

zhenik
Copy link
Contributor

@zhenik zhenik commented Mar 13, 2019

Fixes

RegistryAuthLocator : Add additional validation for existing key credsStore but empty value

Purpose

Define behaviour for RegistryAuthLocator on empty values in config

Offer:

  • fail on empty value
  • ignore field with empty value & log -> return null;

Background Context

Currently experienced problems using testcontainers, I found existing issue for my problem and decided to help.
Potentially, put checks for all existing keys with empty strings

References

ref: #921

@zhenik
Copy link
Contributor Author

zhenik commented Mar 13, 2019

Could you guys help with what behaviour should be implemented for empty values?

Options:

  • fail on empty value (throw IllegalArgumentException)
  • ignore field with empty value & log -> return null;
  • ignore field with empty value & log -> return defaultValue;

FYI: I explicitly fail test until this behaviour will be defined and implemented

@rnorth
Copy link
Member

rnorth commented Mar 13, 2019

Hi @NikitaZhevnitskiy
Thanks for offering to help!

When the credsStore string is blank, I think the right behaviour would be to return null from the authConfigUsingStore method. This effectively behaves as if the credsStore key is just not present at all.

I'd agree that it's a good idea to log, though - perhaps at WARN level?

Thanks!
Richard

@zhenik zhenik changed the title WIP: credsStore validation for RegistryAuthLocator CredsStore validation for RegistryAuthLocator Mar 14, 2019
Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

Just a couple of trivial comments from me but otherwise this is great, thank you!

Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

Great, thanks @NikitaZhevnitskiy
LGTM - will merge.

@rnorth rnorth merged commit c03a22b into testcontainers:master Mar 18, 2019
@rnorth rnorth added this to the next milestone Mar 18, 2019
@rnorth
Copy link
Member

rnorth commented Mar 22, 2019

Releasing this in 1.11.0 🎉

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.

None yet

2 participants