Skip to content

Commit

Permalink
Added a null check for credentials during build time. This is a commo…
Browse files Browse the repository at this point in the history
…n mistake when getting these values from env variables for example.
  • Loading branch information
jmigueprieto committed Oct 9, 2024
1 parent e824838 commit feca902
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ public static ApiClientBuilder builder() {
public static class ApiClientBuilder extends Builder<ApiClientBuilder> {

public ApiClientBuilder credentials(String key, String secret) {
if (key == null || secret == null) {
throw new IllegalArgumentException("Key and secret must not be null");
}

this.addHeaderSupplier(new OrkesAuthentication(key, secret));
return this;
}
Expand Down

0 comments on commit feca902

Please sign in to comment.