v0grpc

package
v1.6.2-20260501225640-... Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	WatchPermissionSetsService_WatchPermissionSets_FullMethodName    = "/authzed.api.materialize.v0.WatchPermissionSetsService/WatchPermissionSets"
	WatchPermissionSetsService_LookupPermissionSets_FullMethodName   = "/authzed.api.materialize.v0.WatchPermissionSetsService/LookupPermissionSets"
	WatchPermissionSetsService_DownloadPermissionSets_FullMethodName = "/authzed.api.materialize.v0.WatchPermissionSetsService/DownloadPermissionSets"
)
View Source
const (
	RelationshipsService_ExperimentalCountRelationshipsByFilter_FullMethodName = "/authzed.api.materialize.v0.RelationshipsService/ExperimentalCountRelationshipsByFilter"
)
View Source
const (
	WatchPermissionsService_WatchPermissions_FullMethodName = "/authzed.api.materialize.v0.WatchPermissionsService/WatchPermissions"
)

Variables

View Source
var RelationshipsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "authzed.api.materialize.v0.RelationshipsService",
	HandlerType: (*RelationshipsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ExperimentalCountRelationshipsByFilter",
			Handler:    _RelationshipsService_ExperimentalCountRelationshipsByFilter_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "authzed/api/materialize/v0/relationships.proto",
}

RelationshipsService_ServiceDesc is the grpc.ServiceDesc for RelationshipsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var WatchPermissionSetsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "authzed.api.materialize.v0.WatchPermissionSetsService",
	HandlerType: (*WatchPermissionSetsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DownloadPermissionSets",
			Handler:    _WatchPermissionSetsService_DownloadPermissionSets_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "WatchPermissionSets",
			Handler:       _WatchPermissionSetsService_WatchPermissionSets_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "LookupPermissionSets",
			Handler:       _WatchPermissionSetsService_LookupPermissionSets_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "authzed/api/materialize/v0/watchpermissionsets.proto",
}

WatchPermissionSetsService_ServiceDesc is the grpc.ServiceDesc for WatchPermissionSetsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var WatchPermissionsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "authzed.api.materialize.v0.WatchPermissionsService",
	HandlerType: (*WatchPermissionsServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "WatchPermissions",
			Handler:       _WatchPermissionsService_WatchPermissions_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "authzed/api/materialize/v0/watchpermissions.proto",
}

WatchPermissionsService_ServiceDesc is the grpc.ServiceDesc for WatchPermissionsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRelationshipsServiceServer

func RegisterRelationshipsServiceServer(s grpc.ServiceRegistrar, srv RelationshipsServiceServer)

func RegisterWatchPermissionSetsServiceServer

func RegisterWatchPermissionSetsServiceServer(s grpc.ServiceRegistrar, srv WatchPermissionSetsServiceServer)

func RegisterWatchPermissionsServiceServer

func RegisterWatchPermissionsServiceServer(s grpc.ServiceRegistrar, srv WatchPermissionsServiceServer)

Types

type RelationshipsServiceClient

type RelationshipsServiceClient interface {
	// EXPERIMENTAL: CountRelationships returns the count of relationships for a given filter.
	ExperimentalCountRelationshipsByFilter(ctx context.Context, in *v0.ExperimentalCountRelationshipsByFilterRequest, opts ...grpc.CallOption) (*v0.ExperimentalCountRelationshipsByFilterResponse, error)
}

RelationshipsServiceClient is the client API for RelationshipsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewRelationshipsServiceClient

func NewRelationshipsServiceClient(cc grpc.ClientConnInterface) RelationshipsServiceClient

type RelationshipsServiceServer

type RelationshipsServiceServer interface {
	// EXPERIMENTAL: CountRelationships returns the count of relationships for a given filter.
	ExperimentalCountRelationshipsByFilter(context.Context, *v0.ExperimentalCountRelationshipsByFilterRequest) (*v0.ExperimentalCountRelationshipsByFilterResponse, error)
}

RelationshipsServiceServer is the server API for RelationshipsService service. All implementations should embed UnimplementedRelationshipsServiceServer for forward compatibility.

type UnimplementedRelationshipsServiceServer

type UnimplementedRelationshipsServiceServer struct{}

UnimplementedRelationshipsServiceServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedRelationshipsServiceServer) ExperimentalCountRelationshipsByFilter

type UnimplementedWatchPermissionSetsServiceServer

type UnimplementedWatchPermissionSetsServiceServer struct{}

UnimplementedWatchPermissionSetsServiceServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedWatchPermissionSetsServiceServer) DownloadPermissionSets

func (UnimplementedWatchPermissionSetsServiceServer) LookupPermissionSets

func (UnimplementedWatchPermissionSetsServiceServer) WatchPermissionSets

type UnimplementedWatchPermissionsServiceServer

type UnimplementedWatchPermissionsServiceServer struct{}

UnimplementedWatchPermissionsServiceServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedWatchPermissionsServiceServer) WatchPermissions

type UnsafeRelationshipsServiceServer

type UnsafeRelationshipsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeRelationshipsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RelationshipsServiceServer will result in compilation errors.

type UnsafeWatchPermissionSetsServiceServer

type UnsafeWatchPermissionSetsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeWatchPermissionSetsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WatchPermissionSetsServiceServer will result in compilation errors.

type UnsafeWatchPermissionsServiceServer

type UnsafeWatchPermissionsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeWatchPermissionsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WatchPermissionsServiceServer will result in compilation errors.

type WatchPermissionSetsServiceClient

type WatchPermissionSetsServiceClient interface {
	// WatchPermissionSets returns a stream of changes to the sets which can be used to compute the watched permissions.
	//
	// WatchPermissionSets lets consumers achieve the same thing as WatchPermissions, but trades off a simpler usage model with
	// significantly lower computational requirements. Unlike WatchPermissions, this method returns changes to the sets of permissions,
	// rather than the individual permissions. Permission sets are a normalized form of the computed permissions, which
	// means that the consumer must perform an extra computation over this representation to obtain the final computed
	// permissions, typically by intersecting the provided sets.
	//
	// For example, this would look like a JOIN between the
	// materialize permission sets table in a target relation database, the table with the resources to authorize access
	// to, and the table with the subject (e.g. a user).
	//
	// In exchange, the number of changes issued by WatchPermissionSets will be several orders of magnitude less than those
	// emitted by WatchPermissions, which has several implications:
	// - significantly less resources to compute the sets
	// - significantly less messages to stream over the network
	// - significantly less events to ingest on the consumer side
	// - less ingestion lag from the origin SpiceDB mutation
	//
	// The type of scenarios WatchPermissionSets is particularly well suited is when a single change
	// in the origin SpiceDB can yield millions of changes. For example, in the GitHub authorization model, assigning a role
	// to a top-level team of an organization with hundreds of thousands of employees can lead to an explosion of
	// permission change events that would require a lot of computational resources to process, both on Materialize and
	// the consumer side.
	//
	// WatchPermissionSets is thus recommended for any larger scale use case where the fan-out in permission changes that
	// emerges from a specific schema and data shape is too large to handle effectively.
	//
	// The API does not offer a sharding mechanism and thus there should only be one consumer per target system.
	// Implementing an active-active HA consumer setup over the same target system will require coordinating which
	// revisions have been consumed in order to prevent transitioning to an inconsistent state.
	WatchPermissionSets(ctx context.Context, in *v0.WatchPermissionSetsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[v0.WatchPermissionSetsResponse], error)
	// LookupPermissionSets returns the current state of the permission sets which can be used to derive the computed permissions.
	// It's typically used to backfill the state of the permission sets in the consumer side.
	//
	// It's a cursored API and the consumer is responsible to keep track of the cursor and use it on each subsequent call.
	// Each stream will return <N> permission sets defined by the specified request limit. The server will keep streaming until
	// the sets per stream is hit, or the current state of the sets is reached,
	// whatever happens first, and then close the stream. The server will indicate there are no more changes to stream
	// through the `completed_members` in the cursor.
	//
	// There may be many elements to stream, and so the consumer should be prepared to resume the stream from the last
	// cursor received. Once completed, the consumer may start streaming permission set changes using WatchPermissionSets
	// and the revision token from the last LookupPermissionSets response.
	LookupPermissionSets(ctx context.Context, in *v0.LookupPermissionSetsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[v0.LookupPermissionSetsResponse], error)
	// DownloadPermissionSets returns URLs to download permission sets data as Avro files.
	// This provides an alternative to LookupPermissionSets for customers who need to download
	// large datasets efficiently. The returned URLs point to compressed Avro files containing
	// the permission sets data in a normalized format.
	DownloadPermissionSets(ctx context.Context, in *v0.DownloadPermissionSetsRequest, opts ...grpc.CallOption) (*v0.DownloadPermissionSetsResponse, error)
}

