mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-09-13 14:29:09 +00:00
Allow Pinning / Trusting Metadatakeys, Handle new Keys
This commit is contained in:
parent
7d6d1c614c
commit
3cd88d7553
7 changed files with 207 additions and 140 deletions
|
@ -81,13 +81,14 @@ func ShareResource(ctx context.Context, c *api.Client, resourceID string, change
|
|||
|
||||
// if Metadata has not been shared yet then we need to do that
|
||||
// we assume that if MetadataKeyType is not null that this is a v5 Resource and that the other field are fine
|
||||
// TODO Calculate if this should be the Shared Metadatakey or our Personal one (if we are unsharing)
|
||||
if resource.MetadataKeyType == api.MetadataKeyTypeUserKey {
|
||||
metadata, err := GetResourceMetadata(ctx, c, resource, rType)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Get Metadata: %w", err)
|
||||
}
|
||||
|
||||
metadataKeyID, metadataKeyType, publicMetadataKey, err := GetMetadataKey(ctx, c, true)
|
||||
metadataKeyID, metadataKeyType, publicMetadataKey, err := c.GetMetadataKey(ctx, false)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Get Metadata Key: %w", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue