bffv1beta1connect

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuthServiceName is the fully-qualified name of the AuthService service.
	AuthServiceName = "lekko.bff.v1beta1.AuthService"
)
View Source
const (
	// BFFServiceName is the fully-qualified name of the BFFService service.
	BFFServiceName = "lekko.bff.v1beta1.BFFService"
)

Variables

This section is empty.

Functions

func NewAuthServiceHandler

func NewAuthServiceHandler(svc AuthServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewAuthServiceHandler 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 NewBFFServiceHandler

func NewBFFServiceHandler(svc BFFServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewBFFServiceHandler 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 AuthServiceClient

type AuthServiceClient interface {
	// We will return required auth info in a cookie
	// that is sent to the same origin for other requests
	// inside the bff service.
	Login(context.Context, *connect_go.Request[v1beta1.LoginRequest]) (*connect_go.Response[v1beta1.LoginResponse], error)
	// Logout will expire the user's cookie.
	Logout(context.Context, *connect_go.Request[v1beta1.LogoutRequest]) (*connect_go.Response[v1beta1.LogoutResponse], error)
	// Returns a response indicating if the account already existed.
	RegisterUser(context.Context, *connect_go.Request[v1beta1.RegisterUserRequest]) (*connect_go.Response[v1beta1.RegisterUserResponse], error)
	// An rpc that a 3rd party device makes to our backend to obtain device and user
	// codes to complete device oauth.
	GetDeviceCode(context.Context, *connect_go.Request[v1beta1.GetDeviceCodeRequest]) (*connect_go.Response[v1beta1.GetDeviceCodeResponse], error)
	// An rpc that a 3rd party device polls to obtain an access token once
	// the user has completed authentication through a browser-based user agent.
	GetAccessToken(context.Context, *connect_go.Request[v1beta1.GetAccessTokenRequest]) (*connect_go.Response[v1beta1.GetAccessTokenResponse], error)
}

AuthServiceClient is a client for the lekko.bff.v1beta1.AuthService service.

func NewAuthServiceClient

func NewAuthServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) AuthServiceClient

NewAuthServiceClient constructs a client for the lekko.bff.v1beta1.AuthService 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 AuthServiceHandler

type AuthServiceHandler interface {
	// We will return required auth info in a cookie
	// that is sent to the same origin for other requests
	// inside the bff service.
	Login(context.Context, *connect_go.Request[v1beta1.LoginRequest]) (*connect_go.Response[v1beta1.LoginResponse], error)
	// Logout will expire the user's cookie.
	Logout(context.Context, *connect_go.Request[v1beta1.LogoutRequest]) (*connect_go.Response[v1beta1.LogoutResponse], error)
	// Returns a response indicating if the account already existed.
	RegisterUser(context.Context, *connect_go.Request[v1beta1.RegisterUserRequest]) (*connect_go.Response[v1beta1.RegisterUserResponse], error)
	// An rpc that a 3rd party device makes to our backend to obtain device and user
	// codes to complete device oauth.
	GetDeviceCode(context.Context, *connect_go.Request[v1beta1.GetDeviceCodeRequest]) (*connect_go.Response[v1beta1.GetDeviceCodeResponse], error)
	// An rpc that a 3rd party device polls to obtain an access token once
	// the user has completed authentication through a browser-based user agent.
	GetAccessToken(context.Context, *connect_go.Request[v1beta1.GetAccessTokenRequest]) (*connect_go.Response[v1beta1.GetAccessTokenResponse], error)
}

AuthServiceHandler is an implementation of the lekko.bff.v1beta1.AuthService service.

type BFFServiceClient

type BFFServiceClient interface {
	// User management
	GetUserLoggedInInfo(context.Context, *connect_go.Request[v1beta1.GetUserLoggedInInfoRequest]) (*connect_go.Response[v1beta1.GetUserLoggedInInfoResponse], error)
	ChangePassword(context.Context, *connect_go.Request[v1beta1.ChangePasswordRequest]) (*connect_go.Response[v1beta1.ChangePasswordResponse], error)
	// Retrieves an oauth access token for the user, and stores in in the database
	OAuthUser(context.Context, *connect_go.Request[v1beta1.OAuthUserRequest]) (*connect_go.Response[v1beta1.OAuthUserResponse], error)
	GetUserOAuth(context.Context, *connect_go.Request[v1beta1.GetUserOAuthRequest]) (*connect_go.Response[v1beta1.GetUserOAuthResponse], error)
	DeleteUserOAuth(context.Context, *connect_go.Request[v1beta1.DeleteUserOAuthRequest]) (*connect_go.Response[v1beta1.DeleteUserOAuthResponse], error)
	AuthorizeDevice(context.Context, *connect_go.Request[v1beta1.AuthorizeDeviceRequest]) (*connect_go.Response[v1beta1.AuthorizeDeviceResponse], error)
	// Generate an API used by SDKs to authenticate with Lekko.
	GenerateAPIKey(context.Context, *connect_go.Request[v1beta1.GenerateAPIKeyRequest]) (*connect_go.Response[v1beta1.GenerateAPIKeyResponse], error)
	ListAPIKeys(context.Context, *connect_go.Request[v1beta1.ListAPIKeysRequest]) (*connect_go.Response[v1beta1.ListAPIKeysResponse], error)
	DeleteAPIKey(context.Context, *connect_go.Request[v1beta1.DeleteAPIKeyRequest]) (*connect_go.Response[v1beta1.DeleteAPIKeyResponse], error)
	// Verifies that the given api key is valid. Note: this is a convenience
	// method. For safety reasons you're only able to check an api key for
	// your currently active team.
	CheckAPIKey(context.Context, *connect_go.Request[v1beta1.CheckAPIKeyRequest]) (*connect_go.Response[v1beta1.CheckAPIKeyResponse], error)
	CreateTeam(context.Context, *connect_go.Request[v1beta1.CreateTeamRequest]) (*connect_go.Response[v1beta1.CreateTeamResponse], error)
	DeleteTeam(context.Context, *connect_go.Request[v1beta1.DeleteTeamRequest]) (*connect_go.Response[v1beta1.DeleteTeamResponse], error)
	UseTeam(context.Context, *connect_go.Request[v1beta1.UseTeamRequest]) (*connect_go.Response[v1beta1.UseTeamResponse], error)
	ListTeamMemberships(context.Context, *connect_go.Request[v1beta1.ListTeamMembershipsRequest]) (*connect_go.Response[v1beta1.ListTeamMembershipsResponse], error)
	ListUserMemberships(context.Context, *connect_go.Request[v1beta1.ListUserMembershipsRequest]) (*connect_go.Response[v1beta1.ListUserMembershipsResponse], error)
	UpsertMembership(context.Context, *connect_go.Request[v1beta1.UpsertMembershipRequest]) (*connect_go.Response[v1beta1.UpsertMembershipResponse], error)
	RemoveMembership(context.Context, *connect_go.Request[v1beta1.RemoveMembershipRequest]) (*connect_go.Response[v1beta1.RemoveMembershipResponse], error)
	CreateRepository(context.Context, *connect_go.Request[v1beta1.CreateRepositoryRequest]) (*connect_go.Response[v1beta1.CreateRepositoryResponse], error)
	DeleteRepository(context.Context, *connect_go.Request[v1beta1.DeleteRepositoryRequest]) (*connect_go.Response[v1beta1.DeleteRepositoryResponse], error)
	ListRepositories(context.Context, *connect_go.Request[v1beta1.ListRepositoriesRequest]) (*connect_go.Response[v1beta1.ListRepositoriesResponse], error)
	// Namespace & feature management
	// Deprecated going forward, use ListRepositoryContents instead.
	//
	// Deprecated: do not use.
	ListNamespaces(context.Context, *connect_go.Request[v1beta1.ListNamespacesRequest]) (*connect_go.Response[v1beta1.ListNamespacesResponse], error)
	// Lists all the features within a repository (and optionally, namespace).
	// Deprecated going forward, use ListRepositoryContents instead.
	//
	// Deprecated: do not use.
	ListFeatures(context.Context, *connect_go.Request[v1beta1.ListFeaturesRequest]) (*connect_go.Response[v1beta1.ListFeaturesResponse], error)
	// Lists all of the namespaces and features in a repository, meant to serve the
	// sidebar of the lekko web app.
	ListRepositoryContents(context.Context, *connect_go.Request[v1beta1.ListRepositoryContentsRequest]) (*connect_go.Response[v1beta1.ListRepositoryContentsResponse], error)
	GetFeature(context.Context, *connect_go.Request[v1beta1.GetFeatureRequest]) (*connect_go.Response[v1beta1.GetFeatureResponse], error)
	GetRepositoryContents(context.Context, *connect_go.Request[v1beta1.GetRepositoryContentsRequest]) (*connect_go.Response[v1beta1.GetRepositoryContentsResponse], error)
	AddNamespace(context.Context, *connect_go.Request[v1beta1.AddNamespaceRequest]) (*connect_go.Response[v1beta1.AddNamespaceResponse], error)
	RemoveNamespace(context.Context, *connect_go.Request[v1beta1.RemoveNamespaceRequest]) (*connect_go.Response[v1beta1.RemoveNamespaceResponse], error)
	AddFeature(context.Context, *connect_go.Request[v1beta1.AddFeatureRequest]) (*connect_go.Response[v1beta1.AddFeatureResponse], error)
	RemoveFeature(context.Context, *connect_go.Request[v1beta1.RemoveFeatureRequest]) (*connect_go.Response[v1beta1.RemoveFeatureResponse], error)
	// Saves a feature to the local repo, and runs compilation.
	// This method relies on static parsing to save content, which is currently
	// not supported for protobuf features.
	Save(context.Context, *connect_go.Request[v1beta1.SaveRequest]) (*connect_go.Response[v1beta1.SaveResponse], error)
	// Saves the raw starlark of a feature to the local repo, and runs compilation.
	SaveStarlark(context.Context, *connect_go.Request[v1beta1.SaveStarlarkRequest]) (*connect_go.Response[v1beta1.SaveStarlarkResponse], error)
	// Helper for Rules AST -> String.
	ConvertRuleToString(context.Context, *connect_go.Request[v1beta1.ConvertRuleToStringRequest]) (*connect_go.Response[v1beta1.ConvertRuleToStringResponse], error)
	// Get info about multiple PRs in a repository
	//
	// Deprecated: do not use.
	GetPRInfo(context.Context, *connect_go.Request[v1beta1.GetPRInfoRequest]) (*connect_go.Response[v1beta1.GetPRInfoResponse], error)
	// Get info about a single PR for the provided branch
	GetPR(context.Context, *connect_go.Request[v1beta1.GetPRRequest]) (*connect_go.Response[v1beta1.GetPRResponse], error)
	// Deprecated, use Merge instead
	//
	// Deprecated: do not use.
	MergePR(context.Context, *connect_go.Request[v1beta1.MergePRRequest]) (*connect_go.Response[v1beta1.MergePRResponse], error)
	CreateBranch(context.Context, *connect_go.Request[v1beta1.CreateBranchRequest]) (*connect_go.Response[v1beta1.CreateBranchResponse], error)
	ListBranches(context.Context, *connect_go.Request[v1beta1.ListBranchesRequest]) (*connect_go.Response[v1beta1.ListBranchesResponse], error)
	DeleteBranch(context.Context, *connect_go.Request[v1beta1.DeleteBranchRequest]) (*connect_go.Response[v1beta1.DeleteBranchResponse], error)
	// Review opens a pull request against main using the currently committed changes.
	Review(context.Context, *connect_go.Request[v1beta1.ReviewRequest]) (*connect_go.Response[v1beta1.ReviewResponse], error)
	// Merges the pull request based on the given session.
	Merge(context.Context, *connect_go.Request[v1beta1.MergeRequest]) (*connect_go.Response[v1beta1.MergeResponse], error)
	// Evaluates the feature based on the given session.
	Eval(context.Context, *connect_go.Request[v1beta1.EvalRequest]) (*connect_go.Response[v1beta1.EvalResponse], error)
	GetFlagEvaluationMetrics(context.Context, *connect_go.Request[v1beta1.GetFlagEvaluationMetricsRequest]) (*connect_go.Response[v1beta1.GetFlagEvaluationMetricsResponse], error)
	// Performs a global restore of the repo, creating a dev session under the hood with the changes.
	Restore(context.Context, *connect_go.Request[v1beta1.RestoreRequest]) (*connect_go.Response[v1beta1.RestoreResponse], error)
	GetRepositoryLogs(context.Context, *connect_go.Request[v1beta1.GetRepositoryLogsRequest]) (*connect_go.Response[v1beta1.GetRepositoryLogsResponse], error)
	GetRollout(context.Context, *connect_go.Request[v1beta1.GetRolloutRequest]) (*connect_go.Response[v1beta1.GetRolloutResponse], error)
}

BFFServiceClient is a client for the lekko.bff.v1beta1.BFFService service.

func NewBFFServiceClient

func NewBFFServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) BFFServiceClient

