apiv1connect

package
v1.16.1-20240319091308... Latest Latest
Warning

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

Go to latest
Published: unknown License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExperimentalServiceBulkImportRelationshipsProcedure is the fully-qualified name of the
	// ExperimentalService's BulkImportRelationships RPC.
	ExperimentalServiceBulkImportRelationshipsProcedure = "/authzed.api.v1.ExperimentalService/BulkImportRelationships"
	// ExperimentalServiceBulkExportRelationshipsProcedure is the fully-qualified name of the
	// ExperimentalService's BulkExportRelationships RPC.
	ExperimentalServiceBulkExportRelationshipsProcedure = "/authzed.api.v1.ExperimentalService/BulkExportRelationships"
	// ExperimentalServiceBulkCheckPermissionProcedure is the fully-qualified name of the
	// ExperimentalService's BulkCheckPermission RPC.
	ExperimentalServiceBulkCheckPermissionProcedure = "/authzed.api.v1.ExperimentalService/BulkCheckPermission"
)

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.

View Source
const (
	// PermissionsServiceReadRelationshipsProcedure is the fully-qualified name of the
	// PermissionsService's ReadRelationships RPC.
	PermissionsServiceReadRelationshipsProcedure = "/authzed.api.v1.PermissionsService/ReadRelationships"
	// PermissionsServiceWriteRelationshipsProcedure is the fully-qualified name of the
	// PermissionsService's WriteRelationships RPC.
	PermissionsServiceWriteRelationshipsProcedure = "/authzed.api.v1.PermissionsService/WriteRelationships"
	// PermissionsServiceDeleteRelationshipsProcedure is the fully-qualified name of the
	// PermissionsService's DeleteRelationships RPC.
	PermissionsServiceDeleteRelationshipsProcedure = "/authzed.api.v1.PermissionsService/DeleteRelationships"
	// PermissionsServiceCheckPermissionProcedure is the fully-qualified name of the
	// PermissionsService's CheckPermission RPC.
	PermissionsServiceCheckPermissionProcedure = "/authzed.api.v1.PermissionsService/CheckPermission"
	// PermissionsServiceCheckBulkPermissionsProcedure is the fully-qualified name of the
	// PermissionsService's CheckBulkPermissions RPC.
	PermissionsServiceCheckBulkPermissionsProcedure = "/authzed.api.v1.PermissionsService/CheckBulkPermissions"
	// PermissionsServiceExpandPermissionTreeProcedure is the fully-qualified name of the
	// PermissionsService's ExpandPermissionTree RPC.
	PermissionsServiceExpandPermissionTreeProcedure = "/authzed.api.v1.PermissionsService/ExpandPermissionTree"
	// PermissionsServiceLookupResourcesProcedure is the fully-qualified name of the
	// PermissionsService's LookupResources RPC.
	PermissionsServiceLookupResourcesProcedure = "/authzed.api.v1.PermissionsService/LookupResources"
	// PermissionsServiceLookupSubjectsProcedure is the fully-qualified name of the PermissionsService's
	// LookupSubjects RPC.
	PermissionsServiceLookupSubjectsProcedure = "/authzed.api.v1.PermissionsService/LookupSubjects"
)

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.

View Source
const (
	// SchemaServiceReadSchemaProcedure is the fully-qualified name of the SchemaService's ReadSchema
	// RPC.
	SchemaServiceReadSchemaProcedure = "/authzed.api.v1.SchemaService/ReadSchema"
	// SchemaServiceWriteSchemaProcedure is the fully-qualified name of the SchemaService's WriteSchema
	// RPC.
	SchemaServiceWriteSchemaProcedure = "/authzed.api.v1.SchemaService/WriteSchema"
)

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.

View Source
const (
	// ExperimentalServiceName is the fully-qualified name of the ExperimentalService service.
	ExperimentalServiceName = "authzed.api.v1.ExperimentalService"
)
View Source
const (
	// PermissionsServiceName is the fully-qualified name of the PermissionsService service.
	PermissionsServiceName = "authzed.api.v1.PermissionsService"
)
View Source
const (
	// SchemaServiceName is the fully-qualified name of the SchemaService service.
	SchemaServiceName = "authzed.api.v1.SchemaService"
)
View Source
const (
	// WatchServiceName is the fully-qualified name of the WatchService service.
	WatchServiceName = "authzed.api.v1.WatchService"
)
View Source
const (
	// WatchServiceWatchProcedure is the fully-qualified name of the WatchService's Watch RPC.
	WatchServiceWatchProcedure = "/authzed.api.v1.WatchService/Watch"
)

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 NewExperimentalServiceHandler

func NewExperimentalServiceHandler(svc ExperimentalServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewExperimentalServiceHandler 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 NewPermissionsServiceHandler

func NewPermissionsServiceHandler(svc PermissionsServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewPermissionsServiceHandler 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 NewSchemaServiceHandler

func NewSchemaServiceHandler(svc SchemaServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewSchemaServiceHandler 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 NewWatchServiceHandler

func NewWatchServiceHandler(svc WatchServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewWatchServiceHandler 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 ExperimentalServiceClient

type ExperimentalServiceClient interface {
	// BulkImportRelationships is a faster path to writing a large number of
	// relationships at once. It is both batched and streaming. For maximum
	// performance, the caller should attempt to write relationships in as close
	// to relationship sort order as possible: (resource.object_type,
	// resource.object_id, relation, subject.object.object_type,
	// subject.object.object_id, subject.optional_relation)
	//
	// EXPERIMENTAL
	// https://github.com/authzed/spicedb/issues/1303
	BulkImportRelationships(context.Context) *connect.ClientStreamForClient[v1.BulkImportRelationshipsRequest, v1.BulkImportRelationshipsResponse]
	// BulkExportRelationships is the fastest path available to exporting
	// relationships from the server. It is resumable, and will return results
	// in an order determined by the server.
	BulkExportRelationships(context.Context, *connect.Request[v1.BulkExportRelationshipsRequest]) (*connect.ServerStreamForClient[v1.BulkExportRelationshipsResponse], error)
	BulkCheckPermission(context.Context, *connect.Request[v1.BulkCheckPermissionRequest]) (*connect.Response[v1.BulkCheckPermissionResponse], error)
}

ExperimentalServiceClient is a client for the authzed.api.v1.ExperimentalService service.

func NewExperimentalServiceClient

func NewExperimentalServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ExperimentalServiceClient

NewExperimentalServiceClient constructs a client for the authzed.api.v1.ExperimentalService 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 ExperimentalServiceHandler

type ExperimentalServiceHandler interface {
	// BulkImportRelationships is a faster path to writing a large number of
	// relationships at once. It is both batched and streaming. For maximum
	// performance, the caller should attempt to write relationships in as close
	// to relationship sort order as possible: (resource.object_type,
	// resource.object_id, relation, subject.object.object_type,
	// subject.object.object_id, subject.optional_relation)
	//
	// EXPERIMENTAL
	// https://github.com/authzed/spicedb/issues/1303
	BulkImportRelationships(context.Context, *connect.ClientStream[v1.BulkImportRelationshipsRequest]) (*connect.Response[v1.BulkImportRelationshipsResponse], error)
	// BulkExportRelationships is the fastest path available to exporting
	// relationships from the server. It is resumable, and will return results
	// in an order determined by the server.
	BulkExportRelationships(context.Context, *connect.Request[v1.BulkExportRelationshipsRequest], *connect.ServerStream[v1.BulkExportRelationshipsResponse]) error
	BulkCheckPermission(context.Context, *connect.Request[v1.BulkCheckPermissionRequest]) (*connect.Response[v1.BulkCheckPermissionResponse], error)
}

ExperimentalServiceHandler is an implementation of the authzed.api.v1.ExperimentalService service.

type PermissionsServiceClient

type PermissionsServiceClient interface {
	// ReadRelationships reads a set of the relationships matching one or more
	// filters.
	ReadRelationships(context.Context, *connect.Request[v1.ReadRelationshipsRequest]) (*connect.ServerStreamForClient[v1.ReadRelationshipsResponse], error)
	// WriteRelationships atomically writes and/or deletes a set of specified
	// relationships. An optional set of preconditions can be provided that must
	// be satisfied for the operation to commit.
	WriteRelationships(context.Context, *connect.Request[v1.WriteRelationshipsRequest]) (*connect.Response[v1.WriteRelationshipsResponse], error)
	// DeleteRelationships atomically bulk deletes all relationships matching the
	// provided filter. If no relationships match, none will be deleted and the
	// operation will succeed. An optional set of preconditions can be provided that must
	// be satisfied for the operation to commit.
	DeleteRelationships(context.Context, *connect.Request[v1.DeleteRelationshipsRequest]) (*connect.Response[v1.DeleteRelationshipsResponse], error)
	// CheckPermission determines for a given resource whether a subject computes
	// to having a permission or is a direct member of a particular relation.
	CheckPermission(context.Context, *connect.Request[v1.CheckPermissionRequest]) (*connect.Response[v1.CheckPermissionResponse], error)
	// CheckBulkPermissions evaluates the given list of permission checks
	// and returns the list of results.
	CheckBulkPermissions(context.Context, *connect.Request[v1.CheckBulkPermissionsRequest]) (*connect.Response[v1.CheckBulkPermissionsResponse], error)
	// ExpandPermissionTree reveals the graph structure for a resource's
	// permission or relation. This RPC does not recurse infinitely deep and may
	// require multiple calls to fully unnest a deeply nested graph.
	ExpandPermissionTree(context.Context, *connect.Request[v1.ExpandPermissionTreeRequest]) (*connect.Response[v1.ExpandPermissionTreeResponse], error)
	// LookupResources returns all the resources of a given type that a subject
	// can access whether via a computed permission or relation membership.
	LookupResources(context.Context, *connect.Request[v1.LookupResourcesRequest]) (*connect.ServerStreamForClient[v1.LookupResourcesResponse], error)
	// LookupSubjects returns all the subjects of a given type that
	// have access whether via a computed permission or relation membership.
	LookupSubjects(context.Context, *connect.Request[v1.LookupSubjectsRequest]) (*connect.ServerStreamForClient[v1.LookupSubjectsResponse], error)
}

PermissionsServiceClient is a client for the authzed.api.v1.PermissionsService service.

func NewPermissionsServiceClient

func NewPermissionsServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) PermissionsServiceClient

NewPermissionsServiceClient constructs a client for the authzed.api.v1.PermissionsService 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 PermissionsServiceHandler

type PermissionsServiceHandler interface {
	// ReadRelationships reads a set of the relationships matching one or more
	// filters.
	ReadRelationships(context.Context, *connect.Request[v1.ReadRelationshipsRequest], *connect.ServerStream[v1.ReadRelationshipsResponse]) error
	// WriteRelationships atomically writes and/or deletes a set of specified
	// relationships. An optional set of preconditions can be provided that must
	// be satisfied for the operation to commit.
	WriteRelationships(context.Context, *connect.Request[v1.WriteRelationshipsRequest]) (*connect.Response[v1.WriteRelationshipsResponse], error)
	// DeleteRelationships atomically bulk deletes all relationships matching the
	// provided filter. If no relationships match, none will be deleted and the
	// operation will succeed. An optional set of preconditions can be provided that must
	// be satisfied for the operation to commit.
	DeleteRelationships(context.Context, *connect.Request[v1.DeleteRelationshipsRequest]) (*connect.Response[v1.DeleteRelationshipsResponse], error)
	// CheckPermission determines for a given resource whether a subject computes
	// to having a permission or is a direct member of a particular relation.
	CheckPermission(context.Context, *connect.Request[v1.CheckPermissionRequest]) (*connect.Response[v1.CheckPermissionResponse], error)
	// CheckBulkPermissions evaluates the given list of permission checks
	// and returns the list of results.
	CheckBulkPermissions(context.Context, *connect.Request[v1.CheckBulkPermissionsRequest]) (*connect.Response[v1.CheckBulkPermissionsResponse], error)
	// ExpandPermissionTree reveals the graph structure for a resource's
	// permission or relation. This RPC does not recurse infinitely deep and may
	// require multiple calls to fully unnest a deeply nested graph.
	ExpandPermissionTree(context.Context, *connect.Request[v1.ExpandPermissionTreeRequest]) (*connect.Response[v1.ExpandPermissionTreeResponse], error)
	// LookupResources returns all the resources of a given type that a subject
	// can access whether via a computed permission or relation membership.
	LookupResources(context.Context, *connect.Request[v1.LookupResourcesRequest], *connect.ServerStream[v1.LookupResourcesResponse]) error
	// LookupSubjects returns all the subjects of a given type that
	// have access whether via a computed permission or relation membership.
	LookupSubjects(context.Context, *connect.Request[v1.LookupSubjectsRequest], *connect.ServerStream[v1.LookupSubjectsResponse]) error
}

PermissionsServiceHandler is an implementation of the authzed.api.v1.PermissionsService service.

type SchemaServiceClient

type SchemaServiceClient interface {
	// Read returns the current Object Definitions for a Permissions System.
	//
	// Errors include:
	// - INVALID_ARGUMENT: a provided value has failed to semantically validate
	// - NOT_FOUND: no schema has been defined
	ReadSchema(context.Context, *connect.Request[v1.ReadSchemaRequest]) (*connect.Response[v1.ReadSchemaResponse], error)
	// Write overwrites the current Object Definitions for a Permissions System.
	WriteSchema(context.Context, *connect.Request[v1.WriteSchemaRequest]) (*connect.Response[v1.WriteSchemaResponse], error)
}

SchemaServiceClient is a client for the authzed.api.v1.SchemaService service.

func NewSchemaServiceClient

func NewSchemaServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SchemaServiceClient

NewSchemaServiceClient constructs a client for the authzed.api.v1.SchemaService 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 SchemaServiceHandler

type SchemaServiceHandler interface {
	// Read returns the current Object Definitions for a Permissions System.
	//
	// Errors include:
	// - INVALID_ARGUMENT: a provided value has failed to semantically validate
	// - NOT_FOUND: no schema has been defined
	ReadSchema(context.Context, *connect.Request[v1.ReadSchemaRequest]) (*connect.Response[v1.ReadSchemaResponse], error)
	// Write overwrites the current Object Definitions for a Permissions System.
	WriteSchema(context.Context, *connect.Request[v1.WriteSchemaRequest]) (*connect.Response[v1.WriteSchemaResponse], error)
}

SchemaServiceHandler is an implementation of the authzed.api.v1.SchemaService service.

type UnimplementedExperimentalServiceHandler

type UnimplementedExperimentalServiceHandler struct{}

UnimplementedExperimentalServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedExperimentalServiceHandler) BulkCheckPermission

func (UnimplementedExperimentalServiceHandler) BulkExportRelationships

func (UnimplementedExperimentalServiceHandler) BulkImportRelationships

type UnimplementedPermissionsServiceHandler

type UnimplementedPermissionsServiceHandler struct{}

UnimplementedPermissionsServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedPermissionsServiceHandler) CheckBulkPermissions

func (UnimplementedPermissionsServiceHandler) CheckPermission

func (UnimplementedPermissionsServiceHandler) DeleteRelationships

func (UnimplementedPermissionsServiceHandler) ExpandPermissionTree

func (UnimplementedPermissionsServiceHandler) LookupResources

func (UnimplementedPermissionsServiceHandler) LookupSubjects

func (UnimplementedPermissionsServiceHandler) ReadRelationships

func (UnimplementedPermissionsServiceHandler) WriteRelationships

type UnimplementedSchemaServiceHandler

type UnimplementedSchemaServiceHandler struct{}

UnimplementedSchemaServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedSchemaServiceHandler) ReadSchema

func (UnimplementedSchemaServiceHandler) WriteSchema

type UnimplementedWatchServiceHandler

type UnimplementedWatchServiceHandler struct{}

UnimplementedWatchServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedWatchServiceHandler) Watch

type WatchServiceClient

type WatchServiceClient interface {
	Watch(context.Context, *connect.Request[v1.WatchRequest]) (*connect.ServerStreamForClient[v1.WatchResponse], error)
}

WatchServiceClient is a client for the authzed.api.v1.WatchService service.

func NewWatchServiceClient

func NewWatchServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) WatchServiceClient

NewWatchServiceClient constructs a client for the authzed.api.v1.WatchService 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 WatchServiceHandler

type WatchServiceHandler interface {
	Watch(context.Context, *connect.Request[v1.WatchRequest], *connect.ServerStream[v1.WatchResponse]) error
}

WatchServiceHandler is an implementation of the authzed.api.v1.WatchService service.

Jump to

Keyboard shortcuts

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