Skip to content

Commit

Permalink
docs: Deprecate Fraud Score API (#561)
Browse files Browse the repository at this point in the history
* docs: Deprecate NI v2 API

* ci: Bump action versions

* build: Bump versions

* docs: Update changelog

* docs: Add logging info to README

* chore: Bump version to 8.16
  • Loading branch information
SMadani authored Jan 31, 2025
1 parent a8f7e68 commit 8a33be6
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ updates:
interval: 'monthly'
commit-message:
prefix: 'build'
ignore:
- dependency-name: 'jakarta.servlet:jakarta-servlet-api'
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Java
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
with:
distribution: 'corretto'
java-version: ${{ matrix.java }}
Expand All @@ -42,14 +42,14 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Java
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
cache: maven
- name: Test with Maven
run: mvn -e --batch-mode verify -T 1C
- name: Run Codecov
uses: codecov/codecov-action@288befbd1044bd1756afb0bdae077549e0ddb31f
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3
with:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@cbe18979603527f12c7871a6eb04833ecf1548c7
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a
with:
languages: java-kotlin
build-mode: none
Expand All @@ -37,6 +37,6 @@ jobs:
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@cbe18979603527f12c7871a6eb04833ecf1548c7
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a
with:
category: "/language:java-kotlin"
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
ref: ${{ github.event.release.target_commitish }}
- name: Setup Java
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
with:
java-version: 21
distribution: 'temurin'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: Upload artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: SARIF file
path: results.sarif
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

# [8.16.0] - 2025-01-31
- Added logging for requests & responses based on `java.util.logging`
- Improved SMS API documentation
- Deprecated Number Insight v2 / Fraud Score API
- Minor internal refactoring based on code coverage improvements

# [8.15.1] - 2024-12-19
- Removed hardcoded domain validation from `VoiceClient.downloadRecordingRaw`

Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![codecov](https://codecov.io/gh/vonage/vonage-java-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/vonage/vonage-java-sdk)
![SLOC](https://sloc.xyz/github/vonage/vonage-java-sdk/)
[![Snyk](https://snyk.io/test/github/vonage/vonage-java-sdk/badge.svg)](https://snyk.io/test/github/vonage/vonage-java-sdk)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Vonage/vonage-java-sdk/badge)](https://scorecard.dev/viewer/?uri=github.com/Vonage/vonage-kotlin-sdk)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Vonage/vonage-java-sdk/badge)](https://scorecard.dev/viewer/?uri=github.com/Vonage/vonage-java-sdk)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE.txt)
<!---[![Pulse](https://img.shields.io/github/commit-activity/m/vonage/vonage-java-sdk)](https://github.com/vonage/vonage-java-sdk/pulse)-->
Expand Down Expand Up @@ -147,6 +147,28 @@ VonageClient client = VonageClient.builder()
.build();
```

### Logging

The SDK uses [Java's built-in logging library (`java.util.logging`)](https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html) to log requests and responses.
This is primarily centralised in two places: [AbstractMethod](src/main/java/com/vonage/client/AbstractMethod.java)
and [DynamicEndpoint](src/main/java/com/vonage/client/DynamicEndpoint.java).
For most cases, the former should provide sufficient level of detail.
It can be activated by setting the logger level to `FINE`, like so:

```java
LogManager.getLogManager().getLogger("com.vonage.client.AbstractMethod").setLevel(Level.FINE);
```

Since the logger on `DynamicEndpoint` is not static and based on the class name, it will only be activated if the
global log level is set to `FINE`. You can set the global log level like so:

```java
LogManager.getLogManager().getLogger("").setLevel(Level.FINE);
```

This will also activate the logger on `AbstractMethod` if you haven't already specified the desired log level on
that class, so you don't need to set it separately.

## Frequently Asked Questions

**Q: What happened to [`com.vonage:client`](https://search.maven.org/artifact/com.vonage/client)?**
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.vonage</groupId>
<artifactId>server-sdk</artifactId>
<version>8.15.1</version>
<version>8.16.0</version>

<name>Vonage Java Server SDK</name>
<description>Java client for Vonage APIs</description>
Expand Down Expand Up @@ -93,13 +93,13 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>4.0.4</version>
<version>6.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.17.2</version>
<version>1.18.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/vonage/client/HttpWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
public class HttpWrapper {
private static final String
CLIENT_NAME = "vonage-java-sdk",
CLIENT_VERSION = "8.15.1",
CLIENT_VERSION = "8.16.0",
JAVA_VERSION = System.getProperty("java.version"),
USER_AGENT = String.format("%s/%s java/%s", CLIENT_NAME, CLIENT_VERSION, JAVA_VERSION);

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/vonage/client/VonageClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ public VideoClient getVideoClient() {
*
* @return The {@linkplain NumberInsight2Client}.
* @since 8.2.0
* @deprecated This API is deprecated and will be removed in the next major release.
*/
@Deprecated
public NumberInsight2Client getNumberInsight2Client() {
return numberInsight2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
/**
* A client for talking to the Vonage NumberInsight2Client API. The standard way to obtain an instance of this class is to use
* {@link VonageClient#getNumberInsight2Client()}.
*
* @deprecated This API is deprecated and will be removed in the next major release.
*/
@Deprecated
public class NumberInsight2Client {
final RestEndpoint<FraudCheckRequest, FraudCheckResponse> fraudCheck;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@
* Number Insight v2 API</a>.
*
* @since 8.2.0
*
* @deprecated This API is deprecated and will be removed in the next major release.
*/
package com.vonage.client.numberinsight2;
6 changes: 3 additions & 3 deletions src/test/java/com/vonage/client/auth/RequestSigningTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.junit.jupiter.api.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.ReadListener;
import jakarta.servlet.ServletInputStream;
import jakarta.servlet.http.HttpServletRequest;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.LinkedHashMap;
Expand Down

0 comments on commit 8a33be6

Please sign in to comment.