Releases: smartcar/java-sdk
v3.0.0
Release Notes
This is a major release consisting of multiple usability improvements and additional features.
We have aimed to streamline the SDK with the Smartcar API interfaces in a way that the objects returned are closer to the API interface documented in API Docs. For ex. vehicle.odometer()
will now return an object that looks like the response in the documentation and additionally the body will contain response headers defined in the documentation as a part of a meta
attribute.
The methods to be used are broadly divided into three namespaces :
AuthClient
- This class is used for all OAuth related operationsSmartcar
- This class is used for all application level operationsVehicle
- This class is used for all vehicle operations/actions.
Features
- Environment variables - The SDK now supports usage of environment variables for client id (
SMARTCAR_CLIENT_ID
), client secret(SMARTCAR_CLIENT_SECRET
) and redirect URL(SMARTCAR_REDIRECT_URL
). These can be used instead of having to pass these as arguments. hashChallenge
- Additional utility method defined inSmartcar
namespace to generate hash challenge for webhooks.verifyPayload
- Additional utility method defined inSmartcar
namespace to verify the payload returned by webhooks.getApiVersion
- Method defined inSmartcar
namespace to return the api version set globally.subscribe
- Additional method defined inVehicle
namespace to subscribe to a webhook.unsubscribe
- Additional method defined inVehicle
namespace to unsubscribe from a webhook.- Default API version to 2.0 - The default version for the APIs is now
2.0
instead of1.0
. This can be overridden globally by using thesetApiVersion
method or by using optional arguments in different methods. Smartcar Data Types
- TheSmartcarResponse
class has be retired in favor of individual data types such asVehicleOdometer
. Instead ofSmartcarResponse<VehicleOdometer>
, useVehicleOdometer
.
Improvements
Following are the improvements made to the interfaces by namespace. For in-depth details of the interface please refer to the documentation of the functions generated here
AuthClient
Builder
- This builds an AuthClient class using the set of parameters required by all of the functions defined in the classgetAuthUrlBuilder
- Takes in scope as required argument and all the other optional arguments required to generate the Smartcar Connect URL as defined in the docsexchangeCode
- Added additional support for optional flags parameter for future usage via theSmartcarAuthOptions
.exchangeRefreshToken
- Added additional support for optional flags parameter for future usage via theSmartcarAuthOptions
.
Smartcar
getVehicles
- Renamed fromgetVehicleIds
and changes in interface.getUser
- Moved and renamed fromVehicle#getUserIds
and changes in interface.getCompatibility
- Moved and renamed fromAuthClient#isCompatible
and changes in interface including addingtestMode
andtestModeCompatibilityLevel
available viaSmartcarCompatibilityRequest
.
Vehicle
Constructor
- Updated to now support a version parameter via theSmartcarVehicleOptions
class. Look at the interface for more details.attributes
- Renamed frominfo
.
SmartcarError
All the errors have been converged to a single SmartcarError
class. This class can now support the error fields returned by v2.0 and v1.0. For detailed breakdown of both the error types, refer to the to the API Reference Errors section.
v2.8.2
2.8.2 (2021-05-04)
Summary
This version and all future versions of the SDK will be signed with a new PGP key (fingerprint 858F 2E14 844B 209E 4401 D5B4 E562 9D96 198D A92C
) instead of the key that was used previously (fingerprint 839A F198 6C46 3495 A262 D873 523F 5DE4 DFCC 55FA
).
Details
Codecov notified its customers on April 15th, 2021 that they "learned that someone had gained unauthorized access to our Bash Uploader script and modified it without our permission." The altered uploader uploaded the contents of env
on the machine that was executing the script to an attacker-controlled IP address.
In our case, this means that the attacker might have obtained access to the private PGP key that we used to sign releases of our Java SDK and Android SDK and the credentials that we used to push release artifacts to Maven Central. We have no reason to believe that the key or credentials were used maliciously*. Nonetheless, we have rotated our credentials, published a revocation certificate for our PGP key, and switched over to a new key to ensure that all future releases continue to be secure and signed by a trusted key.
Links to the new PGP Key
- https://keys.openpgp.org/search?q=E5629D96198DA92C
- https://keyserver.ubuntu.com/pks/lookup?op=vindex&search=0xE5629D96198DA92C
- https://pgp.mit.edu/pks/lookup?op=vindex&search=0xE5629D96198DA92C
Links to the revoked PGP Key
- https://keys.openpgp.org/search?q=523F5DE4DFCC55FA
- https://keyserver.ubuntu.com/pks/lookup?op=vindex&search=0x523f5de4dfcc55fa
- https://pgp.mit.edu/pks/lookup?search=0x523F5DE4DFCC55FA&op=index (edited
*Sonatype's policy prohibits the removal or any other modification of artifacts after they have been released, so we are confident that there is no risk to using older versions of the SDK. Reference: MVNCENTRAL-6691
v2.8.1
2.8.1 (2021-04-24)
This release adds support for v2.0 of Smartcar's API by introducing the smartcar.setApiVersion
method.
We have also introduced a SmartcarExceptionV2
class whose fields match the error fields returned by v2.0 of the API as documented on the API Reference. This class extends the SmartcarException
class to ease the migration process.
For a detailed breakdown of the changes and how to migrate see our API Changelog for v2.0 and our v2.0 Error Guides.
v2.8.0
Travis Generated Tag
v2.7.7
v2.6.3
With this release, the SDK will wrap unexpected errors into SmartcarException
, rather than allowing other internal errors to bubble up to the client.
v2.6.2
Surface the SC-Request-Id HTTP response header on SmartcarException
Smartcar HTTP responses set a header called SC-Request-Id
. Each response from Smartcar’s API has a unique request identifier. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution. See the API Reference for more details.
This release adds the SmartcarException.getRequestId()
method.
Example Usage:
Vehicle vehicle = new Vehicle(vid, accessToken);
try {
vehicle.location();
} catch (SmartcarException e) {
System.out.println(e.getRequestId());
// 9692f6ae-f313-4897-a5a3-6e1869d86d8a
}
BatchResponse batchRes = vehicle.batch(new String[] {"/location"});
try {
batchRes.location();
} catch (SmartcarException e) {
System.out.println(e.getRequestId());
// 9692f6ae-f313-4897-a5a3-6e1869d86d8a
}
Surface the SC-Request-Id HTTP response header on BatchResponse
Smartcar HTTP responses set a header called SC-Request-Id
. Each response from Smartcar’s API has a unique request identifier. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution. See the API Reference for more details.
This release adds the BatchResponse.getRequestId()
method.
Example Usage:
Vehicle vehicle = new Vehicle(vid, accessToken);
BatchResponse batchRes = vehicle.batch(new String[] {"/location"});
System.out.println(batchRes.getRequestId());
// 9692f6ae-f313-4897-a5a3-6e1869d86d8a
SmartcarResponse<VehicleLocation> location = batchRes.location();
System.out.println(location.getRequestId());
// 9692f6ae-f313-4897-a5a3-6e1869d86d8a
Surface the SC-Request-Id HTTP response header on SmartcarResponse
Smartcar HTTP responses set a header called SC-Request-Id
. Each response from Smartcar’s API has a unique request identifier. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution. See the API Reference for more details.
This release adds the SmartcarResponse.getRequestId()
method.
Example Usage:
Vehicle vehicle = new Vehicle(vid, accessToken);
SmartcarResponse<VehicleLocation> location = vehicle.location();
System.out.println(location.getRequestId());
// 6e1a18bb-b20e-4d5d-8dd2-537989988b65