Skip to content

Commit 3629d6c

Browse files
committed
16.21.0
1 parent 94730eb commit 3629d6c

19 files changed

+13547
-1
lines changed

com/strongdm/api/Client.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,36 @@ public Replays replays() {
514514
return this.replays;
515515
}
516516

517+
protected final RequestableAccountEntitlements requestableAccountEntitlements;
518+
519+
/**
520+
* RequestableAccountEntitlements enumerates the resources that an account is permitted to request
521+
* access to. The RequestableAccountEntitlements service is read-only.
522+
*/
523+
public RequestableAccountEntitlements requestableAccountEntitlements() {
524+
return this.requestableAccountEntitlements;
525+
}
526+
527+
protected final RequestableResourceEntitlements requestableResourceEntitlements;
528+
529+
/**
530+
* RequestableResourceEntitlements enumerates the accounts that are permitted to request access to
531+
* a given resource. The RequestableResourceEntitlements service is read-only.
532+
*/
533+
public RequestableResourceEntitlements requestableResourceEntitlements() {
534+
return this.requestableResourceEntitlements;
535+
}
536+
537+
protected final RequestableRoleEntitlements requestableRoleEntitlements;
538+
539+
/**
540+
* RequestableRoleEntitlements enumerates the resources that a role permits its members to request
541+
* access to. The RequestableRoleEntitlements service is read-only.
542+
*/
543+
public RequestableRoleEntitlements requestableRoleEntitlements() {
544+
return this.requestableRoleEntitlements;
545+
}
546+
517547
protected final Resources resources;
518548

