Documentation ¶
Index ¶
- func AddMFACallbackTOTP(c *api.Client, retrys uint, retryDelay, offset time.Duration, token string)
- func CreateFolder(ctx context.Context, c *api.Client, folderParentID, name string) (string, error)
- func CreateGroup(ctx context.Context, c *api.Client, name string, ...) (string, error)
- func CreateResource(ctx context.Context, c *api.Client, ...) (string, error)
- func CreateResourceSimple(ctx context.Context, c *api.Client, ...) (string, error)
- func CreateUser(ctx context.Context, c *api.Client, role, username, firstname, lastname string) (string, error)
- func DeleteFolder(ctx context.Context, c *api.Client, folderID string) error
- func DeleteGroup(ctx context.Context, c *api.Client, groupID string) error
- func DeleteResource(ctx context.Context, c *api.Client, resourceID string) error
- func DeleteUser(ctx context.Context, c *api.Client, userID string) error
- func GenerateOTPCode(token string, when time.Time) (string, error)
- func GeneratePermissionChanges(oldPermissions []api.Permission, changes []ShareOperation) ([]api.Permission, error)
- func GetFolder(ctx context.Context, c *api.Client, folderID string) (string, string, error)
- func GetResource(ctx context.Context, c *api.Client, resourceID string) (folderParentID, name, username, uri, password, description string, err error)
- func GetResourceFromData(c *api.Client, resource api.Resource, secret api.Secret, ...) (folderParentID, name, username, uri, password, description string, err error)
- func GetUser(ctx context.Context, c *api.Client, userID string) (string, string, string, string, error)
- func MoveFolder(ctx context.Context, c *api.Client, folderID, folderParentID string) error
- func MoveResource(ctx context.Context, c *api.Client, resourceID, folderParentID string) error
- func ParseInviteUrl(url string) (string, string, error)
- func SetupAccount(ctx context.Context, c *api.Client, userID, token, password string) (string, error)
- func ShareFolder(ctx context.Context, c *api.Client, folderID string, changes []ShareOperation) error
- func ShareFolderWithUsersAndGroups(ctx context.Context, c *api.Client, folderID string, Users []string, ...) error
- func ShareResource(ctx context.Context, c *api.Client, resourceID string, ...) error
- func ShareResourceWithUsersAndGroups(ctx context.Context, c *api.Client, resourceID string, Users []string, ...) error
- func UpdateFolder(ctx context.Context, c *api.Client, folderID, name string) error
- func UpdateGroup(ctx context.Context, c *api.Client, groupID, name string, ...) error
- func UpdateResource(ctx context.Context, c *api.Client, ...) error
- func UpdateUser(ctx context.Context, c *api.Client, userID, role, firstname, lastname string) error
- type GroupMembership
- type GroupMembershipOperation
- type ShareOperation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMFACallbackTOTP ¶
AddMFACallbackTOTP adds a MFA callback to the client that generates OTP Codes on demand using a Token with configurable retries and delay
func CreateFolder ¶
CreateFolder Creates a new Folder
func CreateGroup ¶
func CreateGroup(ctx context.Context, c *api.Client, name string, operations []GroupMembershipOperation) (string, error)
CreateGroup creates a Groups with Name and Memberships
func CreateResource ¶
func CreateResource(ctx context.Context, c *api.Client, folderParentID, name, username, uri, password, description string) (string, error)
CreateResource Creates a Resource where the Password and Description are Encrypted and Returns the Resources ID
func CreateResourceSimple ¶
func CreateResourceSimple(ctx context.Context, c *api.Client, folderParentID, name, username, uri, password, description string) (string, error)
CreateResourceSimple Creates a Legacy Resource where only the Password is Encrypted and Returns the Resources ID
func CreateUser ¶
func CreateUser(ctx context.Context, c *api.Client, role, username, firstname, lastname string) (string, error)
CreateUser Creates a new User
func DeleteFolder ¶
DeleteFolder Deletes a Folder
func DeleteGroup ¶
DeleteGroup Deletes a Group
func DeleteResource ¶
DeleteResource Deletes a Resource
func DeleteUser ¶
DeleteUser Deletes a User
func GenerateOTPCode ¶
GenerateOTPCode generates a 6 digit TOTP from the secret Token.
func GeneratePermissionChanges ¶
func GeneratePermissionChanges(oldPermissions []api.Permission, changes []ShareOperation) ([]api.Permission, error)
GeneratePermissionChanges Generates the Permission Changes for a Resource/Folder nessesary for a single Share Operation
func GetResource ¶
func GetResource(ctx context.Context, c *api.Client, resourceID string) (folderParentID, name, username, uri, password, description string, err error)
GetResource Gets a Resource by ID
func GetResourceFromData ¶
func GetResourceFromData(c *api.Client, resource api.Resource, secret api.Secret, rType api.ResourceType) (folderParentID, name, username, uri, password, description string, err error)
GetResourceFromData Decrypts Resources using only local data, the Resource object must inlude the secret
func GetUser ¶
func GetUser(ctx context.Context, c *api.Client, userID string) (string, string, string, string, error)
GetUser Gets a User
func MoveFolder ¶
MoveFolder Moves a Folder into a Folder
func MoveResource ¶
MoveResource Moves a Resource into a Folder
func ParseInviteUrl ¶
ParseInviteUrl Parses a Passbolt Invite URL into a user id and token
func SetupAccount ¶
func SetupAccount(ctx context.Context, c *api.Client, userID, token, password string) (string, error)
SetupAccount Setup a Account for a Invited User. (Use ParseInviteUrl to get the userid and token from a Invite URL)
func ShareFolder ¶
func ShareFolder(ctx context.Context, c *api.Client, folderID string, changes []ShareOperation) error
ShareFolder Shares a Folder as Specified in the Passed ShareOperation Struct Slice. Note Resources Permissions in the Folder are not Adjusted
func ShareFolderWithUsersAndGroups ¶
func ShareFolderWithUsersAndGroups(ctx context.Context, c *api.Client, folderID string, Users []string, Groups []string, permissionType int) error
ShareFolderWithUsersAndGroups Shares a Folder With The Users and Groups with the Specified Type, if the Folder has already been shared With the User/Group the Permission Type will be Adjusted/Deleted. Note: Resources Permissions in the Folder are not Adjusted (Like the Extension does)
func ShareResource ¶
func ShareResource(ctx context.Context, c *api.Client, resourceID string, changes []ShareOperation) error
ShareResource Shares a Resource as Specified in the Passed ShareOperation Struct Slice
func ShareResourceWithUsersAndGroups ¶
func ShareResourceWithUsersAndGroups(ctx context.Context, c *api.Client, resourceID string, Users []string, Groups []string, permissionType int) error
ShareResourceWithUsersAndGroups Shares a Resource With The Users and Groups with the Specified Permission Type, if the Resource has already been shared With the User/Group the Permission Type will be Adjusted/Deleted
func UpdateFolder ¶
UpdateFolder Updates a Folder
func UpdateGroup ¶
func UpdateGroup(ctx context.Context, c *api.Client, groupID, name string, operations []GroupMembershipOperation) error
UpdateGroup Updates a Groups Name and Memberships
Types ¶
type GroupMembership ¶
type GroupMembership struct { UserID string Username string UserFirstName string UserLastName string IsGroupManager bool }
GroupMembership contains who and what kind of membership they have with a group
type GroupMembershipOperation ¶
GroupMembershipOperation creates/modifies/deletes a group membership
type ShareOperation ¶
type ShareOperation struct { // Note: Setting this to -1 Will delete this Permission if it already Exists, errors if this Permission Dosen't Already Exists Type int ARO string AROID string }
ShareOperation defines how Resources are to be Shared With Users/Groups