keymanager

package
v0.0.0-...-d06eb38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2025 License: AGPL-3.0 Imports: 18 Imported by: 1

Documentation

Overview

Package keymanager is a generated GoMock package.

Package keymanager is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type BlockChecker

type BlockChecker interface {
	ChangeAllowed(context.Context) error
	RemoveAllowed(context.Context) error
}

type KeyManagerAPI

type KeyManagerAPI struct {
	// contains filtered or unexported fields
}

KeyManagerAPI provides api endpoints for manipulating ssh keys

func (*KeyManagerAPI) AddKeys

AddKeys adds new authorised ssh keys for the specified user.

func (*KeyManagerAPI) DeleteKeys

DeleteKeys deletes the authorised ssh keys for the specified user.

func (*KeyManagerAPI) ImportKeys

ImportKeys imports new authorised ssh keys from the specified key ids for the specified user.

func (*KeyManagerAPI) ListKeys

func (api *KeyManagerAPI) ListKeys(
	ctx context.Context,
	arg params.ListSSHKeys,
) (params.StringsResults, error)

ListKeys returns the authorised ssh keys for the specified users.

type KeyManagerService

type KeyManagerService interface {
	// AddPublicKeysForUser is responsible for adding one or more new public
	// keys for a user to the current model.
	AddPublicKeysForUser(context.Context, user.UUID, ...string) error

	// DeleteKeysForUser is responsible removing one ore more keys from a user
	// within this model. Keys are identified by either the comment,
	// public key data or the fingerprint.
	DeleteKeysForUser(context.Context, user.UUID, ...string) error

	// ImportPublicKeysForUser is responsible for importing keys against a Juju
	// user for the current model from a third party source identified in the
	// url.
	ImportPublicKeysForUser(context.Context, user.UUID, *url.URL) error

	// ListPublicKeysForUser is responsible returning all of the public keys
	// for a user within the current model.
	ListPublicKeysForUser(context.Context, user.UUID) ([]coressh.PublicKey, error)
}

KeyManagerService is the interface for the service this facade requires to perform crud operations on a users public ssh keys within a model.

type MockBlockChecker

type MockBlockChecker struct {
	// contains filtered or unexported fields
}

MockBlockChecker is a mock of BlockChecker interface.

func NewMockBlockChecker

func NewMockBlockChecker(ctrl *gomock.Controller) *MockBlockChecker

NewMockBlockChecker creates a new mock instance.

func (*MockBlockChecker) ChangeAllowed

func (m *MockBlockChecker) ChangeAllowed(arg0 context.Context) error

ChangeAllowed mocks base method.

func (*MockBlockChecker) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBlockChecker) RemoveAllowed

func (m *MockBlockChecker) RemoveAllowed(arg0 context.Context) error

RemoveAllowed mocks base method.

type MockBlockCheckerChangeAllowedCall

type MockBlockCheckerChangeAllowedCall struct {
	*gomock.Call
}

MockBlockCheckerChangeAllowedCall wrap *gomock.Call

func (*MockBlockCheckerChangeAllowedCall) Do

Do rewrite *gomock.Call.Do

func (*MockBlockCheckerChangeAllowedCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockBlockCheckerChangeAllowedCall) Return

Return rewrite *gomock.Call.Return

type MockBlockCheckerMockRecorder

type MockBlockCheckerMockRecorder struct {
	// contains filtered or unexported fields
}

MockBlockCheckerMockRecorder is the mock recorder for MockBlockChecker.

func (*MockBlockCheckerMockRecorder) ChangeAllowed

ChangeAllowed indicates an expected call of ChangeAllowed.

func (*MockBlockCheckerMockRecorder) RemoveAllowed

RemoveAllowed indicates an expected call of RemoveAllowed.

type MockBlockCheckerRemoveAllowedCall

type MockBlockCheckerRemoveAllowedCall struct {
	*gomock.Call
}

MockBlockCheckerRemoveAllowedCall wrap *gomock.Call

func (*MockBlockCheckerRemoveAllowedCall) Do

Do rewrite *gomock.Call.Do

func (*MockBlockCheckerRemoveAllowedCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockBlockCheckerRemoveAllowedCall) Return

Return rewrite *gomock.Call.Return

type MockKeyManagerService

type MockKeyManagerService struct {
	// contains filtered or unexported fields
}

MockKeyManagerService is a mock of KeyManagerService interface.

func NewMockKeyManagerService

func NewMockKeyManagerService(ctrl *gomock.Controller) *MockKeyManagerService

NewMockKeyManagerService creates a new mock instance.

func (*MockKeyManagerService) AddPublicKeysForUser

func (m *MockKeyManagerService) AddPublicKeysForUser(arg0 context.Context, arg1 user.UUID, arg2 ...string) error

AddPublicKeysForUser mocks base method.

func (*MockKeyManagerService) DeleteKeysForUser

func (m *MockKeyManagerService) DeleteKeysForUser(arg0 context.Context, arg1 user.UUID, arg2 ...string) error

DeleteKeysForUser mocks base method.

func (*MockKeyManagerService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockKeyManagerService) ImportPublicKeysForUser

func (m *MockKeyManagerService) ImportPublicKeysForUser(arg0 context.Context, arg1 user.UUID, arg2 *url.URL) error

ImportPublicKeysForUser mocks base method.

func (*MockKeyManagerService) ListPublicKeysForUser