WatchPermissionSetsServiceClient is the client API for WatchPermissionSetsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewWatchPermissionSetsServiceClient

func NewWatchPermissionSetsServiceClient(cc grpc.ClientConnInterface) WatchPermissionSetsServiceClient

type WatchPermissionSetsServiceServer

type WatchPermissionSetsServiceServer interface {
	// WatchPermissionSets returns a stream of changes to the sets which can be used to compute the watched permissions.
	//
	// WatchPermissionSets lets consumers achieve the same thing as WatchPermissions, but trades off a simpler usage model with
	// significantly lower computational requirements. Unlike WatchPermissions, this method returns changes to the sets of permissions,
	// rather than the individual permissions. Permission sets are a normalized form of the computed permissions, which
	// means that the consumer must perform an extra computation over this representation to obtain the final computed
	// permissions, typically by intersecting the provided sets.
	//
	// For example, this would look like a JOIN between the
	// materialize permission sets table in a target relation database, the table with the resources to authorize access
	// to, and the table with the subject (e.g. a user).
	//
	// In exchange, the number of changes issued by WatchPermissionSets will be several orders of magnitude less than those
	// emitted by WatchPermissions, which has several implications:
	// - significantly less resources to compute the sets
	// - significantly less messages to stream over the network
	// - significantly less events to ingest on the consumer side
	// - less ingestion lag from the origin SpiceDB mutation
	//
	// The type of scenarios WatchPermissionSets is particularly well suited is when a single change
	// in the origin SpiceDB can yield millions of changes. For example, in the GitHub authorization model, assigning a role
	// to a top-level team of an organization with hundreds of thousands of employees can lead to an explosion of
	// permission change events that would require a lot of computational resources to process, both on Materialize and
	// the consumer side.
	//
	// WatchPermissionSets is thus recommended for any larger scale use case where the fan-out in permission changes that
	// emerges from a specific schema and data shape is too large to handle effectively.
	//
	// The API does not offer a sharding mechanism and thus there should only be one consumer per target system.
	// Implementing an active-active HA consumer setup over the same target system will require coordinating which
	// revisions have been consumed in order to prevent transitioning to an inconsistent state.
	WatchPermissionSets(*v0.WatchPermissionSetsRequest, grpc.ServerStreamingServer[v0.WatchPermissionSetsResponse]) error
	// LookupPermissionSets returns the current state of the permission sets which can be used to derive the computed permissions.
	// It's typically used to backfill the state of the permission sets in the consumer side.
	//
	// It's a cursored API and the consumer is responsible to keep track of the cursor and use it on each subsequent call.
	// Each stream will return <N> permission sets defined by the specified request limit. The server will keep streaming until
	// the sets per stream is hit, or the current state of the sets is reached,
	// whatever happens first, and then close the stream. The server will indicate there are no more changes to stream
	// through the `completed_members` in the cursor.
	//
	// There may be many elements to stream, and so the consumer should be prepared to resume the stream from the last
	// cursor received. Once completed, the consumer may start streaming permission set changes using WatchPermissionSets
	// and the revision token from the last LookupPermissionSets response.
	LookupPermissionSets(*v0.LookupPermissionSetsRequest, grpc.ServerStreamingServer[v0.LookupPermissionSetsResponse]) error
	// DownloadPermissionSets returns URLs to download permission sets data as Avro files.
	// This provides an alternative to LookupPermissionSets for customers who need to download
	// large datasets efficiently. The returned URLs point to compressed Avro files containing
	// the permission sets data in a normalized format.
	DownloadPermissionSets(context.Context, *v0.DownloadPermissionSetsRequest) (*v0.DownloadPermissionSetsResponse, error)
}

