Skip to content
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

LinkRemoved ItemID #4645

Merged
merged 1 commit into from
Apr 19, 2024
Merged
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
5 changes: 5 additions & 0 deletions changelog/unreleased/linkremoved-itemid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add ItemID to LinkRemoved

Add itemID to linkremoved response and event

https://github.com/cs3org/reva/pull/4645
3 changes: 3 additions & 0 deletions internal/grpc/interceptors/eventsmiddleware/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,14 @@ func LinkAccessFailed(r *link.GetPublicShareByTokenResponse, req *link.GetPublic

// LinkRemoved converts the response to an event
func LinkRemoved(r *link.RemovePublicShareResponse, req *link.RemovePublicShareRequest, executant *user.UserId) events.LinkRemoved {
var rid *provider.ResourceId
_ = utils.ReadJSONFromOpaque(r.Opaque, "resourceid", &rid)
return events.LinkRemoved{
Executant: executant,
ShareID: req.Ref.GetId(),
ShareToken: req.Ref.GetToken(),
Timestamp: utils.TSNow(),
ItemID: rid,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ func (s *service) RemovePublicShare(ctx context.Context, req *link.RemovePublicS
}, err
}
return &link.RemovePublicShareResponse{
Opaque: utils.AppendJSONToOpaque(nil, "resourceid", ps.GetResourceId()),
Status: status.NewOK(ctx),
}, nil
}
Expand Down
1 change: 1 addition & 0 deletions pkg/events/sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ type LinkRemoved struct {
ShareID *link.PublicShareId
ShareToken string
Timestamp *types.Timestamp
ItemID *provider.ResourceId
}

// Unmarshal to fulfill umarshaller interface
Expand Down
Loading