Documentation
¶
Index ¶
- Constants
- Variables
- type APIHeader
- type APIResponse
- type ARO
- type AuthenticationToken
- type Avatar
- type Client
- func (c *Client) CheckSession(ctx context.Context) bool
- func (c *Client) CreateComment(ctx context.Context, resourceID string, comment Comment) (*Comment, error)
- func (c *Client) CreateFavorite(ctx context.Context, resourceID string) (*Favorite, error)
- func (c *Client) CreateFolder(ctx context.Context, folder Folder) (*Folder, error)
- func (c *Client) CreateGroup(ctx context.Context, group Group) (*Group, error)
- func (c *Client) CreateResource(ctx context.Context, resource Resource) (*Resource, error)
- func (c *Client) CreateUser(ctx context.Context, user User) (*User, error)
- func (c *Client) DecryptMessage(message string) (string, error)
- func (c *Client) DeleteComment(ctx context.Context, commentID string) error
- func (c *Client) DeleteFavorite(ctx context.Context, favoriteID string) error
- func (c *Client) DeleteFolder(ctx context.Context, folderID string) error
- func (c *Client) DeleteGroup(ctx context.Context, groupID string) error
- func (c *Client) DeleteResource(ctx context.Context, resourceID string) error
- func (c *Client) DeleteUser(ctx context.Context, userID string) error
- func (c *Client) DeleteUserDryrun(ctx context.Context, userID string) error
- func (c *Client) DoCustomRequest(ctx context.Context, method, path, version string, body interface{}, ...) (*APIResponse, error)
- func (c *Client) DoCustomRequestAndReturnRawResponse(ctx context.Context, method, path, version string, body interface{}, ...) (*http.Response, *APIResponse, error)
- func (c *Client) EncryptMessage(message string) (string, error)
- func (c *Client) EncryptMessageWithPublicKey(publickey, message string) (string, error)
- func (c *Client) GetComments(ctx context.Context, resourceID string, opts *GetCommentsOptions) ([]Comment, error)
- func (c *Client) GetFolder(ctx context.Context, folderID string, opts *GetFolderOptions) (*Folder, error)
- func (c *Client) GetFolders(ctx context.Context, opts *GetFoldersOptions) ([]Folder, error)
- func (c *Client) GetGPGKey(ctx context.Context, gpgkeyID string) (*GPGKey, error)
- func (c *Client) GetGPGKeys(ctx context.Context, opts *GetGPGKeysOptions) ([]GPGKey, error)
- func (c *Client) GetGroup(ctx context.Context, groupID string) (*Group, error)
- func (c *Client) GetGroups(ctx context.Context, opts *GetGroupsOptions) ([]Group, error)
- func (c *Client) GetHealthCheckStatus(ctx context.Context) (string, error)
- func (c *Client) GetMe(ctx context.Context) (*User, error)
- func (c *Client) GetPublicKey(ctx context.Context) (string, string, error)
- func (c *Client) GetResource(ctx context.Context, resourceID string) (*Resource, error)
- func (c *Client) GetResourcePermissions(ctx context.Context, resourceID string) ([]Permission, error)
- func (c *Client) GetResourceType(ctx context.Context, typeID string) (*ResourceType, error)
- func (c *Client) GetResourceTypes(ctx context.Context, opts *GetResourceTypesOptions) ([]ResourceType, error)
- func (c *Client) GetResources(ctx context.Context, opts *GetResourcesOptions) ([]Resource, error)
- func (c *Client) GetRoles(ctx context.Context) ([]Role, error)
- func (c *Client) GetSecret(ctx context.Context, resourceID string) (*Secret, error)
- func (c *Client) GetUser(ctx context.Context, userID string) (*User, error)
- func (c *Client) GetUserID() string
- func (c *Client) GetUsers(ctx context.Context, opts *GetUsersOptions) ([]User, error)
- func (c *Client) Login(ctx context.Context) error
- func (c *Client) Logout(ctx context.Context) error
- func (c *Client) MoveFolder(ctx context.Context, folderID, folderParentID string) error
- func (c *Client) MoveResource(ctx context.Context, resourceID, folderParentID string) error
- func (c *Client) PerformHealthCheck(ctx context.Context) (json.RawMessage, error)
- func (c *Client) SearchAROs(ctx context.Context, opts SearchAROsOptions) ([]ARO, error)
- func (c *Client) SetupComplete(ctx context.Context, userID string, request SetupCompleteRequest) error
- func (c *Client) SetupInstall(ctx context.Context, userID, token string) (*SetupInstallResponse, error)
- func (c *Client) SetupServerVerification(ctx context.Context) (string, string, error)
- func (c *Client) ShareFolder(ctx context.Context, folderID string, permissions []Permission) error
- func (c *Client) ShareResource(ctx context.Context, resourceID string, shareRequest ResourceShareRequest) error
- func (c *Client) SimulateShareResource(ctx context.Context, resourceID string, shareRequest ResourceShareRequest) (*ResourceShareSimulationResult, error)
- func (c *Client) UpdateComment(ctx context.Context, commentID string, comment Comment) (*Comment, error)
- func (c *Client) UpdateFolder(ctx context.Context, folderID string, folder Folder) (*Folder, error)
- func (c *Client) UpdateGroup(ctx context.Context, groupID string, update GroupUpdate) (*Group, error)
- func (c *Client) UpdateGroupDryRun(ctx context.Context, groupID string, update GroupUpdate) (*UpdateGroupDryRunResult, error)
- func (c *Client) UpdateResource(ctx context.Context, resourceID string, resource Resource) (*Resource, error)
- func (c *Client) UpdateUser(ctx context.Context, userID string, user User) (*User, error)
- func (c *Client) VerifyServer(ctx context.Context, token, encToken string) error
- type Comment
- type Favorite
- type Folder
- type GPGAuth
- type GPGKey
- type GPGVerify
- type GPGVerifyContainer
- type GetCommentsOptions
- type GetFolderOptions
- type GetFoldersOptions
- type GetGPGKeysOptions
- type GetGroupsOptions
- type GetResourceTypesOptions
- type GetResourcesOptions
- type GetUsersOptions
- type Group
- type GroupJoinData
- type GroupMembership
- type GroupSecret
- type GroupUpdate
- type GroupUser
- type Login
- type MFAChallenge
- type MFAChallengeResponse
- type MFAProviders
- type Permission
- type Profile
- type PublicKeyReponse
- type Resource
- type ResourceShareRequest
- type ResourceShareSimulationChange
- type ResourceShareSimulationChanges
- type ResourceShareSimulationResult
- type ResourceShareSimulationUser
- type ResourceType
- type ResourceTypeSchema
- type Role
- type SearchAROsOptions
- type Secret
- type SecretDataTOTP
- type SecretDataTypePasswordAndDescription
- type SecretDataTypePasswordDescriptionTOTP
- type SecretDataTypeTOTP
- type SetupCompleteRequest
- type SetupInstallResponse
- type Tag
- type Time
- type URL
- type UpdateGroupDryRun
- type UpdateGroupDryRunResult
- type UpdateGroupDryRunSecretsNeeded
- type UpdateGroupSecretsNeededContainer
- type User
Constants ¶
const UserLocaleENUK = "en-UK"
Variables ¶
var ( // API Error Codes ErrAPIResponseErrorStatusCode = errors.New("Error API JSON Response Status") ErrAPIResponseUnknownStatusCode = errors.New("Unknown API JSON Response Status") )
Functions ¶
This section is empty.
Types ¶
type APIHeader ¶
type APIHeader struct { ID string `json:"id"` Status string `json:"status"` Servertime int `json:"servertime"` Action string `json:"action"` Message string `json:"message"` URL string `json:"url"` Code int `json:"code"` }
APIHeader is the Struct representation of the Header of a APIResponse
type APIResponse ¶
type APIResponse struct { Header APIHeader `json:"header"` Body json.RawMessage `json:"body"` }
APIResponse is the Struct representation of a Json Response
type AuthenticationToken ¶
type AuthenticationToken struct {
Token string `json:"token,omitempty"`
}
type Avatar ¶
type Avatar struct { ID string `json:"id,omitempty"` UserID string `json:"user_id,omitempty"` ForeignKey string `json:"foreign_key,omitempty"` Model string `json:"model,omitempty"` Filename string `json:"filename,omitempty"` Filesize int `json:"filesize,omitempty"` MimeType string `json:"mime_type,omitempty"` Extension string `json:"extension,omitempty"` Hash string `json:"hash,omitempty"` Path string `json:"path,omitempty"` Adapter string `json:"adapter,omitempty"` Created *Time `json:"created,omitempty"` Modified *Time `json:"modified,omitempty"` URL *URL `json:"url,omitempty"` }
Avatar is a Users Avatar
type Client ¶
type Client struct { // used for solving MFA challenges. You can block this to for example wait for user input. // You shouden't run any unrelated API Calls while you are in this callback. // You need to Return the Cookie that Cipherguard expects to verify you MFA, usually it is called cipherguard_mfa MFACallback func(ctx context.Context, c *Client, res *APIResponse) (http.Cookie, error) // Enable Debug Logging Debug bool // contains filtered or unexported fields }
Client is a Client struct for the Cipherguard api
func NewClient ¶
func NewClient(httpClient *http.Client, UserAgent, BaseURL, UserPrivateKey, UserPassword string) (*Client, error)
NewClient Returns a new Cipherguard Client. if httpClient is nil http.DefaultClient will be used. if UserAgent is "" "goCipherguardClient/1.0" will be used. if UserPrivateKey is "" Key Setup is Skipped to Enable using the Client for User Registration, Most other function will be broken. After Registration a new Client Should be Created.
func (*Client) CheckSession ¶
CheckSession Check to see if you have a Valid Session
func (*Client) CreateComment ¶
func (c *Client) CreateComment(ctx context.Context, resourceID string, comment Comment) (*Comment, error)
CreateComment Creates a new Cipherguard Comment
func (*Client) CreateFavorite ¶
CreateFavorite Creates a new Cipherguard Favorite for the given Resource ID
func (*Client) CreateFolder ¶
CreateFolder Creates a new Cipherguard Folder
func (*Client) CreateGroup ¶
CreateGroup Creates a new Cipherguard Group
func (*Client) CreateResource ¶
CreateResource Creates a new Cipherguard Resource
func (*Client) CreateUser ¶
CreateUser Creates a new Cipherguard User
func (*Client) DecryptMessage ¶
DecryptMessage decrypts a message using the users Private Key
func (*Client) DeleteComment ¶
DeleteComment Deletes a Cipherguard Comment
func (*Client) DeleteFavorite ¶
DeleteFavorite Deletes a Cipherguard Favorite
func (*Client) DeleteFolder ¶
DeleteFolder Deletes a Cipherguard Folder
func (*Client) DeleteGroup ¶
DeleteGroup Deletes a Cipherguard Group
func (*Client) DeleteResource ¶
DeleteResource Deletes a Cipherguard Resource
func (*Client) DeleteUser ¶
DeleteUser Deletes a Cipherguard User
func (*Client) DeleteUserDryrun ¶
DeleteUserDryrun Check if a Cipherguard User is Deleteable
func (*Client) DoCustomRequest ¶
func (c *Client) DoCustomRequest(ctx context.Context, method, path, version string, body interface{}, opts interface{}) (*APIResponse, error)
DoCustomRequest Executes a Custom Request and returns a APIResponse
func (*Client) DoCustomRequestAndReturnRawResponse ¶
func (c *Client) DoCustomRequestAndReturnRawResponse(ctx context.Context, method, path, version string, body interface{}, opts interface{}) (*http.Response, *APIResponse, error)
DoCustomRequestAndReturnRawResponse Executes a Custom Request and returns a APIResponse and the Raw HTTP Response
func (*Client) EncryptMessage ¶
EncryptMessage encrypts a message using the users public key and then signes the message using the users private key
func (*Client) EncryptMessageWithPublicKey ¶
EncryptMessageWithPublicKey encrypts a message using the provided public key and then signes the message using the users private key
func (*Client) GetComments ¶
func (c *Client) GetComments(ctx context.Context, resourceID string, opts *GetCommentsOptions) ([]Comment, error)
GetComments gets all Cipherguard Comments an The Specified Resource
func (*Client) GetFolder ¶
func (c *Client) GetFolder(ctx context.Context, folderID string, opts *GetFolderOptions) (*Folder, error)
GetFolder gets a Cipherguard Folder
func (*Client) GetFolders ¶
GetFolders gets all Folders from the Cipherguardserver
func (*Client) GetGPGKeys ¶
GetGPGKeys gets all Cipherguard GPGKeys
func (*Client) GetHealthCheckStatus ¶
GetHealthCheckStatus gets the Server Status
func (*Client) GetPublicKey ¶
GetPublicKey gets the Public Key and Fingerprint of the Cipherguard instance
func (*Client) GetResource ¶
GetResource gets a Cipherguard Resource
func (*Client) GetResourcePermissions ¶
func (c *Client) GetResourcePermissions(ctx context.Context, resourceID string) ([]Permission, error)
GetResourcePermissions gets a Resources Permissions
func (*Client) GetResourceType ¶
GetResourceType gets a Cipherguard Type
func (*Client) GetResourceTypes ¶
func (c *Client) GetResourceTypes(ctx context.Context, opts *GetResourceTypesOptions) ([]ResourceType, error)
GetResourceTypes gets all Cipherguard Resource Types
func (*Client) GetResources ¶
GetResources gets all Cipherguard Resources
func (*Client) Login ¶
Login gets a Session and CSRF Token from Cipherguard and Stores them in the Clients Cookie Jar
func (*Client) MoveFolder ¶
MoveFolder Moves a Cipherguard Folder
func (*Client) MoveResource ¶
MoveResource Moves a Cipherguard Resource
func (*Client) PerformHealthCheck ¶
PerformHealthCheck performs a Health Check
func (*Client) SearchAROs ¶
SearchAROs gets all Cipherguard AROs
func (*Client) SetupComplete ¶
func (c *Client) SetupComplete(ctx context.Context, userID string, request SetupCompleteRequest) error
SetupComplete Completes setup of a Cipherguard Account
func (*Client) SetupInstall ¶
func (c *Client) SetupInstall(ctx context.Context, userID, token string) (*SetupInstallResponse, error)
SetupInstall validates the userid and token used for Account setup, gives back the User Information
func (*Client) SetupServerVerification ¶
SetupServerVerification sets up Server Verification, Only works before login
func (*Client) ShareFolder ¶
ShareFolder Shares a Folder with AROs
func (*Client) ShareResource ¶
func (c *Client) ShareResource(ctx context.Context, resourceID string, shareRequest ResourceShareRequest) error
ShareResource Shares a Resource with AROs
func (*Client) SimulateShareResource ¶
func (c *Client) SimulateShareResource(ctx context.Context, resourceID string, shareRequest ResourceShareRequest) (*ResourceShareSimulationResult, error)
SimulateShareResource Simulates Shareing a Resource with AROs
func (*Client) UpdateComment ¶
func (c *Client) UpdateComment(ctx context.Context, commentID string, comment Comment) (*Comment, error)
UpdateComment Updates a existing Cipherguard Comment
func (*Client) UpdateFolder ¶
UpdateFolder Updates a existing Cipherguard Folder
func (*Client) UpdateGroup ¶
func (c *Client) UpdateGroup(ctx context.Context, groupID string, update GroupUpdate) (*Group, error)
UpdateGroup Updates a existing Cipherguard Group
func (*Client) UpdateGroupDryRun ¶
func (c *Client) UpdateGroupDryRun(ctx context.Context, groupID string, update GroupUpdate) (*UpdateGroupDryRunResult, error)
UpdateGroupDryRun Checks that a Cipherguard Group update passes validation
func (*Client) UpdateResource ¶
func (c *Client) UpdateResource(ctx context.Context, resourceID string, resource Resource) (*Resource, error)
UpdateResource Updates a existing Cipherguard Resource
func (*Client) UpdateUser ¶
UpdateUser Updates a existing Cipherguard User
type Comment ¶
type Comment struct { ID string `json:"id,omitempty"` ParentID string `json:"parent_id,omitempty"` ForeignKey string `json:"foreign_key,omitempty"` Content string `json:"content,omitempty"` ForeignModel string `json:"foreign_model,omitempty"` Created *Time `json:"created,omitempty"` CreatedBy string `json:"created_by,omitempty"` UserID string `json:"user_id,omitempty"` Description string `json:"description,omitempty"` Modified *Time `json:"modified,omitempty"` ModifiedBy string `json:"modified_by,omitempty"` Children []Comment `json:"children,omitempty"` }
Comment is a Comment
type Favorite ¶
type Favorite struct { ID string `json:"id,omitempty"` Created *Time `json:"created,omitempty"` ForeignKey string `json:"foreign_key,omitempty"` ForeignModel string `json:"foreign_model,omitempty"` Modified *Time `json:"modified,omitempty"` }
Favorite is a Favorite
type Folder ¶
type Folder struct { ID string `json:"id,omitempty"` Created *Time `json:"created,omitempty"` CreatedBy string `json:"created_by,omitempty"` Modified *Time `json:"modified,omitempty"` ModifiedBy string `json:"modified_by,omitempty"` Name string `json:"name,omitempty"` Permissions []Permission `json:"permissions,omitempty"` FolderParentID string `json:"folder_parent_id,omitempty"` Personal bool `json:"personal,omitempty"` ChildrenResources []Resource `json:"children_resources,omitempty"` ChildrenFolders []Folder `json:"children_folders,omitempty"` }
Folder is a Folder
type GPGAuth ¶
type GPGAuth struct { KeyID string `json:"keyid"` Token string `json:"user_token_result,omitempty"` }
GPGAuth is used for login
type GPGKey ¶
type GPGKey struct { ID string `json:"id,omitempty"` ArmoredKey string `json:"armored_key,omitempty"` Created *Time `json:"created,omitempty"` KeyCreated *Time `json:"key_created,omitempty"` Bits int `json:"bits,omitempty"` Deleted bool `json:"deleted,omitempty"` Modified *Time `json:"modified,omitempty"` KeyID string `json:"key_id,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` Type string `json:"type,omitempty"` Expires *Time `json:"expires,omitempty"` }
GPGKey is a GPGKey
type GPGVerify ¶
type GPGVerify struct { KeyID string `json:"keyid"` Token string `json:"server_verify_token,omitempty"` }
GPGVerify is used for verification
type GPGVerifyContainer ¶
type GPGVerifyContainer struct {
Req GPGVerify `json:"gpg_auth"`
}
GPGVerifyContainer is used for verification
type GetCommentsOptions ¶
type GetCommentsOptions struct { ContainCreator bool `url:"contain[creator],omitempty"` ContainModifier bool `url:"contain[modifier],omitempty"` }
GetCommentsOptions are all available query parameters
type GetFolderOptions ¶
type GetFolderOptions struct { ContainChildrenResources bool `url:"contain[children_resources],omitempty"` ContainChildrenFolders bool `url:"contain[children_folders],omitempty"` ContainCreator bool `url:"contain[creator],omitempty"` ContainCreatorProfile bool `url:"contain[creator.profile],omitempty"` ContainModifier bool `url:"contain[modifier],omitempty"` ContainModiferProfile bool `url:"contain[modifier.profile],omitempty"` ContainPermission bool `url:"contain[permission],omitempty"` ContainPermissions bool `url:"contain[permissions],omitempty"` ContainPermissionUserProfile bool `url:"contain[permissions.user.profile],omitempty"` ContainPermissionGroup bool `url:"contain[permissions.group],omitempty"` }
GetFolderOptions are all available query parameters
type GetFoldersOptions ¶
type GetFoldersOptions struct { ContainChildrenResources bool `url:"contain[children_resources],omitempty"` ContainChildrenFolders bool `url:"contain[children_folders],omitempty"` ContainCreator bool `url:"contain[creator],omitempty"` ContainCreatorProfile bool `url:"contain[creator.profile],omitempty"` ContainModifier bool `url:"contain[modifier],omitempty"` ContainModiferProfile bool `url:"contain[modifier.profile],omitempty"` ContainPermission bool `url:"contain[permission],omitempty"` ContainPermissions bool `url:"contain[permissions],omitempty"` ContainPermissionUserProfile bool `url:"contain[permissions.user.profile],omitempty"` ContainPermissionGroup bool `url:"contain[permissions.group],omitempty"` FilterHasID []string `url:"filter[has-id][],omitempty"` FilterHasParent []string `url:"filter[has-parent][],omitempty"` FilterSearch string `url:"filter[search],omitempty"` }
GetFoldersOptions are all available query parameters
type GetGPGKeysOptions ¶
type GetGPGKeysOptions struct { // This is a Unix TimeStamp FilterModifiedAfter int `url:"filter[modified-after],omitempty"` }
GetGPGKeysOptions are all available query parameters
type GetGroupsOptions ¶
type GetGroupsOptions struct { FilterHasUsers []string `url:"filter[has_users],omitempty"` FilterHasManagers []string `url:"filter[has-managers],omitempty"` ContainModifier bool `url:"contain[modifier],omitempty"` ContainModifierProfile bool `url:"contain[modifier.profile],omitempty"` ContainMyGroupUser bool `url:"contain[my_group_user],omitempty"` ContainUsers bool `url:"contain[users],omitempty"` ContainGroupsUsers bool `url:"contain[groups_users],omitempty"` ContainGroupsUsersUser bool `url:"contain[groups_users.user],omitempty"` ContainGroupsUsersUserProfile bool `url:"contain[groups_users.user.profile],omitempty"` ContainGroupsUsersUserGPGKey bool `url:"contain[groups_users.user.gpgkey],omitempty"` }
GetGroupsOptions are all available query parameters
type GetResourceTypesOptions ¶
type GetResourceTypesOptions struct { }
GetResourceTypesOptions is a placeholder for future options
type GetResourcesOptions ¶
type GetResourcesOptions struct { FilterIsFavorite bool `url:"filter[is-favorite],omitempty"` FilterIsOwnedByMe bool `url:"filter[is-owned-by-me],omitempty"` FilterHasID []string `url:"filter[has-id][],omitempty"` // Parent Folder id FilterHasParent []string `url:"filter[has-parent][],omitempty"` FilterHasTag string `url:"filter[has-tag],omitempty"` ContainCreator bool `url:"contain[creator],omitempty"` ContainFavorites bool `url:"contain[favorite],omitempty"` ContainModifier bool `url:"contain[modifier],omitempty"` ContainSecret bool `url:"contain[secret],omitempty"` ContainResourceType bool `url:"contain[resource-type],omitempty"` ContainPermissions bool `url:"contain[permission],omitempty"` ContainPermissionsUserProfile bool `url:"contain[permissions.user.profile],omitempty"` ContainPermissionsGroup bool `url:"contain[permissions.group],omitempty"` ContainTags bool `url:"contain[tag],omitempty"` }
GetResourcesOptions are all available query parameters
type GetUsersOptions ¶
type GetUsersOptions struct { FilterSearch string `url:"filter[search],omitempty"` FilterHasGroup []string `url:"filter[has-group][],omitempty"` FilterHasAccess []string `url:"filter[has-access][],omitempty"` FilterIsAdmin bool `url:"filter[is-admin],omitempty"` ContainLastLoggedIn bool `url:"contain[LastLoggedIn],omitempty"` }
GetUsersOptions are all available query parameters
type Group ¶
type Group struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Created *Time `json:"created,omitempty"` CreatedBy string `json:"created_by,omitempty"` Deleted bool `json:"deleted,omitempty"` Modified *Time `json:"modified,omitempty"` ModifiedBy string `json:"modified_by,omitempty"` // This does not Contain Profile for Users Anymore... GroupUsers []GroupMembership `json:"groups_users,omitempty"` // This is new and undocumented but as all the data Users []GroupUser `json:"users,omitempty"` }
Group is a Group
type GroupJoinData ¶
type GroupMembership ¶
type GroupMembership struct { ID string `json:"id,omitempty"` UserID string `json:"user_id,omitempty"` GroupID string `json:"group_id,omitempty"` IsAdmin bool `json:"is_admin,omitempty"` Delete bool `json:"delete,omitempty"` User User `json:"user,omitempty"` Created *Time `json:"created,omitempty"` }
type GroupSecret ¶
type GroupSecret struct {
Secret []Secret `json:"secret,omitempty"`
}
GroupSecret is a unnessesary container...
type GroupUpdate ¶
type GroupUpdate struct { Name string `json:"name,omitempty"` GroupChanges []GroupMembership `json:"groups_users,omitempty"` Secrets []Secret `json:"secrets,omitempty"` }
type GroupUser ¶
type GroupUser struct { User JoinData GroupJoinData `json:"_join_data,omitempty"` }
type MFAChallenge ¶
type MFAChallenge struct {
Provider MFAProviders `json:"providers,omitempty"`
}
type MFAChallengeResponse ¶
type MFAChallengeResponse struct {
TOTP string `json:"totp,omitempty"`
}
type MFAProviders ¶
type MFAProviders struct {
TOTP string `json:"totp,omitempty"`
}
type Permission ¶
type Permission struct { ID string `json:"id,omitempty"` ACO string `json:"aco,omitempty"` ARO string `json:"aro,omitempty"` ACOForeignKey string `json:"aco_foreign_key,omitempty"` AROForeignKey string `json:"aro_foreign_key,omitempty"` Type int `json:"type,omitempty"` Delete bool `json:"delete,omitempty"` IsNew bool `json:"is_new,omitempty"` Created *Time `json:"created,omitempty"` Modified *Time `json:"modified,omitempty"` }
Permission is a Permission
type Profile ¶
type Profile struct { ID string `json:"id,omitempty"` UserID string `json:"user_id,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Created *Time `json:"created,omitempty"` Modified *Time `json:"modified,omitempty"` }
Profile is a Profile
type PublicKeyReponse ¶
type PublicKeyReponse struct { Fingerprint string `json:"fingerprint"` Keydata string `json:"keydata"` }
PublicKeyReponse the Body of a Public Key Api Request
type Resource ¶
type Resource struct { ID string `json:"id,omitempty"` Created *Time `json:"created,omitempty"` CreatedBy string `json:"created_by,omitempty"` Creator *User `json:"creator,omitempty"` Deleted bool `json:"deleted,omitempty"` Description string `json:"description,omitempty"` Favorite *Favorite `json:"favorite,omitempty"` Modified *Time `json:"modified,omitempty"` ModifiedBy string `json:"modified_by,omitempty"` Modifier *User `json:"modifier,omitempty"` Name string `json:"name,omitempty"` Permission *Permission `json:"permission,omitempty"` URI string `json:"uri,omitempty"` Username string `json:"username,omitempty"` FolderParentID string `json:"folder_parent_id,omitempty"` ResourceTypeID string `json:"resource_type_id,omitempty"` ResourceType ResourceType `json:"resource_type,omitempty"` Secrets []Secret `json:"secrets,omitempty"` Tags []Tag `json:"tags,omitempty"` }
Resource is a Resource. Warning: Since Cipherguard v3 some fields here may not be populated as they may be in the Secret depending on the ResourceType, for now the only Field like that is the Description.
type ResourceShareRequest ¶
type ResourceShareRequest struct {}
ResourceShareRequest is a ResourceShareRequest
type ResourceShareSimulationChange ¶
type ResourceShareSimulationChange struct {
}ResourceShareSimulationChange is a single change
type ResourceShareSimulationChanges ¶
type ResourceShareSimulationChanges struct {}
ResourceShareSimulationChanges contains the Actual Changes
type ResourceShareSimulationResult ¶
type ResourceShareSimulationResult struct {
}ResourceShareSimulationResult is the Result of a Sharing Simulation
type ResourceShareSimulationUser ¶
type ResourceShareSimulationUser struct {
}ResourceShareSimulationUser contains the users id
type ResourceType ¶
type ResourceType struct { ID string `json:"id,omitempty"` Slug string `json:"slug,omitempty"` Description string `json:"description,omitempty"` Definition json.RawMessage `json:"definition,omitempty"` Created *Time `json:"created,omitempty"` Modified *Time `json:"modified,omitempty"` }
ResourceType is the Type of a Resource
type ResourceTypeSchema ¶
type ResourceTypeSchema struct { Resource json.RawMessage `json:"resource"` Secret json.RawMessage `json:"secret"` }
type Role ¶
type Role struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Created *Time `json:"created,omitempty"` Description string `json:"description,omitempty"` Modified *Time `json:"modified,omitempty"` Avatar Avatar `json:"avatar,omitempty"` }
Role is a Role
type SearchAROsOptions ¶
type SearchAROsOptions struct {
FilterSearch string `url:"filter[search],omitempty"`
}
SearchAROsOptions are all available query parameters
type Secret ¶
type Secret struct { ID string `json:"id,omitempty"` UserID string `json:"user_id,omitempty"` ResourceID string `json:"resource_id,omitempty"` Data string `json:"data,omitempty"` Created *Time `json:"created,omitempty"` Modified *Time `json:"modified,omitempty"` }
Secret is a Secret
type SecretDataTOTP ¶
type SecretDataTypePasswordAndDescription ¶
type SecretDataTypePasswordAndDescription struct { Password string `json:"password"` Description string `json:"description,omitempty"` }
SecretDataTypePasswordAndDescription is the format a secret of resource type "password-and-description" is stored in
type SecretDataTypePasswordDescriptionTOTP ¶
type SecretDataTypePasswordDescriptionTOTP struct { Password string `json:"password"` Description string `json:"description,omitempty"` TOTP SecretDataTOTP `json:"totp"` }
SecretDataTypePasswordDescriptionTOTP is the format a secret of resource type "password-description-totp" is stored in
type SecretDataTypeTOTP ¶
type SecretDataTypeTOTP struct {
TOTP SecretDataTOTP `json:"totp"`
}
SecretDataTypeTOTP is the format a secret of resource type "totp" is stored in
type SetupCompleteRequest ¶
type SetupCompleteRequest struct { AuthenticationToken AuthenticationToken `json:"authenticationtoken,omitempty"` GPGKey GPGKey `json:"gpgkey,omitempty"` User User `json:"user,omitempty"` }
type SetupInstallResponse ¶
type SetupInstallResponse struct {
User `json:"user,omitempty"`
}
type Time ¶
Time is here to unmarshall time correctly
func (Time) MarshalJSON ¶
MarshalJSON Marshals Cipherguard *Time
func (*Time) UnmarshalJSON ¶
UnmarshalJSON Parses Cipherguard *Time
type UpdateGroupDryRun ¶
type UpdateGroupDryRun struct { // for which users the secrets need to be reencrypted SecretsNeeded []UpdateGroupSecretsNeededContainer `json:"SecretsNeeded,omitempty"` // secrets needed to be reencrypted Secrets []GroupSecret `json:"Secrets,omitempty"` }
UpdateGroupDryRun contains the Actual Secrets Needed to update the group
type UpdateGroupDryRunResult ¶
type UpdateGroupDryRunResult struct {
DryRun UpdateGroupDryRun `json:"dry-run,omitempty"`
}
UpdateGroupDryRunResult is the Result of a Update Group DryRun
type UpdateGroupDryRunSecretsNeeded ¶
type UpdateGroupDryRunSecretsNeeded struct { ResourceID string `json:"resource_id,omitempty"` UserID string `json:"user_id,omitempty"` }
UpdateGroupDryRunSecretsNeeded a secret that needs to be reencrypted for a specific user
type UpdateGroupSecretsNeededContainer ¶
type UpdateGroupSecretsNeededContainer struct {
Secret UpdateGroupDryRunSecretsNeeded `json:"Secret,omitempty"`
}
UpdateGroupSecretsNeededContainer is a unnessesary container...
type User ¶
type User struct { ID string `json:"id,omitempty"` Created *Time `json:"created,omitempty"` Active bool `json:"active,omitempty"` Deleted bool `json:"deleted,omitempty"` Description string `json:"description,omitempty"` Favorite *Favorite `json:"favorite,omitempty"` Modified *Time `json:"modified,omitempty"` Username string `json:"username,omitempty"` RoleID string `json:"role_id,omitempty"` Profile *Profile `json:"profile,omitempty"` Role *Role `json:"role,omitempty"` GPGKey *GPGKey `json:"gpgKey,omitempty"` LastLoggedIn string `json:"last_logged_in,omitempty"` Locale string `json:"locale,omitempty"` }
User contains information about a cipherguard User