auth

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommandsTo

func AddCommandsTo(rootCmd *cobra.Command)

AddCommandsTo builds the auth commands and adds them to the root command

func AuthStatus

func AuthStatus(cmd *cobra.Command, _ []string, noColor bool, outputFormat string) error

AuthStatus authenticates with the Megaport API and displays the current user identity.

Types

type MockUserManagementService

type MockUserManagementService struct {
	ListUsersErr    error
	ListUsersResult []*megaport.User
}

MockUserManagementService provides a mock for testing auth commands.

func (*MockUserManagementService) CreateUser

Stubs for the full UserManagementService interface

func (*MockUserManagementService) DeactivateUser

func (m *MockUserManagementService) DeactivateUser(_ context.Context, _ int) error

func (*MockUserManagementService) DeleteUser

func (m *MockUserManagementService) DeleteUser(_ context.Context, _ int) error

func (*MockUserManagementService) GetUser

func (*MockUserManagementService) GetUserActivity

func (*MockUserManagementService) ListCompanyUsers

func (m *MockUserManagementService) ListCompanyUsers(_ context.Context) ([]*megaport.User, error)

func (*MockUserManagementService) UpdateUser

type Module

type Module struct{}

Module implements the registry.Module interface for authentication commands

func NewModule

func NewModule() *Module

NewModule creates a new auth module

func (*Module) Name

func (m *Module) Name() string

Name returns the module name

func (*Module) RegisterCommands

func (m *Module) RegisterCommands(rootCmd *cobra.Command)

RegisterCommands adds authentication commands to the root command

Jump to

Keyboard shortcuts

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