Versions in this module Expand all Collapse all v0 v0.0.12 May 17, 2019 Changes in this version + func MoveSecretToVault(ctx context.Context, s *Secret, source, target *Vault) error type Vault + func (v Vault) GetSecretsAllVersions(ctx context.Context) ([]*Secret, error) v0.0.11 Feb 20, 2019 v0.0.10 Feb 18, 2019 v0.0.9 Dec 28, 2018 v0.0.8 Dec 12, 2018 v0.0.7 Oct 25, 2018 v0.0.6 Oct 19, 2018 v0.0.5 Oct 17, 2018 v0.0.4 Oct 9, 2018 v0.0.3 Sep 27, 2018 Changes in this version type Invite + func FindInvitesForEmail(ctx context.Context, email string) (invs []*Invite, err error) v0.0.2 Sep 21, 2018 Changes in this version type Vault + func (v *Vault) AddSecretList(ctx context.Context, sl []*Secret) error v0.0.1 Sep 13, 2018 Changes in this version + const DEFAULT_VAULT_NAME + const TOKEN_VERIFICATION + var ErrAlreadyExists = errors.New("Already exists") + var ErrAlreadyInTeam = errors.New("Already belongs to team") + var ErrAlreadyInvited = errors.New("Alredy invited") + var ErrDoesntExist = errors.New("Does not exist") + var ErrInvalidAttributes = errors.New("Invalid attributes") + var ErrInvalidEmail = errors.New("Invalid email") + var ErrInvalidKeys = errors.New("Invalid keys for vault") + var ErrInvalidPublicKey = errors.New("Invalid public key length") + var ErrInvalidSignature = errors.New("Invalid signature") + var ErrNotInTeam = errors.New("User does not belong to team") + var ErrUnauthorized = errors.New("You cannot do that") + var HASH_PASSWD_COST = 14 + func AddDBToContext(ctx context.Context, d *sql.DB) context.Context + func GetDB(ctx context.Context) *sql.DB + func IsDuplicateErr(err error) bool + func NewUser(ctx context.Context, id, fullname, email, password string, keyPack []byte, ...) (*User, *Token, error) + type Invite struct + CreatedAt time.Time + Email string + Team string + type Secret struct + CreatedAt time.Time + Data []byte + Id string + Team string + Vault string + VaultVersion uint32 + Version uint32 + type Team struct + CreatedAt time.Time + Id string + Name string + Owner string + Primary bool + Size int + UpdatedAt time.Time + func (t *Team) AddOrInviteUserByEmail(ctx context.Context, admin *User, newcomerEmail string) (i *Invite, err error) + func (t *Team) CheckAdmin(ctx context.Context, u *User) (isAdmin bool, err error) + func (t *Team) CreateVault(ctx context.Context, u *User, name string, signedVaultKeys VaultKeyPair) (v *Vault, err error) + func (t *Team) DemoteUser(ctx context.Context, demoter *User, demotee *User) error + func (t *Team) GetSecretsForUser(ctx context.Context, u *User) (s []*Secret, err error) + func (t *Team) GetTeamFull(ctx context.Context, u *User) (tf *TeamFull, err error) + func (t *Team) GetUsersAfiliationFull(ctx context.Context) (tuf []*TeamUserFull, err error) + func (t *Team) GetVaultForUser(ctx context.Context, vid string, u *User) (*Vault, error) + func (t *Team) GetVaultsForUser(ctx context.Context, u *User) (vs []*Vault, err error) + func (t *Team) GetVaultsFullForUser(ctx context.Context, u *User) (vf []*VaultFull, err error) + func (t *Team) PromoteUser(ctx context.Context, promoter *User, promotee *User, ...) error + type TeamFull struct + Invites []*Invite + Users []*TeamUserFull + Vaults []*VaultFull + type TeamUserFull struct + AccessRequired bool + Admin bool + FullName string + PublicKey []byte + Team string + User string + type Token struct + CreatedAt time.Time + Extra string + Id string + Type int + UpdatedAt time.Time + User string + func FindToken(ctx context.Context, id string) (*Token, error) + func FindTokensForUser(ctx context.Context, user string) (tokens []*Token) + func (t *Token) ConfirmEmail(ctx context.Context) (u *User, err error) + type User struct + ConfirmedAt pq.NullTime + CreatedAt time.Time + Email string + FailedAttempts int + FullName string + HashPass []byte + Id string + Key []byte + LockedAt pq.NullTime + PublicKey []byte + SignInCount int + UnconfirmedEmail string + UpdatedAt time.Time + func FindUser(ctx context.Context, id string) (u *User, err error) + func FindUserByEmail(ctx context.Context, email string) (u *User, err error) + func (u *User) ChangeEmail(ctx context.Context, email string) (t *Token, err error) + func (u *User) ChangePassword(ctx context.Context, password string, keyPack []byte) error + func (u *User) CheckPassword(pass string) error + func (u *User) CreateTeam(ctx context.Context, name string, signedVaultKeys VaultKeyPair) (t *Team, err error) + func (u *User) GetTeam(ctx context.Context, tid string) (t *Team, err error) + func (u *User) GetTeamFull(ctx context.Context, tid string) (tf *TeamFull, err error) + func (u *User) GetTeams(ctx context.Context) ([]*Team, error) + func (u *User) GetUserFull(ctx context.Context) (*UserFull, error) + func (u *User) GetVerificationToken(ctx context.Context) (t *Token, err error) + type UserFull struct + Teams []*Team + type Vault struct + CreatedAt time.Time + Id string + PublicKey []byte + Team string + UpdatedAt time.Time + Version uint32 + func (v *Vault) AddSecret(ctx context.Context, s *Secret) error + func (v *Vault) DeleteSecret(ctx context.Context, sid string) error + func (v *Vault) GetVaultFullForUser(ctx context.Context, u *User) (vf *VaultFull, err error) + func (v *Vault) UpdateSecret(ctx context.Context, s *Secret) error + func (v Vault) AddUsers(ctx context.Context, userKeys map[string][]byte) error + func (v Vault) GetSecret(ctx context.Context, sid string) (s *Secret, err error) + func (v Vault) GetSecrets(ctx context.Context) ([]*Secret, error) + func (v Vault) GetUserIds(ctx context.Context) (uids []string, err error) + func (v Vault) RemoveUser(ctx context.Context, username string) error + type VaultFull struct + Key []byte + Users []string + type VaultKeyPair struct + Keys map[string][]byte + PublicKey []byte