Read UID and GID from the opaque object for CS3 proxy backend

This commit is contained in:
Ishank Arora
2021-04-13 11:40:21 +02:00
parent f23cf92153
commit 1b0b14512c
2 changed files with 62 additions and 10 deletions

View File

@@ -70,10 +70,14 @@ func (c *cs3backend) GetUserByClaims(ctx context.Context, claim, value string, w
c.logger.Error().Err(err).Msg("Could not encode loaded roles")
}
user.Opaque = &types.Opaque{
Map: map[string]*types.OpaqueEntry{
"roles": enc,
},
if user.Opaque == nil {
user.Opaque = &types.Opaque{
Map: map[string]*types.OpaqueEntry{
"roles": enc,
},
}
} else {
user.Opaque.Map["roles"] = enc
}
return res.User, nil