Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions .github/workflows/publish-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ jobs:
uses: gradle/gradle-build-action@v2

- name: Publish to Sonatype
run: |
./gradlew --parallel --no-daemon publish
run: |-
export -- GPG_SIGNING_KEY_ID
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD"
env:
SONATYPE_USERNAME: ${{ secrets.LITHIC_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.LITHIC_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
GPG_SIGNING_KEY_ID: ${{ secrets.LITHIC_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
GPG_SIGNING_KEY: ${{ secrets.LITHIC_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.LITHIC_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
1 change: 0 additions & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ jobs:
env:
SONATYPE_USERNAME: ${{ secrets.LITHIC_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.LITHIC_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
GPG_SIGNING_KEY_ID: ${{ secrets.LITHIC_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
GPG_SIGNING_KEY: ${{ secrets.LITHIC_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.LITHIC_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.71.0"
".": "0.72.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 151
configured_endpoints: 153
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## 0.72.0 (2024-11-26)

Full Changelog: [v0.71.0...v0.72.0](https://github.com/lithic-com/lithic-java/compare/v0.71.0...v0.72.0)

### Features

* **api:** updates to Auth Rules numeric types, new Card Types and Authorization Rule Backtests ([#400](https://github.com/lithic-com/lithic-java/issues/400)) ([03b0b21](https://github.com/lithic-com/lithic-java/commit/03b0b2120ee6f609f3c4603298100c59f90b8136))
* **client:** add logging when debug env is set ([#396](https://github.com/lithic-com/lithic-java/issues/396)) ([7699d3b](https://github.com/lithic-com/lithic-java/commit/7699d3b5744928055afd3d8e4d40c7c56d7926cf))
* **client:** add methods for header params ([#392](https://github.com/lithic-com/lithic-java/issues/392)) ([2c6e356](https://github.com/lithic-com/lithic-java/commit/2c6e3560a21bf578ca704d19a8628af64681732e))
* derive gpg release key's id via gpg itself ([#402](https://github.com/lithic-com/lithic-java/issues/402)) ([35b7ae5](https://github.com/lithic-com/lithic-java/commit/35b7ae5879764d03c1527f6cf973236f999c6ebe))


### Bug Fixes

* **internal:** use correct example string for test ([#398](https://github.com/lithic-com/lithic-java/issues/398)) ([56a9735](https://github.com/lithic-com/lithic-java/commit/56a97358ecb75bf9c7bc0265b65ede0355509c8a))


### Chores

* **api:** add backtest methods to AuthRules ([#401](https://github.com/lithic-com/lithic-java/issues/401)) ([5ab850e](https://github.com/lithic-com/lithic-java/commit/5ab850e42f48053fe9c418500c87752568b48451))
* **deps:** bump jackson to 2.18.1 ([#391](https://github.com/lithic-com/lithic-java/issues/391)) ([496b520](https://github.com/lithic-com/lithic-java/commit/496b520959f77f66798866a444f64198b97eb848))
* **internal:** update example values ([#399](https://github.com/lithic-com/lithic-java/issues/399)) ([fa0a7d7](https://github.com/lithic-com/lithic-java/commit/fa0a7d79e8da9423c19486f1143082726ea80fa3))
* publish to maven central portal ([#403](https://github.com/lithic-com/lithic-java/issues/403)) ([2fcca5a](https://github.com/lithic-com/lithic-java/commit/2fcca5ae525a9304982fa4ef8daa882d029ee5fa))


### Styles

* **internal:** move identity methods to bottom of error class ([#394](https://github.com/lithic-com/lithic-java/issues/394)) ([5f5d384](https://github.com/lithic-com/lithic-java/commit/5f5d384cf4d00fd68237f71163406c2b9fdb428d))
* **internal:** reduce verbosity of identity methods ([#393](https://github.com/lithic-com/lithic-java/issues/393)) ([54eb3bc](https://github.com/lithic-com/lithic-java/commit/54eb3bc04b57cc0a5f6b83fc8a1d1ec4c6898640))
* **internal:** reorder some params methods and improve consistency of implementations ([#395](https://github.com/lithic-com/lithic-java/issues/395)) ([01f6477](https://github.com/lithic-com/lithic-java/commit/01f64777f999906265478f87145cee97393b87ac))


### Refactors

* **internal:** split `closeWhenPhantomReachable` function ([#389](https://github.com/lithic-com/lithic-java/issues/389)) ([953fe96](https://github.com/lithic-com/lithic-java/commit/953fe9642218c8fa6b7539f122c055a52e06fae8))

## 0.71.0 (2024-11-14)

Full Changelog: [v0.70.0...v0.71.0](https://github.com/lithic-com/lithic-java/compare/v0.70.0...v0.71.0)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.71.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.72.0)

<!-- x-release-please-end -->

Expand All @@ -25,7 +25,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithi
<!-- x-release-please-start-version -->

```kotlin
implementation("com.lithic.api:lithic-java:0.71.0")
implementation("com.lithic.api:lithic-java:0.72.0")
```

#### Maven
Expand All @@ -34,7 +34,7 @@ implementation("com.lithic.api:lithic-java:0.71.0")
<dependency>
<groupId>com.lithic.api</groupId>
<artifactId>lithic-java</artifactId>
<version>0.71.0</version>
<version>0.72.0</version>
</dependency>
```

Expand Down
14 changes: 2 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"

}

allprojects {
group = "com.lithic.api"
version = "0.71.0" // x-release-please-version
version = "0.72.0" // x-release-please-version
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))

username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
}
4 changes: 4 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
plugins {
`kotlin-dsl`
kotlin("jvm") version "1.9.22"
id("com.vanniktech.maven.publish") version "0.28.0"
}

repositories {
gradlePluginPortal()
mavenCentral()
}

dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
14 changes: 4 additions & 10 deletions buildSrc/src/main/kotlin/lithic.java.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import java.util.Locale
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost

plugins {
`java-library`
Expand All @@ -11,11 +14,6 @@ repositories {
mavenCentral()
}

configure<JavaPluginExtension> {
withJavadocJar()
withSourcesJar()
}

configure<SpotlessExtension> {
java {
importOrder()
Expand All @@ -36,10 +34,6 @@ tasks.withType<JavaCompile>().configureEach {
options.release.set(8)
}

tasks.named<Jar>("javadocJar") {
setZip64(true)
}

tasks.named<Jar>("jar") {
manifest {
attributes(mapOf(
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/lithic.kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.vanniktech.maven.publish.*

plugins {
id("lithic.java")
Expand Down
83 changes: 35 additions & 48 deletions buildSrc/src/main/kotlin/lithic.publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,52 @@ import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.get
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost

plugins {
`maven-publish`
`signing`
id("com.vanniktech.maven.publish")
}

configure<PublishingExtension> {
publications {
register<MavenPublication>("maven") {
from(components["java"])
repositories {
gradlePluginPortal()
mavenCentral()
}

pom {
name.set("Lithic Developer API")
description.set("The Lithic Developer API is designed to provide a predictable programmatic\ninterface for accessing your Lithic account through an API and transaction\nwebhooks. Note that your API key is a secret and should be treated as such.\nDon't share it with anyone, including us. We will never ask you for it.")
url.set("https://docs.lithic.com")
extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY")
extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")

licenses {
license {
name.set("Apache-2.0")
}
}
configure<MavenPublishBaseExtension> {
signAllPublications()
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

developers {
developer {
name.set("Lithic")
email.set("sdk-feedback@lithic.com")
}
}
this.coordinates(project.group.toString(), project.name, project.version.toString())

scm {
connection.set("scm:git:git://github.com/lithic-com/lithic-java.git")
developerConnection.set("scm:git:git://github.com/lithic-com/lithic-java.git")
url.set("https://github.com/lithic-com/lithic-java")
}
pom {
name.set("Lithic Developer API")
description.set("The Lithic Developer API is designed to provide a predictable programmatic\ninterface for accessing your Lithic account through an API and transaction\nwebhooks. Note that your API key is a secret and should be treated as such.\nDon't share it with anyone, including us. We will never ask you for it.")
url.set("https://docs.lithic.com")

versionMapping {
allVariants {
fromResolutionResult()
}
}
licenses {
license {
name.set("Apache-2.0")
}
}
}
}

signing {
val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null }
val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null }
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null }
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(
signingKeyId,
signingKey,
signingPassword,
)
sign(publishing.publications["maven"])
}
}
developers {
developer {
name.set("Lithic")
email.set("sdk-feedback@lithic.com")
}
}

tasks.named("publish") {
dependsOn(":closeAndReleaseSonatypeStagingRepository")
scm {
connection.set("scm:git:git://github.com/lithic-com/lithic-java.git")
developerConnection.set("scm:git:git://github.com/lithic-com/lithic-java.git")
url.set("https://github.com/lithic-com/lithic-java")
}
}
}
1 change: 1 addition & 0 deletions lithic-java-client-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
api(project(":lithic-java-core"))

implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")

testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.25.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,38 @@ import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink

class OkHttpClient
private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) :
HttpClient {

private fun getClient(requestOptions: RequestOptions): okhttp3.OkHttpClient {
val timeout = requestOptions.timeout ?: return okHttpClient
return okHttpClient
.newBuilder()
.connectTimeout(timeout)
.readTimeout(timeout)
.writeTimeout(timeout)
.callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
.build()
val clientBuilder = okHttpClient.newBuilder()

val logLevel =
when (System.getenv("LITHIC_LOG")?.lowercase()) {
"info" -> HttpLoggingInterceptor.Level.BASIC
"debug" -> HttpLoggingInterceptor.Level.BODY
else -> null
}
if (logLevel != null) {
clientBuilder.addNetworkInterceptor(
HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") }
)
}

val timeout = requestOptions.timeout
if (timeout != null) {
clientBuilder
.connectTimeout(timeout)
.readTimeout(timeout)
.writeTimeout(timeout)
.callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
}

return clientBuilder.build()
}

override fun execute(
Expand Down
15 changes: 9 additions & 6 deletions lithic-java-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ plugins {
}

dependencies {
api("com.fasterxml.jackson.core:jackson-core:2.14.3")
api("com.fasterxml.jackson.core:jackson-databind:2.14.3")
api("com.fasterxml.jackson.core:jackson-core:2.18.1")
api("com.fasterxml.jackson.core:jackson-databind:2.18.1")

implementation("com.fasterxml.jackson.core:jackson-annotations:2.14.3")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.3")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.3")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.3")
implementation("com.fasterxml.jackson.core:jackson-annotations:2.18.1")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.1")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.1")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.1")
implementation("org.apache.httpcomponents.core5:httpcore5:5.2.4")
implementation("org.apache.httpcomponents.client5:httpclient5:5.3.1")

Expand All @@ -20,4 +20,7 @@ dependencies {
testImplementation("org.assertj:assertj-core:3.25.3")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3")
testImplementation("org.mockito:mockito-core:5.14.2")
testImplementation("org.mockito:mockito-junit-jupiter:5.14.2")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0")
}
Loading