WatchPermissionSetsServiceServer is the server API for WatchPermissionSetsService service. All implementations should embed UnimplementedWatchPermissionSetsServiceServer for forward compatibility.

type WatchPermissionSetsService_LookupPermissionSetsClient

type WatchPermissionSetsService_LookupPermissionSetsClient = grpc.ServerStreamingClient[v0.LookupPermissionSetsResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WatchPermissionSetsService_LookupPermissionSetsServer

type WatchPermissionSetsService_LookupPermissionSetsServer = grpc.ServerStreamingServer[v0.LookupPermissionSetsResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WatchPermissionSetsService_WatchPermissionSetsClient

type WatchPermissionSetsService_WatchPermissionSetsClient = grpc.ServerStreamingClient[v0.WatchPermissionSetsResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WatchPermissionSetsService_WatchPermissionSetsServer

type WatchPermissionSetsService_WatchPermissionSetsServer = grpc.ServerStreamingServer[v0.WatchPermissionSetsResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WatchPermissionsServiceClient

type WatchPermissionsServiceClient interface {
	// Deprecated: Do not use.
	// WatchPermissions returns a stream of PermissionChange events for the given permissions.
	//
	// WatchPermissions is a long-running RPC, and will stream events until the client
	// closes the connection or the server terminates the stream. The consumer is responsible of
	// keeping track of the last seen revision and resuming the stream from that point in the event
	// of disconnection or client-side restarts.
	//
	// The API does not offer a sharding mechanism and thus there should only be one consumer per target system.
	// Implementing an active-active HA consumer setup over the same target system will require coordinating which
	// revisions have been consumed in order to prevent transitioning to an inconsistent state.
	//
	// Usage of WatchPermissions requires to be explicitly enabled on the service, including the permissions to be
	// watched. It requires more resources and is less performant than WatchPermissionsSets. It's usage
	// is only recommended when performing the set intersections of WatchPermissionSets in the client side is not viable
	// or there is a strict application requirement to use consume the computed permissions.
	WatchPermissions(ctx context.Context, in *v0.WatchPermissionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[v0.WatchPermissionsResponse], error)
}

WatchPermissionsServiceClient is the client API for WatchPermissionsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewWatchPermissionsServiceClient

func NewWatchPermissionsServiceClient(cc grpc.ClientConnInterface) WatchPermissionsServiceClient

type WatchPermissionsServiceServer

type WatchPermissionsServiceServer interface {
	// Deprecated: Do not use.
	// WatchPermissions returns a stream of PermissionChange events for the given permissions.
	//
	// WatchPermissions is a long-running RPC, and will stream events until the client
	// closes the connection or the server terminates the stream. The consumer is responsible of
	// keeping track of the last seen revision and resuming the stream from that point in the event
	// of disconnection or client-side restarts.
	//
	// The API does not offer a sharding mechanism and thus there should only be one consumer per target system.
	// Implementing an active-active HA consumer setup over the same target system will require coordinating which
	// revisions have been consumed in order to prevent transitioning to an inconsistent state.
	//
	// Usage of WatchPermissions requires to be explicitly enabled on the service, including the permissions to be
	// watched. It requires more resources and is less performant than WatchPermissionsSets. It's usage
	// is only recommended when performing the set intersections of WatchPermissionSets in the client side is not viable
	// or there is a strict application requirement to use consume the computed permissions.
	WatchPermissions(*v0.WatchPermissionsRequest, grpc.ServerStreamingServer[v0.WatchPermissionsResponse]) error
}

WatchPermissionsServiceServer is the server API for WatchPermissionsService service. All implementations should embed UnimplementedWatchPermissionsServiceServer for forward compatibility.

type WatchPermissionsService_WatchPermissionsClient

type WatchPermissionsService_WatchPermissionsClient = grpc.ServerStreamingClient[v0.WatchPermissionsResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WatchPermissionsService_WatchPermissionsServer

type WatchPermissionsService_WatchPermissionsServer = grpc.ServerStreamingServer[v0.WatchPermissionsResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

Source Files

  • relationships_grpc.pb.go
  • watchpermissions_grpc.pb.go
  • watchpermissionsets_grpc.pb.go

Jump to

Keyboard shortcuts

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