Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import co.dfns.sdk.allocations.model.*;
import java.util.List;
import co.dfns.sdk.PaginatedList;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

public class AllocationsAsyncClient {
Expand Down Expand Up @@ -37,4 +38,9 @@ public CompletableFuture<Allocation> createAllocationAction(String allocationId,
public CompletableFuture<Allocation> getAllocation(String allocationId) {
return httpClient.getAsync("/allocations/" + allocationId, java.util.Map.of(), Allocation.class);
}

/** Get Allocations Info */
public CompletableFuture<GetAllocationsInfoResponse> getAllocationsInfo() {
return httpClient.getAsync("/allocations/info", java.util.Map.of(), GetAllocationsInfoResponse.class);
}
}
6 changes: 6 additions & 0 deletions src/main/java/co/dfns/sdk/allocations/AllocationsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import co.dfns.sdk.allocations.model.*;
import java.util.List;
import co.dfns.sdk.PaginatedList;
import java.util.Map;

public class AllocationsClient {
private final DfnsHttpClient httpClient;
Expand Down Expand Up @@ -36,4 +37,9 @@ public Allocation createAllocationAction(String allocationId, Object body) {
public Allocation getAllocation(String allocationId) {
return httpClient.get("/allocations/" + allocationId, java.util.Map.of(), Allocation.class);
}

/** Get Allocations Info */
public GetAllocationsInfoResponse getAllocationsInfo() {
return httpClient.get("/allocations/info", java.util.Map.of(), GetAllocationsInfoResponse.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import co.dfns.sdk.allocations.model.*;
import java.util.List;
import co.dfns.sdk.PaginatedList;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import co.dfns.sdk.auth.UserActionChallenge;
import co.dfns.sdk.auth.CredentialAssertion;
Expand Down Expand Up @@ -51,4 +52,9 @@ public CompletableFuture<Allocation> createAllocationActionComplete(String alloc
public CompletableFuture<Allocation> getAllocation(String allocationId) {
return httpClient.getAsync("/allocations/" + allocationId, java.util.Map.of(), Allocation.class);
}

/** Get Allocations Info */
public CompletableFuture<GetAllocationsInfoResponse> getAllocationsInfo() {
return httpClient.getAsync("/allocations/info", java.util.Map.of(), GetAllocationsInfoResponse.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import co.dfns.sdk.allocations.model.*;
import java.util.List;
import co.dfns.sdk.PaginatedList;
import java.util.Map;
import co.dfns.sdk.auth.UserActionChallenge;
import co.dfns.sdk.auth.CredentialAssertion;

Expand Down Expand Up @@ -50,4 +51,9 @@ public Allocation createAllocationActionComplete(String allocationId, Object bod
public Allocation getAllocation(String allocationId) {
return httpClient.get("/allocations/" + allocationId, java.util.Map.of(), Allocation.class);
}

/** Get Allocations Info */
public GetAllocationsInfoResponse getAllocationsInfo() {
return httpClient.get("/allocations/info", java.util.Map.of(), GetAllocationsInfoResponse.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package co.dfns.sdk.allocations.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
public record GetAllocationsInfoResponse(
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("0fns") Map<String, Object> ofns,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("SkySusds") Map<String, Object> skySusds,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("GauntletUsdcPrime") Map<String, Object> gauntletUsdcPrime,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("SteakhouseUsdt") Map<String, Object> steakhouseUsdt,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("GauntletUsdcPrimeBase") Map<String, Object> gauntletUsdcPrimeBase,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("SteakhouseUsdcBase") Map<String, Object> steakhouseUsdcBase,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("SentoraPyusdMain") Map<String, Object> sentoraPyusdMain
) {}
27 changes: 27 additions & 0 deletions src/main/java/co/dfns/sdk/signers/DelegatedSignersAsyncClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ public DelegatedSignersAsyncClient(DfnsHttpClient httpClient) {
this.httpClient = httpClient;
}

/** Delegated signing step 1 for Cancel Fleet Operation: returns the challenge to sign out-of-band. */
public CompletableFuture<UserActionChallenge> cancelFleetOperationInit(String storeId, CancelFleetOperationRequest body) {
return httpClient.createUserActionChallengeAsync("POST", "/key-stores/" + storeId + "/fleet-operations/cancel", body);
}

/** Delegated signing step 2 for Cancel Fleet Operation: submits the signed challenge and issues the request. */
public CompletableFuture<CancelFleetOperationResponse> cancelFleetOperationComplete(String storeId, CancelFleetOperationRequest body, String challengeIdentifier, CredentialAssertion assertion) {
return httpClient.completeUserActionSigningAsync(challengeIdentifier, assertion)
.thenCompose(userAction -> httpClient.executeWithUserActionAsync("POST", "/key-stores/" + storeId + "/fleet-operations/cancel", java.util.Map.of(), body, CancelFleetOperationResponse.class, userAction));
}

/** Delegated signing step 1 for Create Add Mac User Input: returns the challenge to sign out-of-band. */
public CompletableFuture<UserActionChallenge> createAddMacUserInputInit(String storeId, CreateAddMacUserInputRequest body) {
return httpClient.createUserActionChallengeAsync("POST", "/key-stores/" + storeId + "/add-mac-user/input", body);
Expand All @@ -25,6 +36,17 @@ public CompletableFuture<Object> createAddMacUserInputComplete(String storeId, C
.thenCompose(userAction -> httpClient.executeWithUserActionAsync("POST", "/key-stores/" + storeId + "/add-mac-user/input", java.util.Map.of(), body, Object.class, userAction));
}

/** Delegated signing step 1 for Create Add Provisioner Input: returns the challenge to sign out-of-band. */
public CompletableFuture<UserActionChallenge> createAddProvisionerInputInit(String storeId, CreateAddProvisionerInputRequest body) {
return httpClient.createUserActionChallengeAsync("POST", "/key-stores/" + storeId + "/add-provisioner/input", body);
}

/** Delegated signing step 2 for Create Add Provisioner Input: submits the signed challenge and issues the request. */
public CompletableFuture<Object> createAddProvisionerInputComplete(String storeId, CreateAddProvisionerInputRequest body, String challengeIdentifier, CredentialAssertion assertion) {
return httpClient.completeUserActionSigningAsync(challengeIdentifier, assertion)
.thenCompose(userAction -> httpClient.executeWithUserActionAsync("POST", "/key-stores/" + storeId + "/add-provisioner/input", java.util.Map.of(), body, Object.class, userAction));
}

/** Delegated signing step 1 for Create Clone Input: returns the challenge to sign out-of-band. */
public CompletableFuture<UserActionChallenge> createCloneInputInit(String storeId, CreateCloneInputRequest body) {
return httpClient.createUserActionChallengeAsync("POST", "/key-stores/" + storeId + "/clone/input", body);
Expand Down Expand Up @@ -95,6 +117,11 @@ public CompletableFuture<SubmitAddMacUserOutputResponse> submitAddMacUserOutput(
return httpClient.postMultipartAsync("/key-stores/" + storeId + "/add-mac-user/output", java.util.Map.of(), body, file, SubmitAddMacUserOutputResponse.class, true);
}

/** Submit Add Provisioner Output */
public CompletableFuture<SubmitAddProvisionerOutputResponse> submitAddProvisionerOutput(String storeId, SubmitAddProvisionerOutputRequest body, byte[] file) {
return httpClient.postMultipartAsync("/key-stores/" + storeId + "/add-provisioner/output", java.util.Map.of(), body, file, SubmitAddProvisionerOutputResponse.class, true);
}

/** Submit Clone Output */
public CompletableFuture<SubmitCloneOutputResponse> submitCloneOutput(String storeId, SubmitCloneOutputRequest body, byte[] file) {
return httpClient.postMultipartAsync("/key-stores/" + storeId + "/clone/output", java.util.Map.of(), body, file, SubmitCloneOutputResponse.class, true);
Expand Down
27 changes: 27 additions & 0 deletions src/main/java/co/dfns/sdk/signers/DelegatedSignersClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ public DelegatedSignersClient(DfnsHttpClient httpClient) {
this.httpClient = httpClient;
}

/** Delegated signing step 1 for Cancel Fleet Operation: returns the challenge to sign out-of-band. */
public UserActionChallenge cancelFleetOperationInit(String storeId, CancelFleetOperationRequest body) {
return httpClient.createUserActionChallenge("POST", "/key-stores/" + storeId + "/fleet-operations/cancel", body);
}

/** Delegated signing step 2 for Cancel Fleet Operation: submits the signed challenge and issues the request. */
public CancelFleetOperationResponse cancelFleetOperationComplete(String storeId, CancelFleetOperationRequest body, String challengeIdentifier, CredentialAssertion assertion) {
String userAction = httpClient.completeUserActionSigning(challengeIdentifier, assertion);
return httpClient.executeWithUserAction("POST", "/key-stores/" + storeId + "/fleet-operations/cancel", java.util.Map.of(), body, CancelFleetOperationResponse.class, userAction);
}

/** Delegated signing step 1 for Create Add Mac User Input: returns the challenge to sign out-of-band. */
public UserActionChallenge createAddMacUserInputInit(String storeId, CreateAddMacUserInputRequest body) {
return httpClient.createUserActionChallenge("POST", "/key-stores/" + storeId + "/add-mac-user/input", body);
Expand All @@ -24,6 +35,17 @@ public Object createAddMacUserInputComplete(String storeId, CreateAddMacUserInpu
return httpClient.executeWithUserAction("POST", "/key-stores/" + storeId + "/add-mac-user/input", java.util.Map.of(), body, Object.class, userAction);
}

/** Delegated signing step 1 for Create Add Provisioner Input: returns the challenge to sign out-of-band. */
public UserActionChallenge createAddProvisionerInputInit(String storeId, CreateAddProvisionerInputRequest body) {
return httpClient.createUserActionChallenge("POST", "/key-stores/" + storeId + "/add-provisioner/input", body);
}

/** Delegated signing step 2 for Create Add Provisioner Input: submits the signed challenge and issues the request. */
public Object createAddProvisionerInputComplete(String storeId, CreateAddProvisionerInputRequest body, String challengeIdentifier, CredentialAssertion assertion) {
String userAction = httpClient.completeUserActionSigning(challengeIdentifier, assertion);
return httpClient.executeWithUserAction("POST", "/key-stores/" + storeId + "/add-provisioner/input", java.util.Map.of(), body, Object.class, userAction);
}

/** Delegated signing step 1 for Create Clone Input: returns the challenge to sign out-of-band. */
public UserActionChallenge createCloneInputInit(String storeId, CreateCloneInputRequest body) {
return httpClient.createUserActionChallenge("POST", "/key-stores/" + storeId + "/clone/input", body);
Expand Down Expand Up @@ -94,6 +116,11 @@ public SubmitAddMacUserOutputResponse submitAddMacUserOutput(String storeId, Sub
return httpClient.postMultipart("/key-stores/" + storeId + "/add-mac-user/output", java.util.Map.of(), body, file, SubmitAddMacUserOutputResponse.class, true);
}

/** Submit Add Provisioner Output */
public SubmitAddProvisionerOutputResponse submitAddProvisionerOutput(String storeId, SubmitAddProvisionerOutputRequest body, byte[] file) {
return httpClient.postMultipart("/key-stores/" + storeId + "/add-provisioner/output", java.util.Map.of(), body, file, SubmitAddProvisionerOutputResponse.class, true);
}

/** Submit Clone Output */
public SubmitCloneOutputResponse submitCloneOutput(String storeId, SubmitCloneOutputRequest body, byte[] file) {
return httpClient.postMultipart("/key-stores/" + storeId + "/clone/output", java.util.Map.of(), body, file, SubmitCloneOutputResponse.class, true);
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/co/dfns/sdk/signers/SignersAsyncClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@ public SignersAsyncClient(DfnsHttpClient httpClient) {
this.httpClient = httpClient;
}

/** Cancel Fleet Operation */
public CompletableFuture<CancelFleetOperationResponse> cancelFleetOperation(String storeId, CancelFleetOperationRequest body) {
return httpClient.postAsync("/key-stores/" + storeId + "/fleet-operations/cancel", java.util.Map.of(), body, CancelFleetOperationResponse.class, true);
}

/** Create Add Mac User Input */
public CompletableFuture<Object> createAddMacUserInput(String storeId, CreateAddMacUserInputRequest body) {
return httpClient.postAsync("/key-stores/" + storeId + "/add-mac-user/input", java.util.Map.of(), body, Object.class, true);
}

/** Create Add Provisioner Input */
public CompletableFuture<Object> createAddProvisionerInput(String storeId, CreateAddProvisionerInputRequest body) {
return httpClient.postAsync("/key-stores/" + storeId + "/add-provisioner/input", java.util.Map.of(), body, Object.class, true);
}

/** Create Clone Input */
public CompletableFuture<Object> createCloneInput(String storeId, CreateCloneInputRequest body) {
return httpClient.postAsync("/key-stores/" + storeId + "/clone/input", java.util.Map.of(), body, Object.class, true);
Expand Down Expand Up @@ -57,6 +67,11 @@ public CompletableFuture<SubmitAddMacUserOutputResponse> submitAddMacUserOutput(
return httpClient.postMultipartAsync("/key-stores/" + storeId + "/add-mac-user/output", java.util.Map.of(), body, file, SubmitAddMacUserOutputResponse.class, true);
}

/** Submit Add Provisioner Output */
public CompletableFuture<SubmitAddProvisionerOutputResponse> submitAddProvisionerOutput(String storeId, SubmitAddProvisionerOutputRequest body, byte[] file) {
return httpClient.postMultipartAsync("/key-stores/" + storeId + "/add-provisioner/output", java.util.Map.of(), body, file, SubmitAddProvisionerOutputResponse.class, true);
}

/** Submit Clone Output */
public CompletableFuture<SubmitCloneOutputResponse> submitCloneOutput(String storeId, SubmitCloneOutputRequest body, byte[] file) {
return httpClient.postMultipartAsync("/key-stores/" + storeId + "/clone/output", java.util.Map.of(), body, file, SubmitCloneOutputResponse.class, true);
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/co/dfns/sdk/signers/SignersClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@ public SignersClient(DfnsHttpClient httpClient) {
this.httpClient = httpClient;
}

/** Cancel Fleet Operation */
public CancelFleetOperationResponse cancelFleetOperation(String storeId, CancelFleetOperationRequest body) {
return httpClient.post("/key-stores/" + storeId + "/fleet-operations/cancel", java.util.Map.of(), body, CancelFleetOperationResponse.class, true);
}

/** Create Add Mac User Input */
public Object createAddMacUserInput(String storeId, CreateAddMacUserInputRequest body) {
return httpClient.post("/key-stores/" + storeId + "/add-mac-user/input", java.util.Map.of(), body, Object.class, true);
}

/** Create Add Provisioner Input */
public Object createAddProvisionerInput(String storeId, CreateAddProvisionerInputRequest body) {
return httpClient.post("/key-stores/" + storeId + "/add-provisioner/input", java.util.Map.of(), body, Object.class, true);
}

/** Create Clone Input */
public Object createCloneInput(String storeId, CreateCloneInputRequest body) {
return httpClient.post("/key-stores/" + storeId + "/clone/input", java.util.Map.of(), body, Object.class, true);
Expand Down Expand Up @@ -56,6 +66,11 @@ public SubmitAddMacUserOutputResponse submitAddMacUserOutput(String storeId, Sub
return httpClient.postMultipart("/key-stores/" + storeId + "/add-mac-user/output", java.util.Map.of(), body, file, SubmitAddMacUserOutputResponse.class, true);
}

/** Submit Add Provisioner Output */
public SubmitAddProvisionerOutputResponse submitAddProvisionerOutput(String storeId, SubmitAddProvisionerOutputRequest body, byte[] file) {
return httpClient.postMultipart("/key-stores/" + storeId + "/add-provisioner/output", java.util.Map.of(), body, file, SubmitAddProvisionerOutputResponse.class, true);
}

/** Submit Clone Output */
public SubmitCloneOutputResponse submitCloneOutput(String storeId, SubmitCloneOutputRequest body, byte[] file) {
return httpClient.postMultipart("/key-stores/" + storeId + "/clone/output", java.util.Map.of(), body, file, SubmitCloneOutputResponse.class, true);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package co.dfns.sdk.signers.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonIgnoreProperties(ignoreUnknown = true)
public record CancelFleetOperationRequest(
@JsonProperty("groupId") String groupId,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("reason") String reason
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package co.dfns.sdk.signers.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
public record CancelFleetOperationResponse(
@JsonProperty("groupId") String groupId,
@JsonProperty("storeId") String storeId,
@JsonProperty("orgId") String orgId,
@JsonProperty("status") String status,
@JsonProperty("createdBy") String createdBy,
@JsonProperty("submittedBy") Object submittedBy,
@JsonProperty("dateSubmitted") Object dateSubmitted,
@JsonProperty("reviewedBy") Object reviewedBy,
@JsonProperty("dateReviewed") Object dateReviewed,
@JsonProperty("canceledBy") Object canceledBy,
@JsonProperty("dateCanceled") Object dateCanceled,
@JsonProperty("reason") Object reason,
@JsonProperty("dateCreated") String dateCreated,
@JsonProperty("operations") List<Map<String, Object>> operations
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package co.dfns.sdk.signers.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public record CreateAddProvisionerInputRequest(
@JsonProperty("kind") String kind,
@JsonProperty("yubikeySerial") String yubikeySerial,
@JsonProperty("hsmTargetSerial") String hsmTargetSerial
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package co.dfns.sdk.signers.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
public record SubmitAddProvisionerOutputRequest(
@JsonProperty("fileChecksum") String fileChecksum,
@JsonProperty("outputJson") Map<String, Object> outputJson
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package co.dfns.sdk.signers.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public record SubmitAddProvisionerOutputResponse(
@JsonProperty("message") String message
) {}
Loading
Loading