Documentation ¶
Index ¶
- Constants
- Variables
- type ApiError
- type Client
- type Config
- type CreateGroupRequest
- type CreateGroupResponse
- type CreatePasswordRequest
- type CreatePasswordResponse
- type CreateProjectRequest
- type CreateProjectResponse
- type CreateUserRequest
- type CreateUserResponse
- type CustomField
- type ErrorResponse
- type ExpireStatus
- type GetGroupResponse
- type Group
- type GroupClient
- func (c GroupClient) AddUserToGroup(groupID, userID int) error
- func (c GroupClient) Create(request CreateGroupRequest) (CreateGroupResponse, error)
- func (c GroupClient) Delete(ID int) error
- func (c GroupClient) DeleteUserFromGroup(groupID, userID int) error
- func (c GroupClient) Get(ID int) (GetGroupResponse, error)
- func (c GroupClient) Update(ID int, request UpdateGroupRequest) error
- type GroupPermission
- type LockingRequestNotify
- type LockingType
- type LongDate
- type Password
- type PasswordAccess
- type PasswordClient
- func (c PasswordClient) Create(createPasswordRequest CreatePasswordRequest) (CreatePasswordResponse, error)
- func (c PasswordClient) Delete(passwordID int) error
- func (c PasswordClient) Find(field string) ([]Password, error)
- func (c PasswordClient) Get(passwordID int) (PasswordData, error)
- func (c PasswordClient) Update(passwordID int, createPasswordRequest UpdatePasswordRequest) error
- func (c PasswordClient) UpdatePasswordSecurity(passwordID int, updatePasswordSecurity UpdatePasswordSecurityRequest) error
- type PasswordData
- type PasswordPermission
- type Permission
- type ProjectClient
- type ProjectData
- type ShortDate
- type TLSConfig
- type Tags
- type UpdateGroupRequest
- type UpdatePasswordRequest
- type UpdatePasswordSecurityRequest
- type UpdateProjectRequest
- type User
- type UserClient
- type UserPermission
- type UserRole
Constants ¶
View Source
const ( AuthHeaderPublicKey = "X-Public-Key" AuthHeaderRequestHash = "X-Request-Hash" AuthHeaderRequestTimestamp = "X-Request-Timestamp" )
View Source
const ( DefaultApiVersion = "v5" DefaultTLSSkipVerify = false )
View Source
const ( ShortDateTimeFormat = "2006-01-02" LongDateTimeFormat = "2006-01-02 15:04:05" )
Variables ¶
View Source
var ( ErrPasswordNameIsRequired = errors.New("password name is a required") ErrProjectIDIsRequired = errors.New("project id is a required") ErrPasswordNotFound = errors.New("the password does not exist or you cannot access it") ErrProjectNotFound = errors.New("the project does not exist or you cannot access it") ErrProjectNameIsRequired = errors.New("project name is a required") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) CreateResource ¶ added in v0.5.0
func (Client) DeleteResource ¶ added in v0.5.0
func (Client) GetResource ¶ added in v0.5.0
type CreateGroupRequest ¶ added in v0.4.0
type CreateGroupRequest struct {
Name string `json:"name"`
}
type CreateGroupResponse ¶ added in v0.4.0
type CreateGroupResponse struct {
ID int `json:"id"`
}
type CreatePasswordRequest ¶
type CreatePasswordRequest struct { Name string `json:"name,omitempty"` ProjectID int `json:"project_id"` Tags Tags `json:"tags"` AccessInfo string `json:"access_info"` Username string `json:"username"` Email string `json:"email"` Password string `json:"password"` ExpiryDate ShortDate `json:"expiry_date"` Notes string `json:"notes"` CustomData1 string `json:"custom_data1"` CustomData2 string `json:"custom_data2"` CustomData3 string `json:"custom_data3"` CustomData4 string `json:"custom_data4"` CustomData5 string `json:"custom_data5"` CustomData6 string `json:"custom_data6"` CustomData7 string `json:"custom_data7"` CustomData8 string `json:"custom_data8"` CustomData9 string `json:"custom_data9"` CustomData10 string `json:"custom_data10"` }
https://teampasswordmanager.com/docs/api-passwords#create_password
type CreatePasswordResponse ¶
type CreatePasswordResponse struct {
ID int `json:"id,omitempty"`
}
type CreateProjectRequest ¶
type CreateProjectResponse ¶
type CreateProjectResponse struct {
ID int `json:"id,omitempty"`
}
type CreateUserRequest ¶ added in v0.4.0
type CreateUserResponse ¶ added in v0.4.0
type CreateUserResponse struct {
ID int `json:"id"`
}
type CustomField ¶
type ErrorResponse ¶
type ExpireStatus ¶ added in v0.4.0
type ExpireStatus int
const ( NotExpired ExpireStatus = iota ExpiresToday Expired ExpiresSoon )
func (ExpireStatus) String ¶ added in v0.4.0
func (i ExpireStatus) String() string
type GetGroupResponse ¶ added in v0.5.0
type GetGroupResponse struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` IsLdap bool `json:"is_ldap,omitempty"` LdapServerID int `json:"ldap_server_id,omitempty"` GroupDn string `json:"group_dn,omitempty"` Users []User `json:"users,omitempty"` CreatedOn LongDate `json:"created_on,omitempty"` CreatedBy User `json:"created_by,omitempty"` UpdatedOn LongDate `json:"updated_on,omitempty"` UpdatedBy User `json:"updated_by,omitempty"` }
type GroupClient ¶ added in v0.4.0
type GroupClient struct {
// contains filtered or unexported fields
}
func NewGroupClient ¶ added in v0.4.0
func NewGroupClient(c Config) GroupClient
func (GroupClient) AddUserToGroup ¶ added in v0.5.0
func (c GroupClient) AddUserToGroup(groupID, userID int) error
func (GroupClient) Create ¶ added in v0.4.0
func (c GroupClient) Create(request CreateGroupRequest) (CreateGroupResponse, error)
func (GroupClient) Delete ¶ added in v0.4.0
func (c GroupClient) Delete(ID int) error
func (GroupClient) DeleteUserFromGroup ¶ added in v0.5.0
func (c GroupClient) DeleteUserFromGroup(groupID, userID int) error
func (GroupClient) Get ¶ added in v0.5.0
func (c GroupClient) Get(ID int) (GetGroupResponse, error)
func (GroupClient) Update ¶ added in v0.5.0
func (c GroupClient) Update(ID int, request UpdateGroupRequest) error
type GroupPermission ¶ added in v0.4.0
type GroupPermission struct { Group Group `json:"groupt,omitempty"` Permission Permission `json:"permission,omitempty"` }
type LockingRequestNotify ¶ added in v0.4.0
type LockingRequestNotify int
const ( // TODO: Think how to handle clashing name issue with LockingRequestNotify PasswordNotLocked LockingRequestNotify = iota NotifyManager NotifyAll )
func (LockingRequestNotify) String ¶ added in v0.4.0
func (i LockingRequestNotify) String() string
type LockingType ¶ added in v0.4.0
type LockingType int
const ( NotLocked LockingType = iota RequiresReasonToUnlock RequiresPermissionToUnlock )
func (LockingType) String ¶ added in v0.4.0
func (i LockingType) String() string
type LongDate ¶ added in v0.4.0
func (LongDate) MarshalJSON ¶ added in v0.4.0
func (*LongDate) UnmarshalJSON ¶ added in v0.4.0
type PasswordAccess ¶ added in v0.4.0
type PasswordAccess int
const ( PasswordAccessNoAccess PasswordAccess = 0 PasswordAccessRead PasswordAccess = 10 PasswordAccessEdit PasswordAccess = 20 PasswordAccessManage PasswordAccess = 30 )
type PasswordClient ¶
type PasswordClient struct {
// contains filtered or unexported fields
}
func NewPasswordClient ¶
func NewPasswordClient(c Config) PasswordClient
func (PasswordClient) Create ¶
func (c PasswordClient) Create(createPasswordRequest CreatePasswordRequest) (CreatePasswordResponse, error)
func (PasswordClient) Delete ¶
func (c PasswordClient) Delete(passwordID int) error
func (PasswordClient) Get ¶
func (c PasswordClient) Get(passwordID int) (PasswordData, error)
func (PasswordClient) Update ¶
func (c PasswordClient) Update(passwordID int, createPasswordRequest UpdatePasswordRequest) error
func (PasswordClient) UpdatePasswordSecurity ¶ added in v0.4.0
func (c PasswordClient) UpdatePasswordSecurity( passwordID int, updatePasswordSecurity UpdatePasswordSecurityRequest, ) error
type PasswordData ¶
type PasswordData struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Project struct { Name string `json:"name,omitempty"` ID int `json:"id,omitempty"` } `json:"project,omitempty"` Tags Tags `json:"tags"` AccessInfo string `json:"access_info,omitempty"` Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` Password string `json:"password,omitempty"` ExpiryDate ShortDate `json:"expiry_date,omitempty"` ExpiryStatus ExpireStatus `json:"expiry_status,omitempty"` Notes string `json:"notes,omitempty"` CustomField1 *CustomField `json:"custom_field1,omitempty"` CustomField2 *CustomField `json:"custom_field2,omitempty"` CustomField3 *CustomField `json:"custom_field3,omitempty"` CustomField4 *CustomField `json:"custom_field4,omitempty"` CustomField5 *CustomField `json:"custom_field5,omitempty"` CustomField6 *CustomField `json:"custom_field6,omitempty"` CustomField7 *CustomField `json:"custom_field7,omitempty"` CustomField8 *CustomField `json:"custom_field8,omitempty"` CustomField9 *CustomField `json:"custom_field9,omitempty"` CustomField10 *CustomField `json:"custom_field10,omitempty"` UsersPermissions []UserPermission `json:"users_permissions,omitempty"` GroupsPermissions []GroupPermission `json:"groups_permissions,omitempty"` Parents []int `json:"parents,omitempty"` UserPermission Permission `json:"user_permission,omitempty"` Archived bool `json:"archived,omitempty"` ProjectArchived bool `json:"project_archived,omitempty"` Favorite bool `json:"favorite,omitempty"` NumberOfFiles int `json:"num_files,omitempty"` Locked bool `json:"locked,omitempty"` LockingType LockingType `json:"locking_type,omitempty"` LockingRequestNotify LockingRequestNotify `json:"locking_request_notify,omitempty"` ExternalSharing bool `json:"external_sharing,omitempty"` ExternalURL string `json:"external_url,omitempty"` Linked bool `json:"linked,omitempty"` SourcePasswordID int `json:"source_password_id,omitempty"` ManagedBy User `json:"managed_by,omitempty"` CreatedOn LongDate `json:"created_on,omitempty"` CreatedBy User `json:"created_by,omitempty"` UpdatedOn LongDate `json:"updated_on,omitempty"` UpdatedBy User `json:"updated_by,omitempty"` }
https://teampasswordmanager.com/docs/api-passwords/#show_password
type PasswordPermission ¶ added in v0.4.0
type PasswordPermission [2]int
func NewPasswordPermission ¶ added in v0.4.0
func NewPasswordPermission(ID int, access PasswordAccess) PasswordPermission
type Permission ¶ added in v0.4.0
type ProjectClient ¶
type ProjectClient struct {
// contains filtered or unexported fields
}
func NewProjectClient ¶
func NewProjectClient(c Config) ProjectClient
func (ProjectClient) Create ¶
func (c ProjectClient) Create(r CreateProjectRequest) (CreateProjectResponse, error)
func (ProjectClient) Delete ¶
func (c ProjectClient) Delete(ID int) error
func (ProjectClient) Get ¶
func (c ProjectClient) Get(ID int) (ProjectData, error)
func (ProjectClient) Update ¶
func (c ProjectClient) Update(ID int, r UpdateProjectRequest) error
type ProjectData ¶
type ShortDate ¶ added in v0.4.0
func (ShortDate) MarshalJSON ¶ added in v0.4.0
func (*ShortDate) UnmarshalJSON ¶ added in v0.4.0
type UpdateGroupRequest ¶ added in v0.5.0
type UpdateGroupRequest struct {
Name string `json:"name"`
}
type UpdatePasswordRequest ¶
type UpdatePasswordRequest struct { Name string `json:"name"` Tags Tags `json:"tags"` AccessInfo string `json:"access_info"` Username string `json:"username,"` Email string `json:"email,"` Password string `json:"password"` ExpiryDate ShortDate `json:"expiry_date"` Notes string `json:"notes"` CustomData1 string `json:"custom_data1"` CustomData2 string `json:"custom_data2"` CustomData3 string `json:"custom_data3"` CustomData4 string `json:"custom_data4"` CustomData5 string `json:"custom_data5"` CustomData6 string `json:"custom_data6"` CustomData7 string `json:"custom_data7"` CustomData8 string `json:"custom_data8"` CustomData9 string `json:"custom_data9"` CustomData10 string `json:"custom_data10"` }
https://teampasswordmanager.com/docs/api-passwords#update_password
type UpdatePasswordSecurityRequest ¶ added in v0.4.0
type UpdatePasswordSecurityRequest struct { ManagedBy int `json:"managed_by,omitempty"` UsersPermissions []PasswordPermission `json:"users_permissions"` GroupsPermissions []PasswordPermission `json:"groups_permissions"` }
type UpdateProjectRequest ¶
type UserClient ¶ added in v0.4.0
type UserClient struct {
// contains filtered or unexported fields
}
func NewUserClient ¶ added in v0.4.0
func NewUserClient(c Config) UserClient
func (UserClient) Create ¶ added in v0.4.0
func (c UserClient) Create(request CreateUserRequest) (CreateUserResponse, error)
func (UserClient) Delete ¶ added in v0.4.0
func (c UserClient) Delete(ID int) error
type UserPermission ¶ added in v0.4.0
type UserPermission struct { User User `json:"user,omitempty"` Permission Permission `json:"permission,omitempty"` }
type UserRole ¶ added in v0.4.0
type UserRole string
const ( // UserRoleAdmin role owners can do anything. UserRoleAdmin UserRole = "admin" // UserRoleProjectManager role owners are like normal users and also create/delete projects. UserRoleProjectManager UserRole = "project manager" // UserRoleNormalUser role owners work with passwords and projects, but not create/delete projects. UserRoleNormalUser UserRole = "normal user" // UserRoleReadOnly role owners only read passwords on assigned projects. UserRoleReadOnly UserRole = "read only" // UserRoleReadOnly role owners like a project manager plus access to Users/Groups, Log and Settings. read passwords on assigned projects. UserRoleIT UserRole = "it" )
Click to show internal directories.
Click to hide internal directories.