-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v15] Teleterm: add new access request fields (#39050) #39320
Conversation
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
}; | ||
export type CreateAccessRequestParams = | ||
apiService.CreateAccessRequestRequest & { | ||
rootClusterUri: uri.RootClusterUri; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only because of your comment under that PR with dates I noticed that you want to backport to v14 too. In that case, our advice with using types.CreateAccessRequestParams
directly and not mapping it goes out of the window, because v14 doesn't have protobuf-ts.
This means on v14 we won't be able to simply do…
export type CreateAccessRequestParams =
apiService.CreateAccessRequestRequest & …
…because on that branch, apiService.CreateAccessRequestRequest
is a class and not a simple object.
IIRC, you can try doing this and see where it takes you:
export type CreateAccessRequestParams =
apiService.CreateAccessRequestRequest.AsObject & …
@@ -295,21 +295,8 @@ export function createTshdClient( | |||
}, | |||
|
|||
async createAccessRequest(params: types.CreateAccessRequestParams) { | |||
const req = api.CreateAccessRequestRequest.create({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On v14, params
have to be converted to a class. This means you'll have to call setters for the fields added in this PR, just like it's done for other fields already.
teleport/web/packages/teleterm/src/services/tshd/createClient.ts
Lines 240 to 254 in fe62f5b
async createAccessRequest(params: types.CreateAccessRequestParams) { | |
const req = new api.CreateAccessRequestRequest() | |
.setRootClusterUri(params.rootClusterUri) | |
.setSuggestedReviewersList(params.suggestedReviewers) | |
.setRolesList(params.roles) | |
.setResourceIdsList( | |
params.resourceIds.map(({ id, clusterName, kind }) => { | |
const resourceId = new ResourceID(); | |
resourceId.setName(id); | |
resourceId.setClusterName(clusterName); | |
resourceId.setKind(kind); | |
return resourceId; | |
}) | |
) | |
.setReason(params.reason); |
backport #39050 to branch/v15
manual because there was a conflict with
service.pb.go
, resolved by runningmake grpc