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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
lockVersion: 2.0.0
id: 5bbaa3a9-baa0-471b-ba6a-13fd88e8c119
management:
docChecksum: dc20363f8b5b98547871a6b5350a4ccb
docChecksum: 51b03d3086f63341c3159b74c09622a6
docVersion: 1.0.0
speakeasyVersion: 1.759.3
generationVersion: 2.869.25
releaseVersion: 2.16.50
configChecksum: 066a7034b7b7bc20c6765cc55b1bc2e4
speakeasyVersion: 1.760.0
generationVersion: 2.873.1
releaseVersion: 2.16.51
configChecksum: 72edbb0684c2b566c7f1bb663e036a62
repoURL: https://github.com/gr4vy/gr4vy-java.git
installationURL: https://github.com/gr4vy/gr4vy-java
published: true
persistentEdits:
generation_id: 4395450c-fea6-492d-ab66-5f720af31dad
pristine_commit_hash: d490e56868c26e0348ccb0f582a09e6a4b9bf258
pristine_tree_hash: e17af3deefae767b93eca39e156f87854f9b50aa
generation_id: 42781d40-e432-4fdd-87aa-ae0016178f9c
pristine_commit_hash: 9b295150ca6f5a912c049a69d4abce66a2542227
pristine_tree_hash: 71f373df5e4be51d47bc0704a14023d7870970a9
features:
java:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.3
core: 3.55.22
core: 3.55.23
flattening: 2.81.1
globalSecurity: 2.83.2
globalSecurity: 2.83.4
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
globalServerURLs: 2.83.1
Expand Down Expand Up @@ -2382,8 +2382,8 @@ trackedFiles:
pristine_git_object: 15c4e4642f204ccb312d8814155b69e153b4e19b
gradle.properties:
id: 2afbb999f001
last_write_checksum: sha1:f9294b05290d70d1a54f6d4b48954e5823ab9cc3
pristine_git_object: 2814d83898c72053f48cfac224c53290e0a3f550
last_write_checksum: sha1:d3a5dd308aeb3f4ebd95ab464a01aa68970c62b4
pristine_git_object: ad977a4324cf23529851cfbdbd4b97f6d37c57e2
gradle/wrapper/gradle-wrapper.jar:
id: ec27dae6e852
last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611
Expand Down Expand Up @@ -2706,8 +2706,8 @@ trackedFiles:
pristine_git_object: 502a7312d3dc82c102dbaf7ed5e952d0c793e26f
src/main/java/com/gr4vy/sdk/SDKConfiguration.java:
id: 73a7edeaca45
last_write_checksum: sha1:9209ca39fd069c85fbaabf4836761e5cfe10c5e2
pristine_git_object: 3ef4161e28592807a7496cc9a1eb0e1348265f25
last_write_checksum: sha1:a8a995a72d6a44785a1d2b336798c17f5bc70d4f
pristine_git_object: fbd34cb3cb4dbc5f6e967cd5acb1ee59a844aa4b
src/main/java/com/gr4vy/sdk/SecuritySource.java:
id: 1b6add6b9b50
last_write_checksum: sha1:2f365cc823c6243188e83f4df618c9737fcee8bd
Expand Down Expand Up @@ -6798,12 +6798,12 @@ trackedFiles:
pristine_git_object: 949a4a31c6ae97ff73623b1200001ea60fb219b2
src/main/java/com/gr4vy/sdk/utils/Security.java:
id: 8f93474a370e
last_write_checksum: sha1:3cb0c57c59bf6fbfa337a14defa91234e0311a77
pristine_git_object: a20fca31d1e204e0cf780445d4d265455ea71f41
last_write_checksum: sha1:5aa8a43fbc374f9947dd4194b1b4aa09c74b380f
pristine_git_object: 8ae265ad86296538f92cce56028da9a3994beb7e
src/main/java/com/gr4vy/sdk/utils/SecurityMetadata.java:
id: 23577fb2f4b9
last_write_checksum: sha1:02f5a9ebde25eb03d947711d81d580766f146295
pristine_git_object: 9132374065fc5a324a22efbb5c726ff055bed15f
last_write_checksum: sha1:8d04940c05091c7d707d4f78ebce9467d9fd1f8b
pristine_git_object: ba37fc547488aac6e1b73811c20a9521c6d6ed29
src/main/java/com/gr4vy/sdk/utils/SerializedBody.java:
id: 89853ad52436
last_write_checksum: sha1:d80e55e06c669faf81edc0f133388dd690772f6e
Expand Down Expand Up @@ -6846,8 +6846,8 @@ trackedFiles:
pristine_git_object: 1381df61cea0f4f9c967cfc339dae3505fa15357
src/main/java/com/gr4vy/sdk/utils/Utils.java:
id: 3e329f0c996a
last_write_checksum: sha1:6e4ec81d73c5c1819eb1bc083e282796db9ff0e7
pristine_git_object: d37522606c0fd19f3a911aa9db8b839e2149e6e4
last_write_checksum: sha1:ea4e330c4740aad89fcbe88e113f97b24fc3343c
pristine_git_object: bcb5e713103030d843ac8d1dce75e3b1b22814f2
src/main/java/com/gr4vy/sdk/utils/pagination/AsyncPaginator.java:
id: 48a0072a494a
last_write_checksum: sha1:a2f016ee27c4f925c52401ce751aedf909e773a1
Expand Down Expand Up @@ -10615,7 +10615,6 @@ examples:
application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"}
examplesVersion: 1.0.2
generatedTests: {}
releaseNotes: "## Java SDK Changes:\n* `gr4vy.transactions.create()`: \n * `request.transactionCreate.connectionOptions` **Changed**\n* `gr4vy.transactions.update()`: \n * `request.transactionUpdate.connectionOptions` **Changed**\n* `gr4vy.paymentLinks.create()`: \n * `request.paymentLinkCreate.connectionOptions` **Changed**\n"
generatedFiles:
- .gitattributes
- USAGE.md
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ generation:
generateNewTests: false
skipResponseBodyAssertions: false
java:
version: 2.16.50
version: 2.16.51
additionalDependencies:
- testImplementation:org.junit.jupiter:junit-jupiter:5.10.0
- implementation:com.auth0:java-jwt:4.5.0
Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.759.3
speakeasyVersion: 1.760.0
sources:
Gr4vy:
sourceNamespace: openapi
Expand All @@ -9,8 +9,8 @@ sources:
- 1.0.0
openapi:
sourceNamespace: openapi
sourceRevisionDigest: sha256:cdd2abb9a296846525779e4433b5719f6f92afa9cdecd9040513e399902866d1
sourceBlobDigest: sha256:85c126d56e378330e849d5eae0d0971bb71461d09b705f2d429aaa5cf33b3d97
sourceRevisionDigest: sha256:81fa0b747f004b99bf676fd74b51f6779dc8ebf808f6b19558bc751240943068
sourceBlobDigest: sha256:04eaddea66ea47506ae3930f7c6650661cfda125f1ed9b85c52a621f82a22c8c
tags:
- latest
- 1.0.0
Expand All @@ -25,10 +25,10 @@ targets:
java:
source: openapi
sourceNamespace: openapi
sourceRevisionDigest: sha256:cdd2abb9a296846525779e4433b5719f6f92afa9cdecd9040513e399902866d1
sourceBlobDigest: sha256:85c126d56e378330e849d5eae0d0971bb71461d09b705f2d429aaa5cf33b3d97
sourceRevisionDigest: sha256:81fa0b747f004b99bf676fd74b51f6779dc8ebf808f6b19558bc751240943068
sourceBlobDigest: sha256:04eaddea66ea47506ae3930f7c6650661cfda125f1ed9b85c52a621f82a22c8c
codeSamplesNamespace: openapi-java-code-samples
codeSamplesRevisionDigest: sha256:f133ebb2dc5c554fc91bad0baa3c7946a5b17ff92b468f180aa60da8badb46e2
codeSamplesRevisionDigest: sha256:053800d6917b17df26cb149dc3ab06fa81760dfd7574c8e7a9b40834bbdab224
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ The samples below show how a published SDK artifact is used:

