Documentation ¶
Index ¶
- Variables
- type Auth
- type AuthUseCase
- type Secrets
- type SecretsUseCase
- func (uc *SecretsUseCase) Delete(ctx context.Context, token string, id uuid.UUID) error
- func (uc *SecretsUseCase) EditBinary(ctx context.Context, token string, id uuid.UUID, name, description string, ...) error
- func (uc *SecretsUseCase) EditCard(ctx context.Context, token string, id uuid.UUID, name, description string, ...) error
- func (uc *SecretsUseCase) EditCreds(ctx context.Context, token string, id uuid.UUID, name, description string, ...) error
- func (uc *SecretsUseCase) EditText(ctx context.Context, token string, id uuid.UUID, name, description string, ...) error
- func (uc *SecretsUseCase) Get(ctx context.Context, token string, id uuid.UUID) (*goph.Secret, proto.Message, error)
- func (uc *SecretsUseCase) List(ctx context.Context, token string) ([]*goph.Secret, error)
- func (uc *SecretsUseCase) PushBinary(ctx context.Context, token, name, description string, binary []byte) (uuid.UUID, error)
- func (uc *SecretsUseCase) PushCard(ctx context.Context, token, name, description string, ...) (uuid.UUID, error)
- func (uc *SecretsUseCase) PushCreds(ctx context.Context, token, name, description, login, password string) (uuid.UUID, error)
- func (uc *SecretsUseCase) PushText(ctx context.Context, token, name, description, text string) (uuid.UUID, error)
- type UseCases
- type Users
- type UsersUseCase
Constants ¶
This section is empty.
Variables ¶
var ErrKindMismatch = errors.New("secret kind doesn't match")
Functions ¶
This section is empty.
Types ¶
type AuthUseCase ¶
type AuthUseCase struct {
// contains filtered or unexported fields
}
AuthUseCase contains business logic related to authentication.
func NewAuthUseCase ¶
func NewAuthUseCase( auth repo.Auth, ) *AuthUseCase
NewAuthUseCase create and initializes new AuthUseCase object.
type Secrets ¶
type Secrets interface { PushBinary(ctx context.Context, token, name, description string, binary []byte) (uuid.UUID, error) PushCard( ctx context.Context, token, name, description string, number, expiration, holder string, cvv int32, ) (uuid.UUID, error) PushCreds(ctx context.Context, token, name, description, login, password string) (uuid.UUID, error) PushText(ctx context.Context, token, name, description, text string) (uuid.UUID, error) List(ctx context.Context, token string) ([]*goph.Secret, error) Get(ctx context.Context, token string, id uuid.UUID) (*goph.Secret, proto.Message, error) EditBinary( ctx context.Context, token string, id uuid.UUID, name, description string, noDescription bool, binary []byte, ) error EditCard( ctx context.Context, token string, id uuid.UUID, name, description string, noDescription bool, number, expiration, holder string, cvv int32, ) error EditCreds( ctx context.Context, token string, id uuid.UUID, name, description string, noDescription bool, login, password string, ) error EditText( ctx context.Context, token string, id uuid.UUID, name, description string, noDescription bool, text string, ) error Delete(ctx context.Context, token string, id uuid.UUID) error }
type SecretsUseCase ¶
type SecretsUseCase struct {
// contains filtered or unexported fields
}
SecretsUseCase contains business logic related to secrets management.
func NewSecretsUseCase ¶
func NewSecretsUseCase(key entity.Key, secrets repo.Secrets) *SecretsUseCase
NewSecretsUseCase create and initializes new SecretsUseCase object.
func (*SecretsUseCase) EditBinary ¶
func (uc *SecretsUseCase) EditBinary( ctx context.Context, token string, id uuid.UUID, name, description string, noDescription bool, binary []byte, ) error
EditBinary changes parameters of stored binary secret.
func (*SecretsUseCase) EditCard ¶
func (uc *SecretsUseCase) EditCard( ctx context.Context, token string, id uuid.UUID, name, description string, noDescription bool, number, expiration, holder string, cvv int32, ) error
EditCard changes parameters of stored bank card.
func (*SecretsUseCase) EditCreds ¶
func (uc *SecretsUseCase) EditCreds( ctx context.Context, token string, id uuid.UUID, name, description string, noDescription bool, login, password string, ) error
EditCreds changes parameters of stored credentials.
func (*SecretsUseCase) EditText ¶
func (uc *SecretsUseCase) EditText( ctx context.Context, token string, id uuid.UUID, name, description string, noDescription bool, text string, ) error
EditText changes parameters of stored text secret.
func (*SecretsUseCase) Get ¶
func (uc *SecretsUseCase) Get( ctx context.Context, token string, id uuid.UUID, ) (*goph.Secret, proto.Message, error)
Get retrieves full user's secret. All sensitive parts are decrypted.
func (*SecretsUseCase) List ¶
List returns list of user's secrets. All sensitive parts are decrypted.
func (*SecretsUseCase) PushBinary ¶
func (uc *SecretsUseCase) PushBinary( ctx context.Context, token, name, description string, binary []byte, ) (uuid.UUID, error)
PushBinary creates new secret with arbitrary binary data.
func (*SecretsUseCase) PushCard ¶
func (uc *SecretsUseCase) PushCard( ctx context.Context, token, name, description string, number, expiration, holder string, cvv int32, ) (uuid.UUID, error)
PushCard creates new secret containing bank card data.
type UsersUseCase ¶
type UsersUseCase struct {
// contains filtered or unexported fields
}
UsersUseCase contains business logic related to users management.
func NewUsersUseCase ¶
func NewUsersUseCase(users repo.Users) *UsersUseCase
NewUsersUseCase create and initializes new UsersUseCase object.