Skip to content

Commit

Permalink
changes in naming
Browse files Browse the repository at this point in the history
  • Loading branch information
WaciX committed Sep 24, 2023
1 parent 4cc75d9 commit 272d870
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class PasswordlessJavaSdkExample implements Closeable {

public PasswordlessClientExample() {
PasswordlessOptions options = PasswordlessOptions.builder()
.apiPrivateKey("your_api_secret")
.apiSecret("your_api_secret")
.build();

client = PasswordlessClientBuilder.create(options)
Expand Down Expand Up @@ -128,7 +128,7 @@ public class PasswordlessJavaSdkExample {

### Customization

Customize `PasswordlessOptions` by providing `apiPrivateKey` with your Application's Private API Key.
Customize `PasswordlessOptions` by providing `apiSecret` with your Application's Private API Key.
You can also change the `apiUrl` if you prefer to self-host.

Customize `PasswordlessClientBuilder` by providing `httpClient` [CloseableHttpClient][apache-http-client] instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* <pre>
* {@code
* PasswordlessOptions passwordlessOptions = PasswordlessOptions.builder()
* .apiPrivateKey("...")
* .apiSecret("...")
* .build();
* PasswordlessClient passwordlessClient = PasswordlessClientBuilder.create(passwordlessOptions)
* .build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private ClassicHttpRequest createRequest(ClassicRequestBuilder requestBuilder, S
}

requestBuilder.setUri(uri);
requestBuilder.addHeader(new LogMaskingHeader("ApiSecret", passwordlessOptions.getApiPrivateKey()));
requestBuilder.addHeader(new LogMaskingHeader("ApiSecret", passwordlessOptions.getApiSecret()));

if (payload != null) {
byte[] requestBody = objectMapper.writeValueAsBytes(payload);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class PasswordlessOptions {
String apiUrl = "https://v4.passwordless.dev";

/**
* Secret API key used to authenticate with the Passwordless API.
* Secret key used to authenticate with the Passwordless API.
*/
@NonNull
final String apiPrivateKey;
final String apiSecret;
}
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ private void validateRequest(ClassicHttpRequest request, String method, String p
assertThat(request.getHeaders()).hasSize(1);
assertThat(request.getHeader("ApiSecret")).isNotNull()
.extracting(Header::getValue)
.isEqualTo(passwordlessOptions.getApiPrivateKey());
.isEqualTo(passwordlessOptions.getApiSecret());
if (payloadJson != null) {
assertThat(request.getEntity()).isNotNull();
assertThat(EntityUtils.toString(request.getEntity())).isEqualTo(payloadJson);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class DataFactory {
public PasswordlessOptions passwordlessOptions(String url) {
return PasswordlessOptions.builder()
.apiUrl(url)
.apiPrivateKey("javaapp:secret:34286d0b2cb24b8687d1639d20eb29fa")
.apiSecret("javaapp:secret:34286d0b2cb24b8687d1639d20eb29fa")
.build();
}

Expand Down

0 comments on commit 272d870

Please sign in to comment.