Documentation ¶
Index ¶
- Constants
- Variables
- func HasVault(inst *instance.Instance) bool
- func UpdateRevisionDate(inst *instance.Instance, settings *Settings) error
- type Settings
- func (s *Settings) Clone() couchdb.Doc
- func (s *Settings) DocType() string
- func (s *Settings) EnsureCozyOrganization(inst *instance.Instance) error
- func (s *Settings) ID() string
- func (s *Settings) OrganizationKey() ([]byte, error)
- func (s *Settings) Rev() string
- func (s *Settings) Save(inst *instance.Instance) error
- func (s *Settings) SetID(id string)
- func (s *Settings) SetKeyPair(inst *instance.Instance, pub, priv string) error
- func (s *Settings) SetRev(rev string)
Constants ¶
const DocTypeVersion = "1"
DocTypeVersion represents the doctype version. Each time this document structure is modified, update this value
Variables ¶
var ErrMissingOrgKey = errors.New("No organization key")
ErrMissingOrgKey is used when the organization key does not exist
Functions ¶
func UpdateRevisionDate ¶
UpdateRevisionDate updates the updatedAt field of the bitwarden settings document. This field is used to know by some clients to know the date of the last change on the server before doing a full sync.
Types ¶
type Settings ¶
type Settings struct { CouchID string `json:"_id,omitempty"` CouchRev string `json:"_rev,omitempty"` PassphraseKdf int `json:"passphrase_kdf,omitempty"` PassphraseKdfIterations int `json:"passphrase_kdf_iterations,omitempty"` PassphraseHint string `json:"passphrase_hint,omitempty"` SecurityStamp string `json:"security_stamp,omitempty"` Key string `json:"key,omitempty"` PublicKey string `json:"public_key,omitempty"` PrivateKey string `json:"private_key,omitempty"` EncryptedOrgKey string `json:"encrypted_organization_key,omitempty"` OrganizationID string `json:"organization_id,omitempty"` CollectionID string `json:"collection_id,omitempty"` EquivalentDomains [][]string `json:"equivalent_domains,omitempty"` GlobalEquivalentDomains []int `json:"global_equivalent_domains,omitempty"` Metadata *metadata.CozyMetadata `json:"cozyMetadata,omitempty"` ExtensionInstalled bool `json:"extension_installed,omitempty"` }
Settings is the struct that holds the birwarden settings
func (*Settings) EnsureCozyOrganization ¶
EnsureCozyOrganization make sure that the settings for the Cozy organization are set.
func (*Settings) OrganizationKey ¶
OrganizationKey returns the organization key (in clear, not encrypted).
func (*Settings) SetKeyPair ¶
SetKeyPair is used to save the key pair of the user, that will be used to share passwords with the cozy organization.