519549
/**
@@ -709,6 +739,9 @@ private Client(Client client) {
709739
this.remoteIdentityGroups = new RemoteIdentityGroups(this.channel, this);
710740
this.remoteIdentityGroupsHistory = new RemoteIdentityGroupsHistory(this.channel, this);
711741
this.replays = new Replays(this.channel, this);
742+
this.requestableAccountEntitlements = new RequestableAccountEntitlements(this.channel, this);
743+
this.requestableResourceEntitlements = new RequestableResourceEntitlements(this.channel, this);
744+
this.requestableRoleEntitlements = new RequestableRoleEntitlements(this.channel, this);
712745
this.resources = new Resources(this.channel, this);
713746
this.resourcesHistory = new ResourcesHistory(this.channel, this);
714747
this.roleResources = new RoleResources(this.channel, this);
@@ -800,6 +833,10 @@ public Client(String apiAccessKey, String apiSecretKey, ClientOptions options)
800833
this.remoteIdentityGroups = new RemoteIdentityGroups(this.channel, this);
801834
this.remoteIdentityGroupsHistory = new RemoteIdentityGroupsHistory(this.channel, this);
802835
this.replays = new Replays(this.channel, this);
836+
this.requestableAccountEntitlements = new RequestableAccountEntitlements(this.channel, this);
837+
this.requestableResourceEntitlements =
838+
new RequestableResourceEntitlements(this.channel, this);
839+
this.requestableRoleEntitlements = new RequestableRoleEntitlements(this.channel, this);
803840
this.resources = new Resources(this.channel, this);
804841
this.resourcesHistory = new ResourcesHistory(this.channel, this);
805842
this.roleResources = new RoleResources(this.channel, this);
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright 2020 StrongDM Inc
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
// Code generated by protogen. DO NOT EDIT.
17+
18+
package com.strongdm.api;
19+
20+
/**
21+
* RequestableAccountEntitlement represents an individual resource that an Account is permitted to
22+
* request access to.
23+
*/
24+
public class RequestableAccountEntitlement {
25+
private String groupId;
26+
/** The unique identifier of the group associated with this entitlement, if any. */
27+
public String getGroupId() {
28+
return this.groupId;
29+
}
30+
/** The unique identifier of the group associated with this entitlement, if any. */
31+
public void setGroupId(String in) {
32+
this.groupId = in;
33+
}
34+
35+
private MappedIdentities mappedIdentities;
36+
/** The mapped identity privileges for this entitlement, such as Kubernetes group memberships. */
37+
public MappedIdentities getMappedIdentities() {
38+
return this.mappedIdentities;
39+
}
40+
/** The mapped identity privileges for this entitlement, such as Kubernetes group memberships. */
41+
public void setMappedIdentities(MappedIdentities in) {
42+
this.mappedIdentities = in;
43+
}
44+
45+
private String originId;
46+
/** The unique identifier of the origin of this entitlement (e.g., an Access Workflow ID). */
47+
public String getOriginId() {
48+
return this.originId;
49+
}
50+
/** The unique identifier of the origin of this entitlement (e.g., an Access Workflow ID). */
51+
public void setOriginId(String in) {
52+
this.originId = in;
53+
}
54+
55+
private String resourceId;
56+
/** The unique identifier of the Resource to which access can be requested. */
57+
public String getResourceId() {
58+
return this.resourceId;
59+
}
60+
/** The unique identifier of the Resource to which access can be requested. */
61+
public void setResourceId(String in) {
62+
this.resourceId = in;
63+
}
64+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
// Copyright 2020 StrongDM Inc
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
// Code generated by protogen. DO NOT EDIT.
17+
18+
package com.strongdm.api;
19+
20+
import com.strongdm.api.plumbing.PageIterator;
21+
import com.strongdm.api.plumbing.PageResult;
22+
import com.strongdm.api.plumbing.Plumbing;
23+
import com.strongdm.api.plumbing.RequestableAccountEntitlementsGrpc;
24+
import com.strongdm.api.plumbing.RequestableAccountEntitlementsPlumbing;
25+
import com.strongdm.api.plumbing.Spec.ListRequestMetadata;
26+
import io.grpc.Deadline;
27+
import io.grpc.ManagedChannel;
28+
import java.util.Iterator;
29+
import java.util.List;
30+
import java.util.concurrent.TimeUnit;
31+
import java.util.function.Supplier;
32+
33+
/**
34+
* RequestableAccountEntitlements enumerates the resources that an account is permitted to request
35+
* access to. The RequestableAccountEntitlements service is read-only.
36+
*/
37+
public class RequestableAccountEntitlements implements SnapshotRequestableAccountEntitlements {
38+
private final RequestableAccountEntitlementsGrpc.RequestableAccountEntitlementsBlockingStub stub;
39+
private final Client parent;
40+
private final Deadline deadline;
41+
42+
public RequestableAccountEntitlements(ManagedChannel channel, Client client) {
43+
this.stub = RequestableAccountEntitlementsGrpc.newBlockingStub(channel);
44+
this.parent = client;
45+
this.deadline = null;
46+
}
47+
48+
private RequestableAccountEntitlements(
49+
RequestableAccountEntitlementsGrpc.RequestableAccountEntitlementsBlockingStub stub,
50+
Client client,
51+
Deadline deadline) {
52+
this.stub = stub;
53+
this.parent = client;
54+
this.deadline = deadline;
55+
}
56+
57+
/**
58+
* This function returns a copy of the RequestableAccountEntitlements service which has the given
59+
* deadline set for all method calls.
60+
*/
61+
public RequestableAccountEntitlements withDeadlineAfter(long duration, TimeUnit units) {
62+
Deadline deadline = Deadline.after(duration, units);
63+
return new RequestableAccountEntitlements(
64+
this.stub.withDeadline(deadline), this.parent, deadline);
65+
}
66+
/** List gets a list of RequestableAccountEntitlement records matching a given set of criteria. */
67+
public Iterable<RequestableAccountEntitlement> list(
68+
String accountId, String filter, Object... args) throws RpcException {
69+
RequestableAccountEntitlementsPlumbing.RequestableAccountEntitlementListRequest.Builder
70+
builder =
71+
RequestableAccountEntitlementsPlumbing.RequestableAccountEntitlementListRequest
72+
.newBuilder();
73+
builder.setAccountId((accountId));
74+
builder.setFilter(Plumbing.quoteFilterArgs(filter, args));
75+
ListRequestMetadata.Builder metaBuilder = ListRequestMetadata.newBuilder();
76+
if (this.parent.pageLimit > 0) {
77+
metaBuilder.setLimit(this.parent.pageLimit);
78+
}
79+
if (this.parent.snapshotDate != null) {
80+
metaBuilder.setSnapshotAt(Plumbing.convertTimestampToPlumbing(this.parent.snapshotDate));
81+
}
82+
builder.setMeta(metaBuilder);
83+
84+
Supplier<PageResult<RequestableAccountEntitlement>> pageFetcher =
85+
() -> {
86+
// Note: this closure captures and reuses the builder to set the next page
87+
RequestableAccountEntitlementsPlumbing.RequestableAccountEntitlementListRequest req =
88+
builder.build();
89+
RequestableAccountEntitlementsPlumbing.RequestableAccountEntitlementListResponse
90+
plumbingResponse;
91+
int tries = 0;
92+
while (true) {
93+
try {
94+
plumbingResponse =
95+
this.stub
96+
.withCallCredentials(
97+
this.parent.getCallCredentials(
98+
"RequestableAccountEntitlements.List", req))
99+
.list(req);
100+
} catch (Exception e) {
101+
if (this.parent.shouldRetry(tries, e, this.deadline)) {
102+
tries++;
103+
try {
104+
Thread.sleep(this.parent.exponentialBackoff(tries, this.deadline));
105+
} catch (Exception ignored) {
106+
}
107+
continue;
108+
}
109+
throw Plumbing.convertExceptionToPorcelain(e);
110+
}
111+
break;
112+
}
113+
114+
List<RequestableAccountEntitlement> page =
115+
Plumbing.convertRepeatedRequestableAccountEntitlementToPorcelain(
116+
plumbingResponse.getRequestableAccountEntitlementsList());
117+
118+
boolean hasNextCursor = plumbingResponse.getMeta().getNextCursor() != "";
119+
builder.setMeta(
120+
ListRequestMetadata.newBuilder()
121+
.setCursor(plumbingResponse.getMeta().getNextCursor()));
122+
123+
return new PageResult<RequestableAccountEntitlement>(page, hasNextCursor);
124+
};
125+
126+
Iterator<RequestableAccountEntitlement> iterator = new PageIterator<>(pageFetcher);
127+
128+
return () -> iterator;
129+
}
130+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright 2020 StrongDM Inc
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
// Code generated by protogen. DO NOT EDIT.
17+
18+
package com.strongdm.api;
19+
20+
/**
21+
* RequestableResourceEntitlement represents an individual account that is permitted to request
22+
* access to a Resource.
23+
*/
24+
public class RequestableResourceEntitlement {
25+
private String accountId;
26+
/** The unique identifier of the Account that can request access to this resource. */
27+
public String getAccountId() {
28+
return this.accountId;
29+
}
30+
/** The unique identifier of the Account that can request access to this resource. */
31+
public void setAccountId(String in) {
32+
this.accountId = in;
33+
}
34+
35+
private String groupId;
36+
/** The unique identifier of the group associated with this entitlement, if any. */
37+
public String getGroupId() {
38+
return this.groupId;
39+
}
40+
/** The unique identifier of the group associated with this entitlement, if any. */
41+
public void setGroupId(String in) {
42+
this.groupId = in;
43+
}
44+
45+
private MappedIdentities mappedIdentities;
46+
/** The mapped identity privileges for this entitlement, such as Kubernetes group memberships. */
47+
public MappedIdentities getMappedIdentities() {
48+
return this.mappedIdentities;
49+
}
50+
/** The mapped identity privileges for this entitlement, such as Kubernetes group memberships. */
51+
public void setMappedIdentities(MappedIdentities in) {
52+
this.mappedIdentities = in;
53+
}
54+
55+
private String originId;
56+
/** The unique identifier of the origin of this entitlement (e.g., an Access Workflow ID). */
57+
public String getOriginId() {
58+
return this.originId;
59+
}
60+
/** The unique identifier of the origin of this entitlement (e.g., an Access Workflow ID). */
61+
public void setOriginId(String in) {
62+
this.originId = in;
63+
}
64+
}

0 commit comments

Comments
 (0)