authz

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Authz_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "d1.authz.Authz",
	HandlerType: (*AuthzServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPermissions",
			Handler:    _Authz_GetPermissions_Handler,
		},
		{
			MethodName: "AddPermission",
			Handler:    _Authz_AddPermission_Handler,
		},
		{
			MethodName: "RemovePermission",
			Handler:    _Authz_RemovePermission_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "authz.proto",
}

Authz_ServiceDesc is the grpc.ServiceDesc for Authz 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 File_authz_proto protoreflect.FileDescriptor

Functions

func RegisterAuthzServer

func RegisterAuthzServer(s grpc.ServiceRegistrar, srv AuthzServer)

Types

type AddPermissionRequest

type AddPermissionRequest struct {

	/// The ID of the object to add the permission to.
	ObjectId string `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"`
	/// The ID of the group to give access.
	GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

* Represents a request to add permission to an object.

func (*AddPermissionRequest) Descriptor deprecated

func (*AddPermissionRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddPermissionRequest.ProtoReflect.Descriptor instead.

func (*AddPermissionRequest) GetGroupId

func (x *AddPermissionRequest) GetGroupId() string

func (*AddPermissionRequest) GetObjectId

func (x *AddPermissionRequest) GetObjectId() string

func (*AddPermissionRequest) ProtoMessage

func (*AddPermissionRequest) ProtoMessage()

func (*AddPermissionRequest) ProtoReflect

func (x *AddPermissionRequest) ProtoReflect() protoreflect.Message

func (*AddPermissionRequest) Reset

func (x *AddPermissionRequest) Reset()

func (*AddPermissionRequest) String

func (x *AddPermissionRequest) String() string

type AddPermissionResponse

type AddPermissionResponse struct {
	// contains filtered or unexported fields
}

/ Represents the result of a request to add permission to an object.

func (*AddPermissionResponse) Descriptor deprecated

func (*AddPermissionResponse) Descriptor() ([]byte, []int)

Deprecated: Use AddPermissionResponse.ProtoReflect.Descriptor instead.

func (*AddPermissionResponse) ProtoMessage

func (*AddPermissionResponse) ProtoMessage()

func (*AddPermissionResponse) ProtoReflect

func (x *AddPermissionResponse) ProtoReflect() protoreflect.Message

func (*AddPermissionResponse) Reset

func (x *AddPermissionResponse) Reset()

func (*AddPermissionResponse) String

func (x *AddPermissionResponse) String() string

type AuthzClient

type AuthzClient interface {
	//*
	// Returns a list of groups with access to the specified object.
	// This call can fail if the auth storage cannot be reached, in which case an error is returned.
	// The calling user has to be authenticated and authorized to access the object in order to get the object permissions.
	// Requires the scope `OBJECTPERMISSIONS`.
	GetPermissions(ctx context.Context, in *GetPermissionsRequest, opts ...grpc.CallOption) (*GetPermissionsResponse, error)
	//*
	// Adds a group to the access list of the specified object.
	// This call can fail if the caller does not have access to the object, if the target group does not exist, or if the auth storage cannot be reached.
	// In these cases, an error is returned.
	// Requires the scope `OBJECTPERMISSIONS`.
	AddPermission(ctx context.Context, in *AddPermissionRequest, opts ...grpc.CallOption) (*AddPermissionResponse, error)
	//*
	// Removes a group from the access list of the specified object.
	// This call can fail if the caller does not have access to the object or if the auth storage cannot reached.
	// In these cases, an error is returned.
	// Requires the scope `OBJECTPERMISSIONS`.
	RemovePermission(ctx context.Context, in *RemovePermissionRequest, opts ...grpc.CallOption) (*RemovePermissionResponse, error)
}

AuthzClient is the client API for Authz 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 NewAuthzClient

func NewAuthzClient(cc grpc.ClientConnInterface) AuthzClient

type AuthzServer

type AuthzServer interface {
	//*
	// Returns a list of groups with access to the specified object.
	// This call can fail if the auth storage cannot be reached, in which case an error is returned.
	// The calling user has to be authenticated and authorized to access the object in order to get the object permissions.
	// Requires the scope `OBJECTPERMISSIONS`.
	GetPermissions(context.Context, *GetPermissionsRequest) (*GetPermissionsResponse, error)
	//*
	// Adds a group to the access list of the specified object.
	// This call can fail if the caller does not have access to the object, if the target group does not exist, or if the auth storage cannot be reached.
	// In these cases, an error is returned.
	// Requires the scope `OBJECTPERMISSIONS`.
	AddPermission(context.Context, *AddPermissionRequest) (*AddPermissionResponse, error)
	//*
	// Removes a group from the access list of the specified object.
	// This call can fail if the caller does not have access to the object or if the auth storage cannot reached.
	// In these cases, an error is returned.
	// Requires the scope `OBJECTPERMISSIONS`.
	RemovePermission(context.Context, *RemovePermissionRequest) (*RemovePermissionResponse, error)
	// contains filtered or unexported methods
}

AuthzServer is the server API for Authz service. All implementations must embed UnimplementedAuthzServer for forward compatibility

type GetPermissionsRequest

type GetPermissionsRequest struct {

	/// The ID of the object to get the permission list for.
	ObjectId string `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"`
	// contains filtered or unexported fields
}

* Represents a request to get the permissions of an object.

func (*GetPermissionsRequest) Descriptor deprecated

func (*GetPermissionsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetPermissionsRequest.ProtoReflect.Descriptor instead.

func (*GetPermissionsRequest) GetObjectId

func (x *GetPermissionsRequest) GetObjectId() string

func (*GetPermissionsRequest) ProtoMessage

func (*GetPermissionsRequest) ProtoMessage()

func (*GetPermissionsRequest) ProtoReflect

func (x *GetPermissionsRequest) ProtoReflect() protoreflect.Message

func (*GetPermissionsRequest) Reset

func (x *GetPermissionsRequest) Reset()

func (*GetPermissionsRequest) String

func (x *GetPermissionsRequest) String() string

type GetPermissionsResponse

type GetPermissionsResponse struct {

	/// List of groups with access to the object.
	GroupIds []string `protobuf:"bytes,1,rep,name=group_ids,json=groupIds,proto3" json:"group_ids,omitempty"`
	// contains filtered or unexported fields
}

/ Represents the result of a request to get permissions for an object.

func (*GetPermissionsResponse) Descriptor deprecated

func (*GetPermissionsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetPermissionsResponse.ProtoReflect.Descriptor instead.

func (*GetPermissionsResponse) GetGroupIds

func (x *GetPermissionsResponse) GetGroupIds() []string

func (*GetPermissionsResponse) ProtoMessage

func (*GetPermissionsResponse) ProtoMessage()

func (*GetPermissionsResponse) ProtoReflect

func (x *GetPermissionsResponse) ProtoReflect() protoreflect.Message

func (*GetPermissionsResponse) Reset

func (x *GetPermissionsResponse) Reset()

func (*GetPermissionsResponse) String

func (x *GetPermissionsResponse) String() string

type RemovePermissionRequest

type RemovePermissionRequest struct {

	/// The ID of the object to remove the permission for.
	ObjectId string `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"`
	/// The ID of the group to revoke permission for.
	GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

* Represents a request to remove permission to an object.

func (*RemovePermissionRequest) Descriptor deprecated

func (*RemovePermissionRequest) Descriptor() ([]byte, []int)

Deprecated: Use RemovePermissionRequest.ProtoReflect.Descriptor instead.

func (*RemovePermissionRequest) GetGroupId

func (x *RemovePermissionRequest) GetGroupId() string

func (*RemovePermissionRequest) GetObjectId

func (x *RemovePermissionRequest) GetObjectId() string

func (*RemovePermissionRequest) ProtoMessage

func (*RemovePermissionRequest) ProtoMessage()

func (*RemovePermissionRequest) ProtoReflect

func (x *RemovePermissionRequest) ProtoReflect() protoreflect.Message

func (*RemovePermissionRequest) Reset

func (x *RemovePermissionRequest) Reset()

func (*RemovePermissionRequest) String

func (x *RemovePermissionRequest) String() string

type RemovePermissionResponse

type RemovePermissionResponse struct {
	// contains filtered or unexported fields
}

/ Represents the result of a request to remove permission to an object.

func (*RemovePermissionResponse) Descriptor deprecated

func (*RemovePermissionResponse) Descriptor() ([]byte, []int)

Deprecated: Use RemovePermissionResponse.ProtoReflect.Descriptor instead.

func (*RemovePermissionResponse) ProtoMessage

func (*RemovePermissionResponse) ProtoMessage()

func (*RemovePermissionResponse) ProtoReflect

func (x *RemovePermissionResponse) ProtoReflect() protoreflect.Message

func (*RemovePermissionResponse) Reset

func (x *RemovePermissionResponse) Reset()

func (*RemovePermissionResponse) String

func (x *RemovePermissionResponse) String() string

type UnimplementedAuthzServer

type UnimplementedAuthzServer struct {
}

UnimplementedAuthzServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthzServer) AddPermission

func (UnimplementedAuthzServer) GetPermissions

func (UnimplementedAuthzServer) RemovePermission

type UnsafeAuthzServer

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

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

Jump to

Keyboard shortcuts

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