xctfconnect

package
v0.0.0-...-0a0123b Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BackendName is the fully-qualified name of the Backend service.
	BackendName = "xctf.Backend"
	// AdminName is the fully-qualified name of the Admin service.
	AdminName = "xctf.Admin"
)
View Source
const (
	// BackendRegisterProcedure is the fully-qualified name of the Backend's Register RPC.
	BackendRegisterProcedure = "/xctf.Backend/Register"
	// BackendLoginProcedure is the fully-qualified name of the Backend's Login RPC.
	BackendLoginProcedure = "/xctf.Backend/Login"
	// BackendLogoutProcedure is the fully-qualified name of the Backend's Logout RPC.
	BackendLogoutProcedure = "/xctf.Backend/Logout"
	// BackendCurrentUserProcedure is the fully-qualified name of the Backend's CurrentUser RPC.
	BackendCurrentUserProcedure = "/xctf.Backend/CurrentUser"
	// BackendGetComputerProcedure is the fully-qualified name of the Backend's GetComputer RPC.
	BackendGetComputerProcedure = "/xctf.Backend/GetComputer"
	// BackendSubmitFlagProcedure is the fully-qualified name of the Backend's SubmitFlag RPC.
	BackendSubmitFlagProcedure = "/xctf.Backend/SubmitFlag"
	// BackendSubmitEvidenceReportProcedure is the fully-qualified name of the Backend's
	// SubmitEvidenceReport RPC.
	BackendSubmitEvidenceReportProcedure = "/xctf.Backend/SubmitEvidenceReport"
	// BackendGetDiscoveredEvidenceProcedure is the fully-qualified name of the Backend's
	// GetDiscoveredEvidence RPC.
	BackendGetDiscoveredEvidenceProcedure = "/xctf.Backend/GetDiscoveredEvidence"
	// BackendSubmitEvidenceProcedure is the fully-qualified name of the Backend's SubmitEvidence RPC.
	BackendSubmitEvidenceProcedure = "/xctf.Backend/SubmitEvidence"
	// BackendSubmitEvidenceConnectionProcedure is the fully-qualified name of the Backend's
	// SubmitEvidenceConnection RPC.
	BackendSubmitEvidenceConnectionProcedure = "/xctf.Backend/SubmitEvidenceConnection"
	// BackendGetHomePageProcedure is the fully-qualified name of the Backend's GetHomePage RPC.
	BackendGetHomePageProcedure = "/xctf.Backend/GetHomePage"
	// BackendForgotPasswordProcedure is the fully-qualified name of the Backend's ForgotPassword RPC.
	BackendForgotPasswordProcedure = "/xctf.Backend/ForgotPassword"
	// BackendSubmitWriteupProcedure is the fully-qualified name of the Backend's SubmitWriteup RPC.
	BackendSubmitWriteupProcedure = "/xctf.Backend/SubmitWriteup"
	// BackendGetUserWriteupProcedure is the fully-qualified name of the Backend's GetUserWriteup RPC.
	BackendGetUserWriteupProcedure = "/xctf.Backend/GetUserWriteup"
	// BackendGetCompetitionsProcedure is the fully-qualified name of the Backend's GetCompetitions RPC.
	BackendGetCompetitionsProcedure = "/xctf.Backend/GetCompetitions"
	// BackendUpdateCompetitionProcedure is the fully-qualified name of the Backend's UpdateCompetition
	// RPC.
	BackendUpdateCompetitionProcedure = "/xctf.Backend/UpdateCompetition"
	// BackendDeleteCompetitionProcedure is the fully-qualified name of the Backend's DeleteCompetition
	// RPC.
	BackendDeleteCompetitionProcedure = "/xctf.Backend/DeleteCompetition"
	// BackendChallengeTypeProcedure is the fully-qualified name of the Backend's ChallengeType RPC.
	BackendChallengeTypeProcedure = "/xctf.Backend/ChallengeType"
	// BackendSignedURLProcedure is the fully-qualified name of the Backend's SignedURL RPC.
	BackendSignedURLProcedure = "/xctf.Backend/SignedURL"
	// AdminUpsertChallengeProcedure is the fully-qualified name of the Admin's UpsertChallenge RPC.
	AdminUpsertChallengeProcedure = "/xctf.Admin/UpsertChallenge"
	// AdminDeleteChallengeProcedure is the fully-qualified name of the Admin's DeleteChallenge RPC.
	AdminDeleteChallengeProcedure = "/xctf.Admin/DeleteChallenge"
	// AdminGetTeamsProgressProcedure is the fully-qualified name of the Admin's GetTeamsProgress RPC.
	AdminGetTeamsProgressProcedure = "/xctf.Admin/GetTeamsProgress"
	// AdminGetAllChallengesProcedure is the fully-qualified name of the Admin's GetAllChallenges RPC.
	AdminGetAllChallengesProcedure = "/xctf.Admin/GetAllChallenges"
	// AdminSetHomePageProcedure is the fully-qualified name of the Admin's SetHomePage RPC.
	AdminSetHomePageProcedure = "/xctf.Admin/SetHomePage"
	// AdminGetWriteupProcedure is the fully-qualified name of the Admin's GetWriteup RPC.
	AdminGetWriteupProcedure = "/xctf.Admin/GetWriteup"
	// AdminSubmitGradeProcedure is the fully-qualified name of the Admin's SubmitGrade RPC.
	AdminSubmitGradeProcedure = "/xctf.Admin/SubmitGrade"
	// AdminSubmitCommentProcedure is the fully-qualified name of the Admin's SubmitComment RPC.
	AdminSubmitCommentProcedure = "/xctf.Admin/SubmitComment"
	// AdminGetCommentsProcedure is the fully-qualified name of the Admin's GetComments RPC.
	AdminGetCommentsProcedure = "/xctf.Admin/GetComments"
	// AdminGetUserGraphProcedure is the fully-qualified name of the Admin's GetUserGraph RPC.
	AdminGetUserGraphProcedure = "/xctf.Admin/GetUserGraph"
	// AdminSetComputerProcedure is the fully-qualified name of the Admin's SetComputer RPC.
	AdminSetComputerProcedure = "/xctf.Admin/SetComputer"
	// AdminExportChallengeProcedure is the fully-qualified name of the Admin's ExportChallenge RPC.
	AdminExportChallengeProcedure = "/xctf.Admin/ExportChallenge"
	// AdminImportChallengeProcedure is the fully-qualified name of the Admin's ImportChallenge RPC.
	AdminImportChallengeProcedure = "/xctf.Admin/ImportChallenge"
	// AdminReaddirProcedure is the fully-qualified name of the Admin's Readdir RPC.
	AdminReaddirProcedure = "/xctf.Admin/Readdir"
	// AdminRemoveProcedure is the fully-qualified name of the Admin's Remove RPC.
	AdminRemoveProcedure = "/xctf.Admin/Remove"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

Variables

This section is empty.

Functions

func NewAdminHandler

func NewAdminHandler(svc AdminHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewAdminHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewBackendHandler

func NewBackendHandler(svc BackendHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewBackendHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type AdminClient

type AdminClient interface {
	UpsertChallenge(context.Context, *connect_go.Request[xctf.UpsertChallengeRequest]) (*connect_go.Response[xctf.Empty], error)
	DeleteChallenge(context.Context, *connect_go.Request[xctf.DeleteChallengeRequest]) (*connect_go.Response[xctf.Empty], error)
	GetTeamsProgress(context.Context, *connect_go.Request[xctf.GetTeamsProgressRequest]) (*connect_go.Response[xctf.GetTeamsProgressResponse], error)
	GetAllChallenges(context.Context, *connect_go.Request[xctf.GetAllChallengesRequest]) (*connect_go.Response[xctf.GetAllChallengesResponse], error)
	SetHomePage(context.Context, *connect_go.Request[xctf.SetHomePageRequest]) (*connect_go.Response[xctf.Empty], error)
	GetWriteup(context.Context, *connect_go.Request[xctf.GetWriteupRequest]) (*connect_go.Response[xctf.GetWriteupResponse], error)
	SubmitGrade(context.Context, *connect_go.Request[xctf.SubmitGradeRequest]) (*connect_go.Response[xctf.Empty], error)
	SubmitComment(context.Context, *connect_go.Request[xctf.SubmitCommentRequest]) (*connect_go.Response[xctf.Empty], error)
	GetComments(context.Context, *connect_go.Request[xctf.GetCommentsRequest]) (*connect_go.Response[xctf.GetCommentsResponse], error)
	GetUserGraph(context.Context, *connect_go.Request[xctf.GetUserGraphRequest]) (*connect_go.Response[xctf.GetUserGraphResponse], error)
	SetComputer(context.Context, *connect_go.Request[xctf.SetComputerRequest]) (*connect_go.Response[xctf.Empty], error)
	ExportChallenge(context.Context, *connect_go.Request[chalgen.Node]) (*connect_go.Response[xctf.ExportChallengeResponse], error)
	ImportChallenge(context.Context, *connect_go.Request[xctf.ImportChallengeRequest]) (*connect_go.Response[xctf.ImportChallengeResponse], error)
	Readdir(context.Context, *connect_go.Request[xctf.ReaddirRequest]) (*connect_go.Response[xctf.ReaddirResponse], error)
	Remove(context.Context, *connect_go.Request[xctf.RemoveRequest]) (*connect_go.Response[xctf.RemoveResponse], error)
}

AdminClient is a client for the xctf.Admin service.

func NewAdminClient

func NewAdminClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) AdminClient

NewAdminClient constructs a client for the xctf.Admin service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type AdminHandler

type AdminHandler interface {
	UpsertChallenge(context.Context, *connect_go.Request[xctf.UpsertChallengeRequest]) (*connect_go.Response[xctf.Empty], error)
	DeleteChallenge(context.Context, *connect_go.Request[xctf.DeleteChallengeRequest]) (*connect_go.Response[xctf.Empty], error)
	GetTeamsProgress(context.Context, *connect_go.Request[xctf.GetTeamsProgressRequest]) (*connect_go.Response[xctf.GetTeamsProgressResponse], error)
	GetAllChallenges(context.Context, *connect_go.Request[xctf.GetAllChallengesRequest]) (*connect_go.Response[xctf.GetAllChallengesResponse], error)
	SetHomePage(context.Context, *connect_go.Request[xctf.SetHomePageRequest]) (*connect_go.Response[xctf.Empty], error)
	GetWriteup(context.Context, *connect_go.Request[xctf.GetWriteupRequest]) (*connect_go.Response[xctf.GetWriteupResponse], error)
	SubmitGrade(context.Context, *connect_go.Request[xctf.SubmitGradeRequest]) (*connect_go.Response[xctf.Empty], error)
	SubmitComment(context.Context, *connect_go.Request[xctf.SubmitCommentRequest]) (*connect_go.Response[xctf.Empty], error)
	GetComments(context.Context, *connect_go.Request[xctf.GetCommentsRequest]) (*connect_go.Response[xctf.GetCommentsResponse], error)
	GetUserGraph(context.Context, *connect_go.Request[xctf.GetUserGraphRequest]) (*connect_go.Response[xctf.GetUserGraphResponse], error)
	SetComputer(context.Context, *connect_go.Request[xctf.SetComputerRequest]) (*connect_go.Response[xctf.Empty], error)
	ExportChallenge(context.Context, *connect_go.Request[chalgen.Node]) (*connect_go.Response[xctf.ExportChallengeResponse], error)
	ImportChallenge(context.Context, *connect_go.Request[xctf.ImportChallengeRequest]) (*connect_go.Response[xctf.ImportChallengeResponse], error)
	Readdir(context.Context, *connect_go.Request[xctf.ReaddirRequest]) (*connect_go.Response[xctf.ReaddirResponse], error)
	Remove(context.Context, *connect_go.Request[xctf.RemoveRequest]) (*connect_go.Response[xctf.RemoveResponse], error)
}

AdminHandler is an implementation of the xctf.Admin service.

type BackendClient

type BackendClient interface {
	Register(context.Context, *connect_go.Request[xctf.RegisterRequest]) (*connect_go.Response[xctf.RegisterResponse], error)
	Login(context.Context, *connect_go.Request[xctf.LoginRequest]) (*connect_go.Response[xctf.LoginResponse], error)
	Logout(context.Context, *connect_go.Request[xctf.Empty]) (*connect_go.Response[xctf.Empty], error)
	CurrentUser(context.Context, *connect_go.Request[xctf.CurrentUserRequest]) (*connect_go.Response[xctf.CurrentUserResponse], error)
	GetComputer(context.Context, *connect_go.Request[xctf.GetComputerRequest]) (*connect_go.Response[xctf.GetComputerResponse], error)
	SubmitFlag(context.Context, *connect_go.Request[xctf.SubmitFlagRequest]) (*connect_go.Response[xctf.SubmitFlagResponse], error)
	SubmitEvidenceReport(context.Context, *connect_go.Request[xctf.SubmitEvidenceReportRequest]) (*connect_go.Response[xctf.SubmitEvidenceReportRequest], error)
	GetDiscoveredEvidence(context.Context, *connect_go.Request[xctf.GetDiscoveredEvidenceRequest]) (*connect_go.Response[xctf.GetDiscoveredEvidenceResponse], error)
	SubmitEvidence(context.Context, *connect_go.Request[xctf.SubmitEvidenceRequest]) (*connect_go.Response[xctf.SubmitEvidenceResponse], error)
	SubmitEvidenceConnection(context.Context, *connect_go.Request[xctf.SubmitEvidenceConnectionRequest]) (*connect_go.Response[xctf.SubmitEvidenceConnectionResponse], error)
	GetHomePage(context.Context, *connect_go.Request[xctf.GetHomePageRequest]) (*connect_go.Response[xctf.GetHomePageResponse], error)
	ForgotPassword(context.Context, *connect_go.Request[xctf.ForgotPasswordRequest]) (*connect_go.Response[xctf.Empty], error)
	SubmitWriteup(context.Context, *connect_go.Request[xctf.SubmitWriteupRequest]) (*connect_go.Response[xctf.Empty], error)
	GetUserWriteup(context.Context, *connect_go.Request[xctf.Empty]) (*connect_go.Response[xctf.GetUserWriteupResponse], error)
	GetCompetitions(context.Context, *connect_go.Request[xctf.Empty]) (*connect_go.Response[chalgen.CompetitionList], error)
	UpdateCompetition(context.Context, *connect_go.Request[chalgen.Competition]) (*connect_go.Response[chalgen.Competition], error)
	DeleteCompetition(context.Context, *connect_go.Request[chalgen.Competition]) (*connect_go.Response[xctf.Empty], error)
	ChallengeType(context.Context, *connect_go.Request[xctf.Empty]) (*connect_go.Response[xctf.ChallengeTypeResponse], error)
	SignedURL(context.Context, *connect_go.Request[xctf.SignedURLRequest]) (*connect_go.Response[xctf.SignedURLResponse], error)
}

BackendClient is a client for the xctf.Backend service.

func NewBackendClient

func NewBackendClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) BackendClient

NewBackendClient constructs a client for the xctf.Backend service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type BackendHandler

type BackendHandler interface {
	Register(context.Context, *connect_go.Request[xctf.RegisterRequest]) (*connect_go.Response[xctf.RegisterResponse], error)
	Login(context.Context, *connect_go.Request[xctf.LoginRequest]) (*connect_go.Response[xctf.LoginResponse], error)
	Logout(context.Context, *connect_go.Request[xctf.Empty]) (*connect_go.Response[xctf.Empty], error)
	CurrentUser(context.Context, *connect_go.Request[xctf.CurrentUserRequest]) (*connect_go.Response[xctf.CurrentUserResponse], error)
	GetComputer(context.Context, *connect_go.Request[xctf.GetComputerRequest]) (*connect_go.Response[xctf.GetComputerResponse], error)
	SubmitFlag(context.Context, *connect_go.Request[xctf.SubmitFlagRequest]) (*connect_go.Response[xctf.SubmitFlagResponse], error)
	SubmitEvidenceReport(context.Context, *connect_go.Request[xctf.SubmitEvidenceReportRequest]) (*connect_go.Response[xctf.SubmitEvidenceReportRequest], error)
	GetDiscoveredEvidence(context.Context, *connect_go.Request[xctf.GetDiscoveredEvidenceRequest]) (*connect_go.Response[xctf.GetDiscoveredEvidenceResponse], error)
	SubmitEvidence(context.Context, *connect_go.Request[xctf.SubmitEvidenceRequest]) (*connect_go.Response[xctf.SubmitEvidenceResponse], error)
	SubmitEvidenceConnection(context.Context, *connect_go.Request[xctf.SubmitEvidenceConnectionRequest]) (*connect_go.Response[xctf.SubmitEvidenceConnectionResponse], error)
	GetHomePage(context.Context, *connect_go.Request[xctf.GetHomePageRequest]) (*connect_go.Response[xctf.GetHomePageResponse], error)
	ForgotPassword(context.Context, *connect_go.Request[xctf.ForgotPasswordRequest]) (*connect_go.Response[xctf.Empty], error)
	SubmitWriteup(context.Context, *connect_go.Request[xctf.SubmitWriteupRequest]) (*connect_go.Response[xctf.Empty], error)
	GetUserWriteup(context.Context, *connect_go.Request[xctf.Empty]) (*connect_go.Response[xctf.GetUserWriteupResponse], error)
	GetCompetitions(context.Context, *connect_go.Request[xctf.Empty]) (*connect_go.Response[chalgen.CompetitionList], error)
	UpdateCompetition(context.Context, *connect_go.Request[chalgen.Competition]) (*connect_go.Response[chalgen.Competition], error)
	DeleteCompetition(context.Context, *connect_go.Request[chalgen.Competition]) (*connect_go.Response[xctf.Empty], error)
	ChallengeType(context.Context, *connect_go.Request[xctf.Empty]) (*connect_go.Response[xctf.ChallengeTypeResponse], error)
	SignedURL(context.Context, *connect_go.Request[xctf.SignedURLRequest]) (*connect_go.Response[xctf.SignedURLResponse], error)
}

BackendHandler is an implementation of the xctf.Backend service.

type UnimplementedAdminHandler

type UnimplementedAdminHandler struct{}

UnimplementedAdminHandler returns CodeUnimplemented from all methods.

type UnimplementedBackendHandler

type UnimplementedBackendHandler struct{}

UnimplementedBackendHandler returns CodeUnimplemented from all methods.

func (UnimplementedBackendHandler) Logout

Jump to

Keyboard shortcuts

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