To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 1d0d4abc authored by Andrea Raguso's avatar Andrea Raguso
Browse files

update

parent 0284fd29
......@@ -5,7 +5,7 @@ go 1.16
require (
github.com/golang/protobuf v1.5.2
github.com/mwitkow/go-proto-validators v0.3.2
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08
google.golang.org/genproto v0.0.0-20210610141715-e7a9b787a5a4
google.golang.org/grpc v1.38.0
google.golang.org/protobuf v1.26.0
)
......@@ -95,8 +95,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08 h1:pc16UedxnxXXtGxHCSUhafAoVHQZ0yXl8ZelMH4EETc=
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210610141715-e7a9b787a5a4 h1:Kgs5nmbQVuUAug2PXQ27hu9MSCv8uJTnrmxZj9Lj5lc=
google.golang.org/genproto v0.0.0-20210610141715-e7a9b787a5a4/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
......
This diff is collapsed.
......@@ -40,6 +40,12 @@ type ResourcesClient interface {
// DeleteResource Deletes a Resource
// @authorization: ADMIN
DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*empty.Empty, error)
// ListResourcePermissions lists all the resource permissions in the system
ListResourcePermissions(ctx context.Context, in *ListResourcePermissionsRequest, opts ...grpc.CallOption) (*ListResourcePermissionsResponse, error)
// CreateResourcePermission adds a new permission to an existing resource
CreateResourcePermission(ctx context.Context, in *CreateResourcePermissionRequest, opts ...grpc.CallOption) (*CreateResourcePermissionResponse, error)
// DeleteResourcePermission removes a permission object from an existing resource
DeleteResourcePermission(ctx context.Context, in *DeleteResourcePermissionRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}
type resourcesClient struct {
......@@ -104,6 +110,33 @@ func (c *resourcesClient) DeleteResource(ctx context.Context, in *DeleteResource
return out, nil
}
func (c *resourcesClient) ListResourcePermissions(ctx context.Context, in *ListResourcePermissionsRequest, opts ...grpc.CallOption) (*ListResourcePermissionsResponse, error) {
out := new(ListResourcePermissionsResponse)
err := c.cc.Invoke(ctx, "/sip.resources.Resources/ListResourcePermissions", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *resourcesClient) CreateResourcePermission(ctx context.Context, in *CreateResourcePermissionRequest, opts ...grpc.CallOption) (*CreateResourcePermissionResponse, error) {
out := new(CreateResourcePermissionResponse)
err := c.cc.Invoke(ctx, "/sip.resources.Resources/CreateResourcePermission", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *resourcesClient) DeleteResourcePermission(ctx context.Context, in *DeleteResourcePermissionRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/sip.resources.Resources/DeleteResourcePermission", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ResourcesServer is the server API for Resources service.
// All implementations must embed UnimplementedResourcesServer
// for forward compatibility
......@@ -129,6 +162,12 @@ type ResourcesServer interface {
// DeleteResource Deletes a Resource
// @authorization: ADMIN
DeleteResource(context.Context, *DeleteResourceRequest) (*empty.Empty, error)
// ListResourcePermissions lists all the resource permissions in the system
ListResourcePermissions(context.Context, *ListResourcePermissionsRequest) (*ListResourcePermissionsResponse, error)
// CreateResourcePermission adds a new permission to an existing resource
CreateResourcePermission(context.Context, *CreateResourcePermissionRequest) (*CreateResourcePermissionResponse, error)
// DeleteResourcePermission removes a permission object from an existing resource
DeleteResourcePermission(context.Context, *DeleteResourcePermissionRequest) (*empty.Empty, error)
mustEmbedUnimplementedResourcesServer()
}
......@@ -154,6 +193,15 @@ func (UnimplementedResourcesServer) UpdateResource(context.Context, *UpdateResou
func (UnimplementedResourcesServer) DeleteResource(context.Context, *DeleteResourceRequest) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteResource not implemented")
}
func (UnimplementedResourcesServer) ListResourcePermissions(context.Context, *ListResourcePermissionsRequest) (*ListResourcePermissionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListResourcePermissions not implemented")
}
func (UnimplementedResourcesServer) CreateResourcePermission(context.Context, *CreateResourcePermissionRequest) (*CreateResourcePermissionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateResourcePermission not implemented")
}
func (UnimplementedResourcesServer) DeleteResourcePermission(context.Context, *DeleteResourcePermissionRequest) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteResourcePermission not implemented")
}
func (UnimplementedResourcesServer) mustEmbedUnimplementedResourcesServer() {}
// UnsafeResourcesServer may be embedded to opt out of forward compatibility for this service.
......@@ -275,6 +323,60 @@ func _Resources_DeleteResource_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _Resources_ListResourcePermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListResourcePermissionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ResourcesServer).ListResourcePermissions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/sip.resources.Resources/ListResourcePermissions",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ResourcesServer).ListResourcePermissions(ctx, req.(*ListResourcePermissionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Resources_CreateResourcePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateResourcePermissionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ResourcesServer).CreateResourcePermission(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/sip.resources.Resources/CreateResourcePermission",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ResourcesServer).CreateResourcePermission(ctx, req.(*CreateResourcePermissionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Resources_DeleteResourcePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteResourcePermissionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ResourcesServer).DeleteResourcePermission(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/sip.resources.Resources/DeleteResourcePermission",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ResourcesServer).DeleteResourcePermission(ctx, req.(*DeleteResourcePermissionRequest))
}
return interceptor(ctx, in, info, handler)
}
// Resources_ServiceDesc is the grpc.ServiceDesc for Resources service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
......@@ -306,6 +408,18 @@ var Resources_ServiceDesc = grpc.ServiceDesc{
MethodName: "DeleteResource",
Handler: _Resources_DeleteResource_Handler,
},
{
MethodName: "ListResourcePermissions",
Handler: _Resources_ListResourcePermissions_Handler,
},
{
MethodName: "CreateResourcePermission",
Handler: _Resources_CreateResourcePermission_Handler,
},
{
MethodName: "DeleteResourcePermission",
Handler: _Resources_DeleteResourcePermission_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "sip/resources/resources.proto",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment