Skip to content

Commit 730ca9c

Browse files
authored
Merge pull request #5077 from 2403905/issue-11004
Deny Users invite themselves to their own federated connection
2 parents 2a7145a + 4626d89 commit 730ca9c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bugfix: Deny Users invite themselves to their own federated connection
2+
3+
Deny Users invite themselves to their own federated connection
4+
5+
https://github.com/cs3org/reva/pull/5077

internal/grpc/services/ocminvitemanager/ocminvitemanager.go

+6
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ func (s *service) ForwardInvite(ctx context.Context, req *invitepb.ForwardInvite
170170
return nil, err
171171
}
172172

173+
if req.GetOriginSystemProvider().Domain == s.conf.ProviderDomain {
174+
return &invitepb.ForwardInviteResponse{
175+
Status: status.NewInvalid(ctx, "can not accept an invite from the same instance"),
176+
}, nil
177+
}
178+
173179
// Accept the invitation on the remote OCM provider
174180
remoteUser, err := s.ocmClient.InviteAccepted(ctx, ocmEndpoint, &client.InviteAcceptedRequest{
175181
Token: req.InviteToken.GetToken(),

0 commit comments

Comments
 (0)