Skip to content

Commit

Permalink
Add promoted access list title to teleterm access request (#32717)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlisa authored Sep 29, 2023
1 parent 987c78e commit b9df6c6
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 62 deletions.
110 changes: 69 additions & 41 deletions gen/proto/go/teleport/lib/teleterm/v1/access_request.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions gen/proto/js/teleport/lib/teleterm/v1/access_request_pb.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 62 additions & 2 deletions gen/proto/js/teleport/lib/teleterm/v1/access_request_pb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 20 additions & 18 deletions lib/teleterm/apiserver/handler/handler_access_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ func newAPIAccessRequest(req clusters.AccessRequest) *api.AccessRequest {
requestReviews := req.GetReviews()
for _, rev := range requestReviews {
reviews = append(reviews, &api.AccessRequestReview{
Author: rev.Author,
Roles: rev.Roles,
State: rev.ProposedState.String(),
Reason: rev.Reason,
Created: timestamppb.New(rev.Created),
Author: rev.Author,
Roles: rev.Roles,
State: rev.ProposedState.String(),
Reason: rev.Reason,
Created: timestamppb.New(rev.Created),
PromotedAccessListTitle: rev.GetAccessListTitle(),
})
}

Expand Down Expand Up @@ -153,19 +154,20 @@ func newAPIAccessRequest(req clusters.AccessRequest) *api.AccessRequest {
}

return &api.AccessRequest{
Id: req.GetName(),
State: req.GetState().String(),
ResolveReason: req.GetResolveReason(),
RequestReason: req.GetRequestReason(),
User: req.GetUser(),
Roles: req.GetRoles(),
Created: timestamppb.New(req.GetCreationTime()),
Expires: timestamppb.New(req.GetAccessExpiry()),
Reviews: reviews,
SuggestedReviewers: req.GetSuggestedReviewers(),
ThresholdNames: thresholdNames,
ResourceIds: requestedResourceIDs,
Resources: resources,
Id: req.GetName(),
State: req.GetState().String(),
ResolveReason: req.GetResolveReason(),
RequestReason: req.GetRequestReason(),
User: req.GetUser(),
Roles: req.GetRoles(),
Created: timestamppb.New(req.GetCreationTime()),
Expires: timestamppb.New(req.GetAccessExpiry()),
Reviews: reviews,
SuggestedReviewers: req.GetSuggestedReviewers(),
ThresholdNames: thresholdNames,
ResourceIds: requestedResourceIDs,
Resources: resources,
PromotedAccessListTitle: req.GetPromotedAccessListTitle(),
}
}

Expand Down
Loading

0 comments on commit b9df6c6

Please sign in to comment.