mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-05-10 01:48:22 +00:00
Add function to offline decode Resources
This commit is contained in:
parent
f6b82dcbe9
commit
27715fd266
1 changed files with 6 additions and 0 deletions
|
@ -94,8 +94,14 @@ func GetResource(ctx context.Context, c *api.Client, resourceID string) (folderP
|
|||
if err != nil {
|
||||
return "", "", "", "", "", "", fmt.Errorf("Getting Resource Secret: %w", err)
|
||||
}
|
||||
return GetResourceFromData(c, *resource, *secret, *rType)
|
||||
}
|
||||
|
||||
// GetResourceFromData Decrypts Resources using only local data, the Resource object must inlude the secret
|
||||
func GetResourceFromData(c *api.Client, resource api.Resource, secret api.Secret, rType api.ResourceType) (folderParentID, name, username, uri, password, description string, err error) {
|
||||
var pw string
|
||||
var desc string
|
||||
|
||||
switch rType.Slug {
|
||||
case "password-string":
|
||||
pw, err = c.DecryptMessage(secret.Data)
|
||||
|
|
Loading…
Add table
Reference in a new issue