func (m *MockKeyManagerService) ListPublicKeysForUser(arg0 context.Context, arg1 user.UUID) ([]ssh.PublicKey, error)

ListPublicKeysForUser mocks base method.

type MockKeyManagerServiceAddPublicKeysForUserCall

type MockKeyManagerServiceAddPublicKeysForUserCall struct {
	*gomock.Call
}

MockKeyManagerServiceAddPublicKeysForUserCall wrap *gomock.Call

func (*MockKeyManagerServiceAddPublicKeysForUserCall) Do

Do rewrite *gomock.Call.Do

func (*MockKeyManagerServiceAddPublicKeysForUserCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockKeyManagerServiceAddPublicKeysForUserCall) Return

Return rewrite *gomock.Call.Return

type MockKeyManagerServiceDeleteKeysForUserCall

type MockKeyManagerServiceDeleteKeysForUserCall struct {
	*gomock.Call
}

MockKeyManagerServiceDeleteKeysForUserCall wrap *gomock.Call

func (*MockKeyManagerServiceDeleteKeysForUserCall) Do

Do rewrite *gomock.Call.Do

func (*MockKeyManagerServiceDeleteKeysForUserCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockKeyManagerServiceDeleteKeysForUserCall) Return

Return rewrite *gomock.Call.Return

type MockKeyManagerServiceImportPublicKeysForUserCall

type MockKeyManagerServiceImportPublicKeysForUserCall struct {
	*gomock.Call
}

MockKeyManagerServiceImportPublicKeysForUserCall wrap *gomock.Call

func (*MockKeyManagerServiceImportPublicKeysForUserCall) Do

Do rewrite *gomock.Call.Do

func (*MockKeyManagerServiceImportPublicKeysForUserCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockKeyManagerServiceImportPublicKeysForUserCall) Return

Return rewrite *gomock.Call.Return

type MockKeyManagerServiceListPublicKeysForUserCall

type MockKeyManagerServiceListPublicKeysForUserCall struct {
	*gomock.Call
}

MockKeyManagerServiceListPublicKeysForUserCall wrap *gomock.Call

func (*MockKeyManagerServiceListPublicKeysForUserCall) Do

Do rewrite *gomock.Call.Do

func (*MockKeyManagerServiceListPublicKeysForUserCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockKeyManagerServiceListPublicKeysForUserCall) Return

Return rewrite *gomock.Call.Return

type MockKeyManagerServiceMockRecorder

type MockKeyManagerServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockKeyManagerServiceMockRecorder is the mock recorder for MockKeyManagerService.

func (*MockKeyManagerServiceMockRecorder) AddPublicKeysForUser

func (mr *MockKeyManagerServiceMockRecorder) AddPublicKeysForUser(arg0, arg1 any, arg2 ...any) *MockKeyManagerServiceAddPublicKeysForUserCall

AddPublicKeysForUser indicates an expected call of AddPublicKeysForUser.

func (*MockKeyManagerServiceMockRecorder) DeleteKeysForUser

func (mr *MockKeyManagerServiceMockRecorder) DeleteKeysForUser(arg0, arg1 any, arg2 ...any) *MockKeyManagerServiceDeleteKeysForUserCall

DeleteKeysForUser indicates an expected call of DeleteKeysForUser.

func (*MockKeyManagerServiceMockRecorder) ImportPublicKeysForUser

func (mr *MockKeyManagerServiceMockRecorder) ImportPublicKeysForUser(arg0, arg1, arg2 any) *MockKeyManagerServiceImportPublicKeysForUserCall

ImportPublicKeysForUser indicates an expected call of ImportPublicKeysForUser.

func (*MockKeyManagerServiceMockRecorder) ListPublicKeysForUser

ListPublicKeysForUser indicates an expected call of ListPublicKeysForUser.

type MockUserService

type MockUserService struct {
	// contains filtered or unexported fields
}

MockUserService is a mock of UserService interface.

func NewMockUserService

func NewMockUserService(ctrl *gomock.Controller) *MockUserService

NewMockUserService creates a new mock instance.

func (*MockUserService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserService) GetUserByName

func (m *MockUserService) GetUserByName(arg0 context.Context, arg1 user.Name) (user.User, error)

GetUserByName mocks base method.

type MockUserServiceGetUserByNameCall

type MockUserServiceGetUserByNameCall struct {
	*gomock.Call
}

MockUserServiceGetUserByNameCall wrap *gomock.Call

func (*MockUserServiceGetUserByNameCall) Do

Do rewrite *gomock.Call.Do

func (*MockUserServiceGetUserByNameCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockUserServiceGetUserByNameCall) Return

Return rewrite *gomock.Call.Return

type MockUserServiceMockRecorder

type MockUserServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockUserServiceMockRecorder is the mock recorder for MockUserService.

func (*MockUserServiceMockRecorder) GetUserByName

func (mr *MockUserServiceMockRecorder) GetUserByName(arg0, arg1 any) *MockUserServiceGetUserByNameCall

GetUserByName indicates an expected call of GetUserByName.

type UserService

type UserService interface {
	// GetUserByName find thes the Juju identified by their username and returns
	// the internal user representation matching that username.
	GetUserByName(context.Context, user.Name) (user.User, error)
}

UserService is the interface for the service this facade requires to lookup users by their username in exchange for the internal information we know about

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL