implement

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

server/pkg/implement/transfer_file.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthInfo

type AuthInfo struct {
	User              string `json:"user"`
	Password          string `json:"password,omitempty"`
	SignedData        string `json:"signed-data,omitempty"`
	PubKeyFingerprint string `json:"pub-key-fingerprint,omitempty"`
	PubKeyAlgorithm   string `json:"pub-key-algorithm,omitempty"`
}

AuthInfo struct for authentication metadata

func GetAuthInfoFromContext

func GetAuthInfoFromContext(ctx context.Context) (*AuthInfo, error)

GetAuthInfoFromContext retrieves authInfo from gRPC metadata

type Server

type Server struct {
	pb.UnimplementedConnectionServiceServer
	SSHAuthenticator *authenicate.SSHAuthenticator
	WhiteList        map[string]bool
}

Server struct implementing pb.ConnectionServiceServer

func NewServer

func NewServer(whiteList map[string]bool, sshAuthenticator *authenicate.SSHAuthenticator) *Server

NewServer creates a new Server instance

func (*Server) AuthenticateStream

func (s *Server) AuthenticateStream(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

AuthenticateStream is a streaming interceptor for authentication

func (*Server) AuthenticateUnary

func (s *Server) AuthenticateUnary(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

AuthenticateUnary is a unary interceptor for authentication

func (*Server) Close

func (s *Server) Close(ctx context.Context, req *pb.CloseRequest) (*pb.CloseResponse, error)

Close method implementation

func (*Server) Connect

func (s *Server) Connect(ctx context.Context, req *pb.ConnectRequest) (*pb.ConnectResponse, error)

Connect method implementation

func (*Server) ExecCommand

func (s *Server) ExecCommand(ctx context.Context, req *pb.CommandRequest) (*pb.CommandResponse, error)

func (*Server) FetchFile

func (s *Server) FetchFile(ctx context.Context, req *pb.FetchFileRequest) (*pb.FetchFileResponse, error)

FetchFile method implementation

func (*Server) PutFile

func (s *Server) PutFile(ctx context.Context, req *pb.PutFileRequest) (*pb.PutFileResponse, error)

PutFile method implementation

func (*Server) TransferFile

func (s *Server) TransferFile(stream pb.ConnectionService_TransferFileServer) error

TransferFile implements the bidirectional streaming RPC for file transfers.

Jump to

Keyboard shortcuts

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