Skip to content

Commit

Permalink
check idp when getting a user
Browse files Browse the repository at this point in the history
  • Loading branch information
individual-it committed Aug 4, 2020
1 parent c7e67b1 commit 1cf0384
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/check-idp-demo-userprovider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix missing idp check in GetUser of demo userprovider

We've added a check for matching idp in the GetUser function of the demo userprovider

https://github.com/cs3org/reva/issues/1047
4 changes: 3 additions & 1 deletion pkg/user/manager/demo/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ func New(m map[string]interface{}) (user.Manager, error) {

func (m *manager) GetUser(ctx context.Context, uid *userpb.UserId) (*userpb.User, error) {
if user, ok := m.catalog[uid.OpaqueId]; ok {
return user, nil
if uid.Idp == "" || user.Id.Idp == uid.Idp {
return user, nil
}
}
return nil, errtypes.NotFound(uid.OpaqueId)
}
Expand Down

0 comments on commit 1cf0384

Please sign in to comment.