Skip to content

Commit

Permalink
6.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SupportSDM committed Jan 25, 2024
1 parent 394cf36 commit 02c953d
Show file tree
Hide file tree
Showing 10 changed files with 9,154 additions and 57 deletions.
9 changes: 9 additions & 0 deletions com/strongdm/api/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,13 @@ public RolesHistory rolesHistory() {
return this.rolesHistory;
}

protected final SecretStoreHealths secretStoreHealths;

/** SecretStoreHealths exposes health states for secret stores. */
public SecretStoreHealths secretStoreHealths() {
return this.secretStoreHealths;
}

protected final SecretStores secretStores;

/** SecretStores are servers where resource secrets (passwords, keys) are stored. */
Expand Down Expand Up @@ -472,6 +479,7 @@ private Client(Client client) {
this.roleResourcesHistory = new RoleResourcesHistory(this.channel, this);
this.roles = new Roles(this.channel, this);
this.rolesHistory = new RolesHistory(this.channel, this);
this.secretStoreHealths = new SecretStoreHealths(this.channel, this);
this.secretStores = new SecretStores(this.channel, this);
this.secretStoresHistory = new SecretStoresHistory(this.channel, this);
this.workflowApprovers = new WorkflowApprovers(this.channel, this);
Expand Down Expand Up @@ -537,6 +545,7 @@ public Client(String apiAccessKey, String apiSecretKey, ClientOptions options)
this.roleResourcesHistory = new RoleResourcesHistory(this.channel, this);
this.roles = new Roles(this.channel, this);
this.rolesHistory = new RolesHistory(this.channel, this);
this.secretStoreHealths = new SecretStoreHealths(this.channel, this);
this.secretStores = new SecretStores(this.channel, this);
this.secretStoresHistory = new SecretStoresHistory(this.channel, this);
this.workflowApprovers = new WorkflowApprovers(this.channel, this);
Expand Down
113 changes: 113 additions & 0 deletions com/strongdm/api/SecretStoreHealth.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// Copyright 2020 StrongDM Inc
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Code generated by protogen. DO NOT EDIT.

package com.strongdm.api;

import java.util.Date;
import java.util.List;

/**
* SecretStoreHealth denotes a secret store's health status. Note a secret store is not healthy in
* terms of a simple boolean, but rather healthy with respect to a particular node or set of nodes.
*/
public class SecretStoreHealth {
private Date changedAt;
/** The time when the status last changed */
public Date getChangedAt() {
return this.changedAt;
}
/** The time when the status last changed */
public void setChangedAt(Date in) {
this.changedAt = in;
}

private Date checkedAt;
/** The time when the status was last checked by the node */
public Date getCheckedAt() {
return this.checkedAt;
}
/** The time when the status was last checked by the node */
public void setCheckedAt(Date in) {
this.checkedAt = in;
}

private String error;
/**
* The error associated with this health check, if it occurred after reachability checks
* succeeded.
*/
public String getError() {
return this.error;
}
/**
* The error associated with this health check, if it occurred after reachability checks
* succeeded.
*/
public void setError(String in) {
this.error = in;
}

private List<String> flags;
/** Any specific status or error flags associated with this health check. */
public List<String> getFlags() {
return this.flags;
}
/** Any specific status or error flags associated with this health check. */
public void setFlags(List<String> in) {
this.flags = in;
}

private String nodeId;
/** Associated node id for this health */
public String getNodeId() {
return this.nodeId;
}
/** Associated node id for this health */
public void setNodeId(String in) {
this.nodeId = in;
}

private String reachability;
/** The error associated with this health check, if it occurred during reachability checks. */
public String getReachability() {
return this.reachability;
}
/** The error associated with this health check, if it occurred during reachability checks. */
public void setReachability(String in) {
this.reachability = in;
}

private String secretStoreId;
/** Associated secret store for this health */
public String getSecretStoreId() {
return this.secretStoreId;
}
/** Associated secret store for this health */
public void setSecretStoreId(String in) {
this.secretStoreId = in;
}

private String status;
/** The status of the link between the node and secret store */
public String getStatus() {
return this.status;
}
/** The status of the link between the node and secret store */
public void setStatus(String in) {
this.status = in;
}
}
30 changes: 30 additions & 0 deletions com/strongdm/api/SecretStoreHealthListResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2020 StrongDM Inc
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Code generated by protogen. DO NOT EDIT.

package com.strongdm.api;

public class SecretStoreHealthListResponse {
private RateLimitMetadata rateLimit;
/** Rate limit information. */
public RateLimitMetadata getRateLimit() {
return this.rateLimit;
}
/** Rate limit information. */
public void setRateLimit(RateLimitMetadata in) {
this.rateLimit = in;
}
}
30 changes: 30 additions & 0 deletions com/strongdm/api/SecretStoreHealthcheckResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2020 StrongDM Inc
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Code generated by protogen. DO NOT EDIT.

package com.strongdm.api;

public class SecretStoreHealthcheckResponse {
private RateLimitMetadata rateLimit;
/** Rate limit information. */
public RateLimitMetadata getRateLimit() {
return this.rateLimit;
}
/** Rate limit information. */
public void setRateLimit(RateLimitMetadata in) {
this.rateLimit = in;
}
}
141 changes: 141 additions & 0 deletions com/strongdm/api/SecretStoreHealths.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
// Copyright 2020 StrongDM Inc
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Code generated by protogen. DO NOT EDIT.

package com.strongdm.api;

import com.strongdm.api.plumbing.PageIterator;
import com.strongdm.api.plumbing.PageResult;
import com.strongdm.api.plumbing.Plumbing;
import com.strongdm.api.plumbing.SecretStoreHealthsGrpc;
import com.strongdm.api.plumbing.SecretStoreHealthsPlumbing;
import com.strongdm.api.plumbing.Spec.ListRequestMetadata;
import io.grpc.ManagedChannel;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

/** SecretStoreHealths exposes health states for secret stores. */
public class SecretStoreHealths {
private final SecretStoreHealthsGrpc.SecretStoreHealthsBlockingStub stub;
private final Client parent;

public SecretStoreHealths(ManagedChannel channel, Client client) {

this.stub = SecretStoreHealthsGrpc.newBlockingStub(channel);
this.parent = client;
}

private SecretStoreHealths(
SecretStoreHealthsGrpc.SecretStoreHealthsBlockingStub stub, Client client) {
this.stub = stub;
this.parent = client;
}

/**
* This function returns a copy of the SecretStoreHealths service which has the given deadline set
* for all method calls.
*/
public SecretStoreHealths withDeadlineAfter(long duration, TimeUnit units) {
return new SecretStoreHealths(this.stub.withDeadlineAfter(duration, units), this.parent);
}
/** List reports the health status of node to secret store pairs. */
public Iterable<SecretStoreHealth> list(String filter, Object... args) throws RpcException {
SecretStoreHealthsPlumbing.SecretStoreHealthListRequest.Builder builder =
SecretStoreHealthsPlumbing.SecretStoreHealthListRequest.newBuilder();
builder.setFilter(Plumbing.quoteFilterArgs(filter, args));
ListRequestMetadata.Builder metaBuilder = ListRequestMetadata.newBuilder();
if (this.parent.pageLimit > 0) {
metaBuilder.setLimit(this.parent.pageLimit);
}
if (this.parent.snapshotDate != null) {
metaBuilder.setSnapshotAt(Plumbing.convertTimestampToPlumbing(this.parent.snapshotDate));
}
builder.setMeta(metaBuilder);

Supplier<PageResult<SecretStoreHealth>> pageFetcher =
() -> {
// Note: this closure captures and reuses the builder to set the next page
SecretStoreHealthsPlumbing.SecretStoreHealthListRequest req = builder.build();
SecretStoreHealthsPlumbing.SecretStoreHealthListResponse plumbingResponse;
int tries = 0;
while (true) {
try {
plumbingResponse =
this.stub
.withCallCredentials(
this.parent.getCallCredentials("SecretStoreHealths.List", req))
.list(req);
} catch (Exception e) {
if (this.parent.shouldRetry(tries, e)) {
tries++;
this.parent.jitterSleep(tries);
continue;
}
throw Plumbing.convertExceptionToPorcelain(e);
}
break;
}

List<SecretStoreHealth> page =
Plumbing.convertRepeatedSecretStoreHealthToPorcelain(
plumbingResponse.getSecretStoreHealthsList());

boolean hasNextCursor = plumbingResponse.getMeta().getNextCursor() != "";
builder.setMeta(
ListRequestMetadata.newBuilder()
.setCursor(plumbingResponse.getMeta().getNextCursor()));

return new PageResult<SecretStoreHealth>(page, hasNextCursor);
};

Iterator<SecretStoreHealth> iterator = new PageIterator<>(pageFetcher);

return () -> iterator;
}
/**
* Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes to
* propagate across a large network of Nodes. The call will return immediately, and the updated
* health of the Secret Store can be retrieved via List.
*/
public SecretStoreHealthcheckResponse healthcheck(String secretStoreId) throws RpcException {
SecretStoreHealthsPlumbing.SecretStoreHealthcheckRequest.Builder builder =
SecretStoreHealthsPlumbing.SecretStoreHealthcheckRequest.newBuilder();
builder.setSecretStoreId((secretStoreId));
SecretStoreHealthsPlumbing.SecretStoreHealthcheckRequest req = builder.build();
SecretStoreHealthsPlumbing.SecretStoreHealthcheckResponse plumbingResponse;
int tries = 0;
while (true) {
try {
plumbingResponse =
this.stub
.withCallCredentials(
this.parent.getCallCredentials("SecretStoreHealths.Healthcheck", req))
.healthcheck(req);
} catch (Exception e) {
if (this.parent.shouldRetry(tries, e)) {
tries++;
this.parent.jitterSleep(tries);
continue;
}
throw Plumbing.convertExceptionToPorcelain(e);
}
break;
}
return Plumbing.convertSecretStoreHealthcheckResponseToPorcelain(plumbingResponse);
}
}
2 changes: 1 addition & 1 deletion com/strongdm/api/SigningCallCredential.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SigningCallCredential extends CallCredentials {
private final String apiAccessKey;
private final String signature;
private static final String API_VERSION = "2021-08-23";
private static final String USER_AGENT = "strongdm-sdk-java/6.2.1";
private static final String USER_AGENT = "strongdm-sdk-java/6.3.0";

protected SigningCallCredential(String apiAccessKey, String signature) {
this.apiAccessKey = apiAccessKey;
Expand Down
Loading

0 comments on commit 02c953d

Please sign in to comment.