mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-09-13 14:29:09 +00:00
Add v5 Resource Metadata and Secret Structs, impl Handle Resource Get
for v5 Resources
This commit is contained in:
parent
2197d9e0f7
commit
d5f79a943f
3 changed files with 168 additions and 4 deletions
|
@ -6,8 +6,8 @@ import (
|
|||
"github.com/ProtonMail/gopenpgp/v3/crypto"
|
||||
)
|
||||
|
||||
// ResourceMetadataTypePasswordAndDescription
|
||||
type ResourceMetadataTypePasswordAndDescription struct {
|
||||
// ResourceMetadataTypeV5Default
|
||||
type ResourceMetadataTypeV5Default struct {
|
||||
ObjectType string `json:"object_type"`
|
||||
ResourceTypeID string `json:"resource_type_id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
|
@ -16,6 +16,35 @@ type ResourceMetadataTypePasswordAndDescription struct {
|
|||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceMetadataTypeV5DefaultWithTOTP
|
||||
type ResourceMetadataTypeV5DefaultWithTOTP struct {
|
||||
ObjectType string `json:"object_type"`
|
||||
ResourceTypeID string `json:"resource_type_id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Username string `json:"username,omitempty"`
|
||||
URIs []string `json:"uris,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceMetadataTypeV5PasswordString
|
||||
type ResourceMetadataTypeV5PasswordString struct {
|
||||
ObjectType string `json:"object_type"`
|
||||
ResourceTypeID string `json:"resource_type_id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Username string `json:"username,omitempty"`
|
||||
URIs []string `json:"uris,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceMetadataTypeV5TOTPStandalone
|
||||
type ResourceMetadataTypeV5TOTPStandalone struct {
|
||||
ObjectType string `json:"object_type"`
|
||||
ResourceTypeID string `json:"resource_type_id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
URIs []string `json:"uris,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
func (c *Client) DecryptMetadata(metadataKey *crypto.Key, armoredCiphertext string) (string, error) {
|
||||
// TODO Get SessionKey from Cache
|
||||
var sessionKey *crypto.SessionKey = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue