Documentation ¶
Index ¶
- Constants
- func CheckResponse(resp *http.Response) error
- func DecryptString(s string, mk CryptoKey) (string, error)
- func DecryptValue(s string, mk CryptoKey) ([]byte, error)
- func EncryptString(s string, mk CryptoKey) (string, error)
- func EncryptValue(v []byte, mk CryptoKey) (string, error)
- func HashPassword(password string, key CryptoKey) string
- type Account
- type AccountService
- type CardData
- type Cipher
- type CipherData
- type CipherDetailsResponse
- type CipherMiniDetailsResponse
- type CipherMiniResponse
- type CipherRequest
- type CipherResponse
- type CipherService
- type CipherString
- type Client
- type CryptoKey
- type Decryptable
- type Domains
- type ErrorResponse
- type FieldData
- type Folder
- type FolderService
- type GlobalEquivalentDomains
- type HttpErrorResponse
- type IdentityData
- type Keys
- type List
- type LoginData
- type Profile
- type ProfileOrganizationResponse
- type ProfileResponse
- type Response
- type SecureNoteData
- type SyncData
- type SyncService
- type Time
- type User
Constants ¶
View Source
const ( AesCbc256_B64 = iota AesCbc128_HmacSha256_B64 = iota AesCbc256_HmacSha256_B64 = iota Rsa2048_OaepSha256_B64 = iota Rsa2048_OaepSha1_B64 = iota Rsa2048_OaepSha256_HmacSha256_B64 = iota Rsa2048_OaepSha1_HmacSha256_B64 = iota )
View Source
const ( CipherType_Folder = iota CipherType_Login = iota CipherType_SecureNote = iota CipherType_Card = iota CipherType_Identity = iota )
View Source
const ( FieldType_Text = iota FieldType_Hidden = iota FieldType_Boolean = iota )
View Source
const (
PATH_FOLDERS = "folders"
)
View Source
const (
PATH_SYNC = "sync"
)
View Source
const (
SecureNoteType_Generic = iota
)
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
func HashPassword ¶
Types ¶
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
func (*AccountService) GetProfile ¶
func (c *AccountService) GetProfile() (Account, error)
type Cipher ¶
type Cipher struct { Type int FolderId *string // Must be pointer to output null in json. Android app will crash if not null OrganizationId *string Favorite bool Edit bool Id string `json:"Id,omitempty"` Login *LoginData `json:"Login,omitempty"` Card *CardData `json:"Card,omitempty"` SecureNote *SecureNoteData `json:"SecureNote,omitempty"` Identity *IdentityData `json:"Identity,omitempty"` Attachments []string OrganizationUseTotp bool RevisionDate *Time `json:"RevisionDate,omitempty"` }
The data we store
func (*Cipher) MarshalData ¶
func (*Cipher) UnMarshalData ¶
type CipherData ¶
type CipherDetailsResponse ¶
type CipherDetailsResponse struct { CipherResponse CollectionIds []string }
func NewCipherDetailsResponse ¶
func NewCipherDetailsResponse(cipher Cipher) CipherDetailsResponse
func (*CipherDetailsResponse) ToCipher ¶
func (cdr *CipherDetailsResponse) ToCipher() Cipher
type CipherMiniDetailsResponse ¶
type CipherMiniDetailsResponse struct { CipherMiniResponse CollectionIds []string }
func NewCipherMiniDetailsResponse ¶
func NewCipherMiniDetailsResponse(cipher Cipher) CipherMiniDetailsResponse
func (*CipherMiniDetailsResponse) ToCipher ¶
func (cmdr *CipherMiniDetailsResponse) ToCipher() Cipher
type CipherMiniResponse ¶
type CipherMiniResponse struct { Response Id string OrganizationId *string Type int Data interface{} Attachments []string RevisionDate *Time }
func NewCipherMiniResponse ¶
func NewCipherMiniResponse(cipher Cipher) CipherMiniResponse
func (*CipherMiniResponse) ToCipher ¶
func (cmr *CipherMiniResponse) ToCipher() Cipher
type CipherRequest ¶
type CipherRequest struct { Type int OrganizationId *string FolderId *string Favorite bool Name *string Notes *string Fields *[]FieldData Attachments *[]string Login *LoginData `json:"Login,omitempty"` Card *CardData `json:"Card,omitempty"` SecureNote *SecureNoteData `json:"SecureNote,omitempty"` Identity *IdentityData `json:"Identity,omitempty"` RevisionDate *Time }
Experimental Request objects
func (*CipherRequest) FromCipher ¶
func (cr *CipherRequest) FromCipher(c Cipher) error
func (*CipherRequest) ToCipher ¶
func (cr *CipherRequest) ToCipher() (Cipher, error)
type CipherResponse ¶
type CipherResponse struct { CipherMiniResponse FolderId *string // Must be pointer to output null in json. Android app will crash if not null Favorite bool Edit bool OrganizationUseTotp bool }
func NewCipherResponse ¶
func NewCipherResponse(cipher Cipher) CipherResponse
func (*CipherResponse) ToCipher ¶
func (cmr *CipherResponse) ToCipher() Cipher
type CipherService ¶
type CipherService struct {
// contains filtered or unexported fields
}
func (*CipherService) AddCipher ¶
func (c *CipherService) AddCipher(cipher *Cipher) (*Cipher, error)
func (*CipherService) DeleteCipher ¶
func (c *CipherService) DeleteCipher(cipher *Cipher) (*Cipher, error)
func (*CipherService) ListCiphers ¶
func (c *CipherService) ListCiphers() ([]Cipher, error)
func (*CipherService) UpdateCipher ¶
func (c *CipherService) UpdateCipher(cipher *Cipher) (*Cipher, error)
type CipherString ¶
type CipherString struct {
// contains filtered or unexported fields
}
func MakeEncKey ¶
func MakeEncKey(key []byte) (*CipherString, error)
func NewCipherString ¶
func NewCipherString(encryptedString string) (*CipherString, error)
func NewCipherStringRaw ¶
func (*CipherString) DecryptKey ¶
func (cs *CipherString) DecryptKey(key CryptoKey, encryptionType int) (CryptoKey, error)
func (*CipherString) ToString ¶
func (cs *CipherString) ToString() string
type Client ¶
type Client struct { // BaseURL for API requests. APIBaseURL *url.URL IdentityBaseURL *url.URL WebVaultBaseURL *url.URL IconsBaseURL *url.URL // UserAgent used when communicating with the Bitwarden API. UserAgent string // Services Cipher *CipherService Folder *FolderService Account *AccountService Sync *SyncService // Set to true to output debugging logs during API calls Debug bool // contains filtered or unexported fields }
type Decryptable ¶
type Domains ¶
type Domains struct { EquivalentDomains []string GlobalEquivalentDomains []GlobalEquivalentDomains Object string }
type ErrorResponse ¶
type FolderService ¶
type FolderService struct {
// contains filtered or unexported fields
}
func (*FolderService) AddFolder ¶
func (c *FolderService) AddFolder(folder *Folder) (*Folder, error)
func (*FolderService) DeleteFolder ¶
func (c *FolderService) DeleteFolder(folder *Folder) (*Folder, error)
func (*FolderService) ListFolders ¶
func (c *FolderService) ListFolders() ([]Folder, error)
func (*FolderService) UpdateFolder ¶
func (c *FolderService) UpdateFolder(folder *Folder) (*Folder, error)
type GlobalEquivalentDomains ¶
type HttpErrorResponse ¶
type HttpErrorResponse struct { HttpResponse *http.Response ErrorResponse }
func (*HttpErrorResponse) Error ¶
func (r *HttpErrorResponse) Error() string
Error implements the error interface.
type IdentityData ¶
type IdentityData struct { CipherData Title *string FirstName *string MiddleName *string LastName *string Address1 *string Address2 *string Address3 *string City *string State *string PostalCode *string Country *string Company *string Email *string Phone *string SSN *string Username *string PassportNumber *string LicenseNumber *string }
type LoginData ¶
type LoginData struct { CipherData URI *string `json:"Uri"` Username *string `json:"Username"` Password *string `json:"Password"` ToTp *string `json:"Totp"` }
type ProfileOrganizationResponse ¶
type ProfileOrganizationResponse struct { }
type ProfileResponse ¶
type ProfileResponse struct { Response Id string Name string Email string EmailVerified bool Premium bool MasterPasswordHint *string Culture string TwoFactorEnabled bool Key string PrivateKey string SecurityStamp *string Organizations *[]ProfileOrganizationResponse }
func NewProfileResponse ¶
func NewProfileResponse(user Account) ProfileResponse
type SecureNoteData ¶
type SecureNoteData struct { CipherData Type *string // is int, but sent as string from web }
type SyncData ¶
type SyncData struct { Profile Profile Folders []Folder Ciphers []CipherDetailsResponse `json:"Ciphers,omitempty"` Domains Domains Object string }
type SyncService ¶
type SyncService struct {
// contains filtered or unexported fields
}
func (*SyncService) GetSync ¶
func (c *SyncService) GetSync() (SyncData, error)
type User ¶
type User struct { Id string Name string Email string EmailVerified bool MasterPassword string MasterPasswordHint string Culture string SecurityStamp string TwoFactorProviders string TwoFactorRecoveryCode string EquivalentDomains string ExcludedGlobalEquivalentDomains string AccountRevisionDate Time Key string PublicKey string PrivateKey string //Premium bool //PremiumExpirationDate Time //Storage int MaxStorageGb int //Gateway int //GatewayCustomerId string //GatewaySubscriptionId string CreationDate Time RevisionDate Time }
Click to show internal directories.
Click to hide internal directories.