mirror of
https://github.com/mautrix/signal.git
synced 2026-09-17 00:02:04 -04:00
377 lines
17 KiB
Go
Generated
377 lines
17 KiB
Go
Generated
//
|
|
// Copyright 2023 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.2
|
|
// - protoc v7.34.1
|
|
// source: org/signal/chat/credentials.proto
|
|
|
|
package credentials
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
Credentials_GetExternalServiceCredentials_FullMethodName = "/org.signal.chat.credentials.Credentials/GetExternalServiceCredentials"
|
|
Credentials_GetDeliveryCertificate_FullMethodName = "/org.signal.chat.credentials.Credentials/GetDeliveryCertificate"
|
|
Credentials_GetGroupCredentials_FullMethodName = "/org.signal.chat.credentials.Credentials/GetGroupCredentials"
|
|
Credentials_GetCreateCallLinkCredentials_FullMethodName = "/org.signal.chat.credentials.Credentials/GetCreateCallLinkCredentials"
|
|
)
|
|
|
|
// CredentialsClient is the client API for Credentials 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.
|
|
//
|
|
// Provides methods for obtaining and verifying credentials that allow an
|
|
// authenticated user to authenticate in another service or context without
|
|
// revealing their identity.
|
|
type CredentialsClient interface {
|
|
// Generates and returns an external service credentials for the caller.
|
|
GetExternalServiceCredentials(ctx context.Context, in *GetExternalServiceCredentialsRequest, opts ...grpc.CallOption) (*GetExternalServiceCredentialsResponse, error)
|
|
// Generates a pair of delivery certificates that the holder can include to
|
|
// identify themselves to a message recipient (but not the server) in a
|
|
// sealed-sender message.
|
|
GetDeliveryCertificate(ctx context.Context, in *GetDeliveryCertificateRequest, opts ...grpc.CallOption) (*GetDeliveryCertificateResponse, error)
|
|
// Generates a set of zero-knowledge credentials for various group-related
|
|
// actions.
|
|
GetGroupCredentials(ctx context.Context, in *GetGroupCredentialsRequest, opts ...grpc.CallOption) (*GetGroupCredentialsResponse, error)
|
|
// Generates zero-knowledge credentials for creating call links.
|
|
GetCreateCallLinkCredentials(ctx context.Context, in *GetCreateCallLinkCredentialsRequest, opts ...grpc.CallOption) (*GetCreateCallLinkCredentialsResponse, error)
|
|
}
|
|
|
|
type credentialsClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewCredentialsClient(cc grpc.ClientConnInterface) CredentialsClient {
|
|
return &credentialsClient{cc}
|
|
}
|
|
|
|
func (c *credentialsClient) GetExternalServiceCredentials(ctx context.Context, in *GetExternalServiceCredentialsRequest, opts ...grpc.CallOption) (*GetExternalServiceCredentialsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetExternalServiceCredentialsResponse)
|
|
err := c.cc.Invoke(ctx, Credentials_GetExternalServiceCredentials_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *credentialsClient) GetDeliveryCertificate(ctx context.Context, in *GetDeliveryCertificateRequest, opts ...grpc.CallOption) (*GetDeliveryCertificateResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetDeliveryCertificateResponse)
|
|
err := c.cc.Invoke(ctx, Credentials_GetDeliveryCertificate_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *credentialsClient) GetGroupCredentials(ctx context.Context, in *GetGroupCredentialsRequest, opts ...grpc.CallOption) (*GetGroupCredentialsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetGroupCredentialsResponse)
|
|
err := c.cc.Invoke(ctx, Credentials_GetGroupCredentials_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *credentialsClient) GetCreateCallLinkCredentials(ctx context.Context, in *GetCreateCallLinkCredentialsRequest, opts ...grpc.CallOption) (*GetCreateCallLinkCredentialsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetCreateCallLinkCredentialsResponse)
|
|
err := c.cc.Invoke(ctx, Credentials_GetCreateCallLinkCredentials_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// CredentialsServer is the server API for Credentials service.
|
|
// All implementations must embed UnimplementedCredentialsServer
|
|
// for forward compatibility.
|
|
//
|
|
// Provides methods for obtaining and verifying credentials that allow an
|
|
// authenticated user to authenticate in another service or context without
|
|
// revealing their identity.
|
|
type CredentialsServer interface {
|
|
// Generates and returns an external service credentials for the caller.
|
|
GetExternalServiceCredentials(context.Context, *GetExternalServiceCredentialsRequest) (*GetExternalServiceCredentialsResponse, error)
|
|
// Generates a pair of delivery certificates that the holder can include to
|
|
// identify themselves to a message recipient (but not the server) in a
|
|
// sealed-sender message.
|
|
GetDeliveryCertificate(context.Context, *GetDeliveryCertificateRequest) (*GetDeliveryCertificateResponse, error)
|
|
// Generates a set of zero-knowledge credentials for various group-related
|
|
// actions.
|
|
GetGroupCredentials(context.Context, *GetGroupCredentialsRequest) (*GetGroupCredentialsResponse, error)
|
|
// Generates zero-knowledge credentials for creating call links.
|
|
GetCreateCallLinkCredentials(context.Context, *GetCreateCallLinkCredentialsRequest) (*GetCreateCallLinkCredentialsResponse, error)
|
|
mustEmbedUnimplementedCredentialsServer()
|
|
}
|
|
|
|
// UnimplementedCredentialsServer must 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.
|
|
type UnimplementedCredentialsServer struct{}
|
|
|
|
func (UnimplementedCredentialsServer) GetExternalServiceCredentials(context.Context, *GetExternalServiceCredentialsRequest) (*GetExternalServiceCredentialsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetExternalServiceCredentials not implemented")
|
|
}
|
|
func (UnimplementedCredentialsServer) GetDeliveryCertificate(context.Context, *GetDeliveryCertificateRequest) (*GetDeliveryCertificateResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetDeliveryCertificate not implemented")
|
|
}
|
|
func (UnimplementedCredentialsServer) GetGroupCredentials(context.Context, *GetGroupCredentialsRequest) (*GetGroupCredentialsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetGroupCredentials not implemented")
|
|
}
|
|
func (UnimplementedCredentialsServer) GetCreateCallLinkCredentials(context.Context, *GetCreateCallLinkCredentialsRequest) (*GetCreateCallLinkCredentialsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetCreateCallLinkCredentials not implemented")
|
|
}
|
|
func (UnimplementedCredentialsServer) mustEmbedUnimplementedCredentialsServer() {}
|
|
func (UnimplementedCredentialsServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeCredentialsServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to CredentialsServer will
|
|
// result in compilation errors.
|
|
type UnsafeCredentialsServer interface {
|
|
mustEmbedUnimplementedCredentialsServer()
|
|
}
|
|
|
|
func RegisterCredentialsServer(s grpc.ServiceRegistrar, srv CredentialsServer) {
|
|
// If the following call panics, it indicates UnimplementedCredentialsServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&Credentials_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Credentials_GetExternalServiceCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetExternalServiceCredentialsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CredentialsServer).GetExternalServiceCredentials(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Credentials_GetExternalServiceCredentials_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CredentialsServer).GetExternalServiceCredentials(ctx, req.(*GetExternalServiceCredentialsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Credentials_GetDeliveryCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetDeliveryCertificateRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CredentialsServer).GetDeliveryCertificate(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Credentials_GetDeliveryCertificate_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CredentialsServer).GetDeliveryCertificate(ctx, req.(*GetDeliveryCertificateRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Credentials_GetGroupCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetGroupCredentialsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CredentialsServer).GetGroupCredentials(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Credentials_GetGroupCredentials_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CredentialsServer).GetGroupCredentials(ctx, req.(*GetGroupCredentialsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Credentials_GetCreateCallLinkCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetCreateCallLinkCredentialsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CredentialsServer).GetCreateCallLinkCredentials(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Credentials_GetCreateCallLinkCredentials_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CredentialsServer).GetCreateCallLinkCredentials(ctx, req.(*GetCreateCallLinkCredentialsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Credentials_ServiceDesc is the grpc.ServiceDesc for Credentials service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Credentials_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "org.signal.chat.credentials.Credentials",
|
|
HandlerType: (*CredentialsServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetExternalServiceCredentials",
|
|
Handler: _Credentials_GetExternalServiceCredentials_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetDeliveryCertificate",
|
|
Handler: _Credentials_GetDeliveryCertificate_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetGroupCredentials",
|
|
Handler: _Credentials_GetGroupCredentials_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetCreateCallLinkCredentials",
|
|
Handler: _Credentials_GetCreateCallLinkCredentials_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "org/signal/chat/credentials.proto",
|
|
}
|
|
|
|
const (
|
|
CredentialsAnonymous_CheckSvrCredentials_FullMethodName = "/org.signal.chat.credentials.CredentialsAnonymous/CheckSvrCredentials"
|
|
)
|
|
|
|
// CredentialsAnonymousClient is the client API for CredentialsAnonymous 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.
|
|
//
|
|
// Provides methods for working with previously-generated credentials without
|
|
// revealing an association between the credentials and the caller's identity to
|
|
// the server.
|
|
type CredentialsAnonymousClient interface {
|
|
// Given a list of secure value recovery (SVR) service credentials and a phone
|
|
// number, checks and returns which of the provided credentials were generated
|
|
// by the user with the given phone number and have not yet expired.
|
|
CheckSvrCredentials(ctx context.Context, in *CheckSvrCredentialsRequest, opts ...grpc.CallOption) (*CheckSvrCredentialsResponse, error)
|
|
}
|
|
|
|
type credentialsAnonymousClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewCredentialsAnonymousClient(cc grpc.ClientConnInterface) CredentialsAnonymousClient {
|
|
return &credentialsAnonymousClient{cc}
|
|
}
|
|
|
|
func (c *credentialsAnonymousClient) CheckSvrCredentials(ctx context.Context, in *CheckSvrCredentialsRequest, opts ...grpc.CallOption) (*CheckSvrCredentialsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CheckSvrCredentialsResponse)
|
|
err := c.cc.Invoke(ctx, CredentialsAnonymous_CheckSvrCredentials_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// CredentialsAnonymousServer is the server API for CredentialsAnonymous service.
|
|
// All implementations must embed UnimplementedCredentialsAnonymousServer
|
|
// for forward compatibility.
|
|
//
|
|
// Provides methods for working with previously-generated credentials without
|
|
// revealing an association between the credentials and the caller's identity to
|
|
// the server.
|
|
type CredentialsAnonymousServer interface {
|
|
// Given a list of secure value recovery (SVR) service credentials and a phone
|
|
// number, checks and returns which of the provided credentials were generated
|
|
// by the user with the given phone number and have not yet expired.
|
|
CheckSvrCredentials(context.Context, *CheckSvrCredentialsRequest) (*CheckSvrCredentialsResponse, error)
|
|
mustEmbedUnimplementedCredentialsAnonymousServer()
|
|
}
|
|
|
|
// UnimplementedCredentialsAnonymousServer must 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.
|
|
type UnimplementedCredentialsAnonymousServer struct{}
|
|
|
|
func (UnimplementedCredentialsAnonymousServer) CheckSvrCredentials(context.Context, *CheckSvrCredentialsRequest) (*CheckSvrCredentialsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method CheckSvrCredentials not implemented")
|
|
}
|
|
func (UnimplementedCredentialsAnonymousServer) mustEmbedUnimplementedCredentialsAnonymousServer() {}
|
|
func (UnimplementedCredentialsAnonymousServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeCredentialsAnonymousServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to CredentialsAnonymousServer will
|
|
// result in compilation errors.
|
|
type UnsafeCredentialsAnonymousServer interface {
|
|
mustEmbedUnimplementedCredentialsAnonymousServer()
|
|
}
|
|
|
|
func RegisterCredentialsAnonymousServer(s grpc.ServiceRegistrar, srv CredentialsAnonymousServer) {
|
|
// If the following call panics, it indicates UnimplementedCredentialsAnonymousServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&CredentialsAnonymous_ServiceDesc, srv)
|
|
}
|
|
|
|
func _CredentialsAnonymous_CheckSvrCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CheckSvrCredentialsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CredentialsAnonymousServer).CheckSvrCredentials(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: CredentialsAnonymous_CheckSvrCredentials_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CredentialsAnonymousServer).CheckSvrCredentials(ctx, req.(*CheckSvrCredentialsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// CredentialsAnonymous_ServiceDesc is the grpc.ServiceDesc for CredentialsAnonymous service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var CredentialsAnonymous_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "org.signal.chat.credentials.CredentialsAnonymous",
|
|
HandlerType: (*CredentialsAnonymousServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CheckSvrCredentials",
|
|
Handler: _CredentialsAnonymous_CheckSvrCredentials_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "org/signal/chat/credentials.proto",
|
|
}
|