Gradle:
```groovy
implementation 'com.gr4vy:sdk:2.16.50'
implementation 'com.gr4vy:sdk:2.16.51'
```

Maven:
```xml
<dependency>
<groupId>com.gr4vy</groupId>
<artifactId>sdk</artifactId>
<version>2.16.50</version>
<version>2.16.51</version>
</dependency>
```

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1338,4 +1338,14 @@ Based on:
### Generated
- [java v2.16.50] .
### Releases
- [Maven Central v2.16.50] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.50 - .
- [Maven Central v2.16.50] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.50 - .

## 2026-03-30 16:15:03
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.760.0 (2.873.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v2.16.51] .
### Releases
- [Maven Central v2.16.51] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.51 - .
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
groupId=com.gr4vy
artifactId=sdk
version=2.16.50
version=2.16.51
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g
4 changes: 2 additions & 2 deletions src/main/java/com/gr4vy/sdk/SDKConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class SDKConfiguration {

private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "1.0.0";
public static final String SDK_VERSION = "2.16.50";
public static final String GEN_VERSION = "2.869.25";
public static final String SDK_VERSION = "2.16.51";
public static final String GEN_VERSION = "2.873.1";
private static final String BASE_PACKAGE = "com.gr4vy.sdk";
public static final String USER_AGENT =
String.format("speakeasy-sdk/%s %s %s %s %s",
Expand Down
31 changes: 28 additions & 3 deletions src/main/java/com/gr4vy/sdk/utils/Security.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Deque;
Expand All @@ -23,9 +24,22 @@ private Security() {
// prevent instantiation
}

public static HTTPRequest configureSecurity(HTTPRequest request, Object security) throws Exception {
public static HTTPRequest configureSecurity(HTTPRequest request, Object security, String... allowedFields) throws Exception {
if (security != null) {
Field[] fields = security.getClass().getDeclaredFields();
Field[] fields;
if (allowedFields.length > 0) {
List<Field> ordered = new ArrayList<>();
for (String name : allowedFields) {
try {
ordered.add(security.getClass().getDeclaredField(name));
} catch (NoSuchFieldException e) {
// skip unknown fields
}
}
fields = ordered.toArray(new Field[0]);
} else {
fields = security.getClass().getDeclaredFields();
}

for (Field field : fields) {
field.setAccessible(true);
Expand All @@ -41,13 +55,19 @@ public static HTTPRequest configureSecurity(HTTPRequest request, Object security

if (securityMetadata.option) {
parseSecurityOption(request, value);
if (!securityMetadata.composite) {
return request;
}
} else if (securityMetadata.scheme) {
if ((securityMetadata.subtype != null && securityMetadata.subtype.equals("basic"))
&& Types.getType(value.getClass()) != Types.OBJECT) {
parseSecurityScheme(request, securityMetadata, security);
} else {
parseSecurityScheme(request, securityMetadata, value);
}
if (!securityMetadata.composite) {
return request;
}
}
}
}
Expand All @@ -71,7 +91,12 @@ private static void parseSecurityOption(HTTPRequest request, Object option)
continue;
}

parseSecurityScheme(request, securityMetadata, value);
if (securityMetadata.subtype != null && securityMetadata.subtype.equals("basic")
&& Types.getType(value.getClass()) != Types.OBJECT) {
parseSecurityScheme(request, securityMetadata, option);
} else {
parseSecurityScheme(request, securityMetadata, value);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/gr4vy/sdk/utils/SecurityMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class SecurityMetadata {
String subtype;
boolean option;
boolean scheme;
boolean composite;
String name;

private SecurityMetadata() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/gr4vy/sdk/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ public static <T extends Object> List<QueryParameter> getQueryParams(Class<T> ty
return QueryParameters.parseQueryParams(type, params, globals);
}

public static HTTPRequest configureSecurity(HTTPRequest request, Object security) throws Exception {
return Security.configureSecurity(request, security);
public static HTTPRequest configureSecurity(HTTPRequest request, Object security, String... allowedFields) throws Exception {
return Security.configureSecurity(request, security, allowedFields);
}

private static final String DOLLAR_MARKER = "D9qPtyhOYzkHGu3c";
Expand Down
Loading