Skip to content

CredsStore validation for RegistryAuthLocator - #1303

Merged
rnorth merged 8 commits into
testcontainers:masterfrom
zhenik:fix/creds-store-validation
Mar 18, 2019
Merged

rnorth merged 8 commits into
testcontainers:masterfrom
zhenik:fix/creds-store-validation

Conversation

@zhenik

@zhenik zhenik commented Mar 13, 2019

Copy link
Copy Markdown
Contributor

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

zhenik commented Mar 13, 2019 •

Copy link
Copy Markdown
Contributor Author

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

rnorth commented Mar 13, 2019

Copy link
Copy Markdown
Member

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

@rnorth rnorth left a comment

Copy link
Copy Markdown
Member

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!

@rnorth rnorth left a comment

Copy link
Copy Markdown
Member

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

rnorth commented Mar 22, 2019

Copy link
Copy Markdown
Member

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.

2 participants