NewBFFServiceClient constructs a client for the lekko.bff.v1beta1.BFFService 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 BFFServiceHandler

type BFFServiceHandler interface {
	// User management
	GetUserLoggedInInfo(context.Context, *connect_go.Request[v1beta1.GetUserLoggedInInfoRequest]) (*connect_go.Response[v1beta1.GetUserLoggedInInfoResponse], error)
	ChangePassword(context.Context, *connect_go.Request[v1beta1.ChangePasswordRequest]) (*connect_go.Response[v1beta1.ChangePasswordResponse], error)
	// Retrieves an oauth access token for the user, and stores in in the database
	OAuthUser(context.Context, *connect_go.Request[v1beta1.OAuthUserRequest]) (*connect_go.Response[v1beta1.OAuthUserResponse], error)
	GetUserOAuth(context.Context, *connect_go.Request[v1beta1.GetUserOAuthRequest]) (*connect_go.Response[v1beta1.GetUserOAuthResponse], error)
	DeleteUserOAuth(context.Context, *connect_go.Request[v1beta1.DeleteUserOAuthRequest]) (*connect_go.Response[v1beta1.DeleteUserOAuthResponse], error)
	AuthorizeDevice(context.Context, *connect_go.Request[v1beta1.AuthorizeDeviceRequest]) (*connect_go.Response[v1beta1.AuthorizeDeviceResponse], error)
	// Generate an API used by SDKs to authenticate with Lekko.
	GenerateAPIKey(context.Context, *connect_go.Request[v1beta1.GenerateAPIKeyRequest]) (*connect_go.Response[v1beta1.GenerateAPIKeyResponse], error)
	ListAPIKeys(context.Context, *connect_go.Request[v1beta1.ListAPIKeysRequest]) (*connect_go.Response[v1beta1.ListAPIKeysResponse], error)
	DeleteAPIKey(context.Context, *connect_go.Request[v1beta1.DeleteAPIKeyRequest]) (*connect_go.Response[v1beta1.DeleteAPIKeyResponse], error)
	// Verifies that the given api key is valid. Note: this is a convenience
	// method. For safety reasons you're only able to check an api key for
	// your currently active team.
	CheckAPIKey(context.Context, *connect_go.Request[v1beta1.CheckAPIKeyRequest]) (*connect_go.Response[v1beta1.CheckAPIKeyResponse], error)
	CreateTeam(context.Context, *connect_go.Request[v1beta1.CreateTeamRequest]) (*connect_go.Response[v1beta1.CreateTeamResponse], error)
	DeleteTeam(context.Context, *connect_go.Request[v1beta1.DeleteTeamRequest]) (*connect_go.Response[v1beta1.DeleteTeamResponse], error)
	UseTeam(context.Context, *connect_go.Request[v1beta1.UseTeamRequest]) (*connect_go.Response[v1beta1.UseTeamResponse], error)
	ListTeamMemberships(context.Context, *connect_go.Request[v1beta1.ListTeamMembershipsRequest]) (*connect_go.Response[v1beta1.ListTeamMembershipsResponse], error)
	ListUserMemberships(context.Context, *connect_go.Request[v1beta1.ListUserMembershipsRequest]) (*connect_go.Response[v1beta1.ListUserMembershipsResponse], error)
	UpsertMembership(context.Context, *connect_go.Request[v1beta1.UpsertMembershipRequest]) (*connect_go.Response[v1beta1.UpsertMembershipResponse], error)
	RemoveMembership(context.Context, *connect_go.Request[v1beta1.RemoveMembershipRequest]) (*connect_go.Response[v1beta1.RemoveMembershipResponse], error)
	CreateRepository(context.Context, *connect_go.Request[v1beta1.CreateRepositoryRequest]) (*connect_go.Response[v1beta1.CreateRepositoryResponse], error)
	DeleteRepository(context.Context, *connect_go.Request[v1beta1.DeleteRepositoryRequest]) (*connect_go.Response[v1beta1.DeleteRepositoryResponse], error)
	ListRepositories(context.Context, *connect_go.Request[v1beta1.ListRepositoriesRequest]) (*connect_go.Response[v1beta1.ListRepositoriesResponse], error)
	// Namespace & feature management
	// Deprecated going forward, use ListRepositoryContents instead.
	//
	// Deprecated: do not use.
	ListNamespaces(context.Context, *connect_go.Request[v1beta1.ListNamespacesRequest]) (*connect_go.Response[v1beta1.ListNamespacesResponse], error)
	// Lists all the features within a repository (and optionally, namespace).
	// Deprecated going forward, use ListRepositoryContents instead.
	//
	// Deprecated: do not use.
	ListFeatures(context.Context, *connect_go.Request[v1beta1.ListFeaturesRequest]) (*connect_go.Response[v1beta1.ListFeaturesResponse], error)
	// Lists all of the namespaces and features in a repository, meant to serve the
	// sidebar of the lekko web app.
	ListRepositoryContents(context.Context, *connect_go.Request[v1beta1.ListRepositoryContentsRequest]) (*connect_go.Response[v1beta1.ListRepositoryContentsResponse], error)
	GetFeature(context.Context, *connect_go.Request[v1beta1.GetFeatureRequest]) (*connect_go.Response[v1beta1.GetFeatureResponse], error)
	GetRepositoryContents(context.Context, *connect_go.Request[v1beta1.GetRepositoryContentsRequest]) (*connect_go.Response[v1beta1.GetRepositoryContentsResponse], error)
	AddNamespace(context.Context, *connect_go.Request[v1beta1.AddNamespaceRequest]) (*connect_go.Response[v1beta1.AddNamespaceResponse], error)
	RemoveNamespace(context.Context, *connect_go.Request[v1beta1.RemoveNamespaceRequest]) (*connect_go.Response[v1beta1.RemoveNamespaceResponse], error)
	AddFeature(context.Context, *connect_go.Request[v1beta1.AddFeatureRequest]) (*connect_go.Response[v1beta1.AddFeatureResponse], error)
	RemoveFeature(context.Context, *connect_go.Request[v1beta1.RemoveFeatureRequest]) (*connect_go.Response[v1beta1.RemoveFeatureResponse], error)
	// Saves a feature to the local repo, and runs compilation.
	// This method relies on static parsing to save content, which is currently
	// not supported for protobuf features.
	Save(context.Context, *connect_go.Request[v1beta1.SaveRequest]) (*connect_go.Response[v1beta1.SaveResponse], error)
	// Saves the raw starlark of a feature to the local repo, and runs compilation.
	SaveStarlark(context.Context, *connect_go.Request[v1beta1.SaveStarlarkRequest]) (*connect_go.Response[v1beta1.SaveStarlarkResponse], error)
	// Helper for Rules AST -> String.
	ConvertRuleToString(context.Context, *connect_go.Request[v1beta1.ConvertRuleToStringRequest]) (*connect_go.Response[v1beta1.ConvertRuleToStringResponse], error)
	// Get info about multiple PRs in a repository
	//
	// Deprecated: do not use.
	GetPRInfo(context.Context, *connect_go.Request[v1beta1.GetPRInfoRequest]) (*connect_go.Response[v1beta1.GetPRInfoResponse], error)
	// Get info about a single PR for the provided branch
	GetPR(context.Context, *connect_go.Request[v1beta1.GetPRRequest]) (*connect_go.Response[v1beta1.GetPRResponse], error)
	// Deprecated, use Merge instead
	//
	// Deprecated: do not use.
	MergePR(context.Context, *connect_go.Request[v1beta1.MergePRRequest]) (*connect_go.Response[v1beta1.MergePRResponse], error)
	CreateBranch(context.Context, *connect_go.Request[v1beta1.CreateBranchRequest]) (*connect_go.Response[v1beta1.CreateBranchResponse], error)
	ListBranches(context.Context, *connect_go.Request[v1beta1.ListBranchesRequest]) (*connect_go.Response[v1beta1.ListBranchesResponse], error)
	DeleteBranch(context.Context, *connect_go.Request[v1beta1.DeleteBranchRequest]) (*connect_go.Response[v1beta1.DeleteBranchResponse], error)
	// Review opens a pull request against main using the currently committed changes.
	Review(context.Context, *connect_go.Request[v1beta1.ReviewRequest]) (*connect_go.Response[v1beta1.ReviewResponse], error)
	// Merges the pull request based on the given session.
	Merge(context.Context, *connect_go.Request[v1beta1.MergeRequest]) (*connect_go.Response[v1beta1.MergeResponse], error)
	// Evaluates the feature based on the given session.
	Eval(context.Context, *connect_go.Request[v1beta1.EvalRequest]) (*connect_go.Response[v1beta1.EvalResponse], error)
	GetFlagEvaluationMetrics(context.Context, *connect_go.Request[v1beta1.GetFlagEvaluationMetricsRequest]) (*connect_go.Response[v1beta1.GetFlagEvaluationMetricsResponse], error)
	// Performs a global restore of the repo, creating a dev session under the hood with the changes.
	Restore(context.Context, *connect_go.Request[v1beta1.RestoreRequest]) (*connect_go.Response[v1beta1.RestoreResponse], error)
	GetRepositoryLogs(context.Context, *connect_go.Request[v1beta1.GetRepositoryLogsRequest]) (*connect_go.Response[v1beta1.GetRepositoryLogsResponse], error)
	GetRollout(context.Context, *connect_go.Request[v1beta1.GetRolloutRequest]) (*connect_go.Response[v1beta1.GetRolloutResponse], error)
}

BFFServiceHandler is an implementation of the lekko.bff.v1beta1.BFFService service.

type UnimplementedAuthServiceHandler

type UnimplementedAuthServiceHandler struct{}

UnimplementedAuthServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedAuthServiceHandler) Logout added in v0.2.8

type UnimplementedBFFServiceHandler

type UnimplementedBFFServiceHandler struct{}

UnimplementedBFFServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedBFFServiceHandler) GetPR added in v0.2.1

Jump to

Keyboard shortcuts

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