agentfense 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,78 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: codebase.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'codebase.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
26
+ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
27
+ from . import common_pb2 as common__pb2
28
+
29
+
30
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0e\x63odebase.proto\x12\nsandbox.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\"\xb8\x01\n\x08\x43odebase\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x10\n\x08owner_id\x18\x03 \x01(\t\x12\x0c\n\x04size\x18\x04 \x01(\x03\x12\x12\n\nfile_count\x18\x05 \x01(\x05\x12.\n\ncreated_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"7\n\x15\x43reateCodebaseRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08owner_id\x18\x02 \x01(\t\")\n\x12GetCodebaseRequest\x12\x13\n\x0b\x63odebase_id\x18\x01 \x01(\t\"O\n\x14ListCodebasesRequest\x12\x10\n\x08owner_id\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"Y\n\x15ListCodebasesResponse\x12\'\n\tcodebases\x18\x01 \x03(\x0b\x32\x14.sandbox.v1.Codebase\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\",\n\x15\x44\x65leteCodebaseRequest\x12\x13\n\x0b\x63odebase_id\x18\x01 \x01(\t\"\xa6\x01\n\x0bUploadChunk\x12\x34\n\x08metadata\x18\x01 \x01(\x0b\x32 .sandbox.v1.UploadChunk.MetadataH\x00\x12\x0e\n\x04\x64\x61ta\x18\x02 \x01(\x0cH\x00\x1a\x46\n\x08Metadata\x12\x13\n\x0b\x63odebase_id\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x03\x42\t\n\x07\x63ontent\"V\n\x0cUploadResult\x12\x13\n\x0b\x63odebase_id\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\x12\x0c\n\x04size\x18\x03 \x01(\x03\x12\x10\n\x08\x63hecksum\x18\x04 \x01(\t\"=\n\x13\x44ownloadFileRequest\x12\x13\n\x0b\x63odebase_id\x18\x01 \x01(\t\x12\x11\n\tfile_path\x18\x02 \x01(\t\"\x19\n\tFileChunk\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"H\n\x10ListFilesRequest\x12\x13\n\x0b\x63odebase_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\x11\n\trecursive\x18\x03 \x01(\x08\"8\n\x11ListFilesResponse\x12#\n\x05\x66iles\x18\x01 \x03(\x0b\x32\x14.sandbox.v1.FileInfo\"u\n\x08\x46ileInfo\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06is_dir\x18\x03 \x01(\x08\x12\x0c\n\x04size\x18\x04 \x01(\x03\x12/\n\x0bmodified_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xbd\x05\n\x0f\x43odebaseService\x12\x63\n\x0e\x43reateCodebase\x12!.sandbox.v1.CreateCodebaseRequest\x1a\x14.sandbox.v1.Codebase\"\x18\x82\xd3\xe4\x93\x02\x12\"\r/v1/codebases:\x01*\x12h\n\x0bGetCodebase\x12\x1e.sandbox.v1.GetCodebaseRequest\x1a\x14.sandbox.v1.Codebase\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/codebases/{codebase_id}\x12k\n\rListCodebases\x12 .sandbox.v1.ListCodebasesRequest\x1a!.sandbox.v1.ListCodebasesResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\x12\r/v1/codebases\x12k\n\x0e\x44\x65leteCodebase\x12!.sandbox.v1.DeleteCodebaseRequest\x1a\x11.sandbox.v1.Empty\"#\x82\xd3\xe4\x93\x02\x1d*\x1b/v1/codebases/{codebase_id}\x12\x42\n\x0bUploadFiles\x12\x17.sandbox.v1.UploadChunk\x1a\x18.sandbox.v1.UploadResult(\x01\x12H\n\x0c\x44ownloadFile\x12\x1f.sandbox.v1.DownloadFileRequest\x1a\x15.sandbox.v1.FileChunk0\x01\x12s\n\tListFiles\x12\x1c.sandbox.v1.ListFilesRequest\x1a\x1d.sandbox.v1.ListFilesResponse\")\x82\xd3\xe4\x93\x02#\x12!/v1/codebases/{codebase_id}/filesB=Z;github.com/AjaxZhan/AgentFense/api/gen/sandbox/v1;sandboxv1b\x06proto3')
31
+
32
+ _globals = globals()
33
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
34
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'codebase_pb2', _globals)
35
+ if not _descriptor._USE_C_DESCRIPTORS:
36
+ _globals['DESCRIPTOR']._loaded_options = None
37
+ _globals['DESCRIPTOR']._serialized_options = b'Z;github.com/AjaxZhan/AgentFense/api/gen/sandbox/v1;sandboxv1'
38
+ _globals['_CODEBASESERVICE'].methods_by_name['CreateCodebase']._loaded_options = None
39
+ _globals['_CODEBASESERVICE'].methods_by_name['CreateCodebase']._serialized_options = b'\202\323\344\223\002\022\"\r/v1/codebases:\001*'
40
+ _globals['_CODEBASESERVICE'].methods_by_name['GetCodebase']._loaded_options = None
41
+ _globals['_CODEBASESERVICE'].methods_by_name['GetCodebase']._serialized_options = b'\202\323\344\223\002\035\022\033/v1/codebases/{codebase_id}'
42
+ _globals['_CODEBASESERVICE'].methods_by_name['ListCodebases']._loaded_options = None
43
+ _globals['_CODEBASESERVICE'].methods_by_name['ListCodebases']._serialized_options = b'\202\323\344\223\002\017\022\r/v1/codebases'
44
+ _globals['_CODEBASESERVICE'].methods_by_name['DeleteCodebase']._loaded_options = None
45
+ _globals['_CODEBASESERVICE'].methods_by_name['DeleteCodebase']._serialized_options = b'\202\323\344\223\002\035*\033/v1/codebases/{codebase_id}'
46
+ _globals['_CODEBASESERVICE'].methods_by_name['ListFiles']._loaded_options = None
47
+ _globals['_CODEBASESERVICE'].methods_by_name['ListFiles']._serialized_options = b'\202\323\344\223\002#\022!/v1/codebases/{codebase_id}/files'
48
+ _globals['_CODEBASE']._serialized_start=108
49
+ _globals['_CODEBASE']._serialized_end=292
50
+ _globals['_CREATECODEBASEREQUEST']._serialized_start=294
51
+ _globals['_CREATECODEBASEREQUEST']._serialized_end=349
52
+ _globals['_GETCODEBASEREQUEST']._serialized_start=351
53
+ _globals['_GETCODEBASEREQUEST']._serialized_end=392
54
+ _globals['_LISTCODEBASESREQUEST']._serialized_start=394
55
+ _globals['_LISTCODEBASESREQUEST']._serialized_end=473
56
+ _globals['_LISTCODEBASESRESPONSE']._serialized_start=475
57
+ _globals['_LISTCODEBASESRESPONSE']._serialized_end=564
58
+ _globals['_DELETECODEBASEREQUEST']._serialized_start=566
59
+ _globals['_DELETECODEBASEREQUEST']._serialized_end=610
60
+ _globals['_UPLOADCHUNK']._serialized_start=613
61
+ _globals['_UPLOADCHUNK']._serialized_end=779
62
+ _globals['_UPLOADCHUNK_METADATA']._serialized_start=698
63
+ _globals['_UPLOADCHUNK_METADATA']._serialized_end=768
64
+ _globals['_UPLOADRESULT']._serialized_start=781
65
+ _globals['_UPLOADRESULT']._serialized_end=867
66
+ _globals['_DOWNLOADFILEREQUEST']._serialized_start=869
67
+ _globals['_DOWNLOADFILEREQUEST']._serialized_end=930
68
+ _globals['_FILECHUNK']._serialized_start=932
69
+ _globals['_FILECHUNK']._serialized_end=957
70
+ _globals['_LISTFILESREQUEST']._serialized_start=959
71
+ _globals['_LISTFILESREQUEST']._serialized_end=1031
72
+ _globals['_LISTFILESRESPONSE']._serialized_start=1033
73
+ _globals['_LISTFILESRESPONSE']._serialized_end=1089
74
+ _globals['_FILEINFO']._serialized_start=1091
75
+ _globals['_FILEINFO']._serialized_end=1208
76
+ _globals['_CODEBASESERVICE']._serialized_start=1211
77
+ _globals['_CODEBASESERVICE']._serialized_end=1912
78
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,141 @@
1
+ import datetime
2
+
3
+ from google.api import annotations_pb2 as _annotations_pb2
4
+ from google.protobuf import timestamp_pb2 as _timestamp_pb2
5
+ import common_pb2 as _common_pb2
6
+ from google.protobuf.internal import containers as _containers
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import message as _message
9
+ from collections.abc import Iterable as _Iterable, Mapping as _Mapping
10
+ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
11
+
12
+ DESCRIPTOR: _descriptor.FileDescriptor
13
+
14
+ class Codebase(_message.Message):
15
+ __slots__ = ("id", "name", "owner_id", "size", "file_count", "created_at", "updated_at")
16
+ ID_FIELD_NUMBER: _ClassVar[int]
17
+ NAME_FIELD_NUMBER: _ClassVar[int]
18
+ OWNER_ID_FIELD_NUMBER: _ClassVar[int]
19
+ SIZE_FIELD_NUMBER: _ClassVar[int]
20
+ FILE_COUNT_FIELD_NUMBER: _ClassVar[int]
21
+ CREATED_AT_FIELD_NUMBER: _ClassVar[int]
22
+ UPDATED_AT_FIELD_NUMBER: _ClassVar[int]
23
+ id: str
24
+ name: str
25
+ owner_id: str
26
+ size: int
27
+ file_count: int
28
+ created_at: _timestamp_pb2.Timestamp
29
+ updated_at: _timestamp_pb2.Timestamp
30
+ def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., owner_id: _Optional[str] = ..., size: _Optional[int] = ..., file_count: _Optional[int] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., updated_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ...
31
+
32
+ class CreateCodebaseRequest(_message.Message):
33
+ __slots__ = ("name", "owner_id")
34
+ NAME_FIELD_NUMBER: _ClassVar[int]
35
+ OWNER_ID_FIELD_NUMBER: _ClassVar[int]
36
+ name: str
37
+ owner_id: str
38
+ def __init__(self, name: _Optional[str] = ..., owner_id: _Optional[str] = ...) -> None: ...
39
+
40
+ class GetCodebaseRequest(_message.Message):
41
+ __slots__ = ("codebase_id",)
42
+ CODEBASE_ID_FIELD_NUMBER: _ClassVar[int]
43
+ codebase_id: str
44
+ def __init__(self, codebase_id: _Optional[str] = ...) -> None: ...
45
+
46
+ class ListCodebasesRequest(_message.Message):
47
+ __slots__ = ("owner_id", "page_size", "page_token")
48
+ OWNER_ID_FIELD_NUMBER: _ClassVar[int]
49
+ PAGE_SIZE_FIELD_NUMBER: _ClassVar[int]
50
+ PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
51
+ owner_id: str
52
+ page_size: int
53
+ page_token: str
54
+ def __init__(self, owner_id: _Optional[str] = ..., page_size: _Optional[int] = ..., page_token: _Optional[str] = ...) -> None: ...
55
+
56
+ class ListCodebasesResponse(_message.Message):
57
+ __slots__ = ("codebases", "next_page_token")
58
+ CODEBASES_FIELD_NUMBER: _ClassVar[int]
59
+ NEXT_PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
60
+ codebases: _containers.RepeatedCompositeFieldContainer[Codebase]
61
+ next_page_token: str
62
+ def __init__(self, codebases: _Optional[_Iterable[_Union[Codebase, _Mapping]]] = ..., next_page_token: _Optional[str] = ...) -> None: ...
63
+
64
+ class DeleteCodebaseRequest(_message.Message):
65
+ __slots__ = ("codebase_id",)
66
+ CODEBASE_ID_FIELD_NUMBER: _ClassVar[int]
67
+ codebase_id: str
68
+ def __init__(self, codebase_id: _Optional[str] = ...) -> None: ...
69
+
70
+ class UploadChunk(_message.Message):
71
+ __slots__ = ("metadata", "data")
72
+ class Metadata(_message.Message):
73
+ __slots__ = ("codebase_id", "file_path", "total_size")
74
+ CODEBASE_ID_FIELD_NUMBER: _ClassVar[int]
75
+ FILE_PATH_FIELD_NUMBER: _ClassVar[int]
76
+ TOTAL_SIZE_FIELD_NUMBER: _ClassVar[int]
77
+ codebase_id: str
78
+ file_path: str
79
+ total_size: int
80
+ def __init__(self, codebase_id: _Optional[str] = ..., file_path: _Optional[str] = ..., total_size: _Optional[int] = ...) -> None: ...
81
+ METADATA_FIELD_NUMBER: _ClassVar[int]
82
+ DATA_FIELD_NUMBER: _ClassVar[int]
83
+ metadata: UploadChunk.Metadata
84
+ data: bytes
85
+ def __init__(self, metadata: _Optional[_Union[UploadChunk.Metadata, _Mapping]] = ..., data: _Optional[bytes] = ...) -> None: ...
86
+
87
+ class UploadResult(_message.Message):
88
+ __slots__ = ("codebase_id", "file_path", "size", "checksum")
89
+ CODEBASE_ID_FIELD_NUMBER: _ClassVar[int]
90
+ FILE_PATH_FIELD_NUMBER: _ClassVar[int]
91
+ SIZE_FIELD_NUMBER: _ClassVar[int]
92
+ CHECKSUM_FIELD_NUMBER: _ClassVar[int]
93
+ codebase_id: str
94
+ file_path: str
95
+ size: int
96
+ checksum: str
97
+ def __init__(self, codebase_id: _Optional[str] = ..., file_path: _Optional[str] = ..., size: _Optional[int] = ..., checksum: _Optional[str] = ...) -> None: ...
98
+
99
+ class DownloadFileRequest(_message.Message):
100
+ __slots__ = ("codebase_id", "file_path")
101
+ CODEBASE_ID_FIELD_NUMBER: _ClassVar[int]
102
+ FILE_PATH_FIELD_NUMBER: _ClassVar[int]
103
+ codebase_id: str
104
+ file_path: str
105
+ def __init__(self, codebase_id: _Optional[str] = ..., file_path: _Optional[str] = ...) -> None: ...
106
+
107
+ class FileChunk(_message.Message):
108
+ __slots__ = ("data",)
109
+ DATA_FIELD_NUMBER: _ClassVar[int]
110
+ data: bytes
111
+ def __init__(self, data: _Optional[bytes] = ...) -> None: ...
112
+
113
+ class ListFilesRequest(_message.Message):
114
+ __slots__ = ("codebase_id", "path", "recursive")
115
+ CODEBASE_ID_FIELD_NUMBER: _ClassVar[int]
116
+ PATH_FIELD_NUMBER: _ClassVar[int]
117
+ RECURSIVE_FIELD_NUMBER: _ClassVar[int]
118
+ codebase_id: str
119
+ path: str
120
+ recursive: bool
121
+ def __init__(self, codebase_id: _Optional[str] = ..., path: _Optional[str] = ..., recursive: bool = ...) -> None: ...
122
+
123
+ class ListFilesResponse(_message.Message):
124
+ __slots__ = ("files",)
125
+ FILES_FIELD_NUMBER: _ClassVar[int]
126
+ files: _containers.RepeatedCompositeFieldContainer[FileInfo]
127
+ def __init__(self, files: _Optional[_Iterable[_Union[FileInfo, _Mapping]]] = ...) -> None: ...
128
+
129
+ class FileInfo(_message.Message):
130
+ __slots__ = ("path", "name", "is_dir", "size", "modified_at")
131
+ PATH_FIELD_NUMBER: _ClassVar[int]
132
+ NAME_FIELD_NUMBER: _ClassVar[int]
133
+ IS_DIR_FIELD_NUMBER: _ClassVar[int]
134
+ SIZE_FIELD_NUMBER: _ClassVar[int]
135
+ MODIFIED_AT_FIELD_NUMBER: _ClassVar[int]
136
+ path: str
137
+ name: str
138
+ is_dir: bool
139
+ size: int
140
+ modified_at: _timestamp_pb2.Timestamp
141
+ def __init__(self, path: _Optional[str] = ..., name: _Optional[str] = ..., is_dir: bool = ..., size: _Optional[int] = ..., modified_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ...
@@ -0,0 +1,366 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ from . import codebase_pb2 as codebase__pb2
7
+ from . import common_pb2 as common__pb2
8
+
9
+ GRPC_GENERATED_VERSION = '1.76.0'
10
+ GRPC_VERSION = grpc.__version__
11
+ _version_not_supported = False
12
+
13
+ try:
14
+ from grpc._utilities import first_version_is_lower
15
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
16
+ except ImportError:
17
+ _version_not_supported = True
18
+
19
+ if _version_not_supported:
20
+ raise RuntimeError(
21
+ f'The grpc package installed is at version {GRPC_VERSION},'
22
+ + ' but the generated code in codebase_pb2_grpc.py depends on'
23
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
24
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
25
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
26
+ )
27
+
28
+
29
+ class CodebaseServiceStub(object):
30
+ """CodebaseService manages user codebases (file folders)
31
+ """
32
+
33
+ def __init__(self, channel):
34
+ """Constructor.
35
+
36
+ Args:
37
+ channel: A grpc.Channel.
38
+ """
39
+ self.CreateCodebase = channel.unary_unary(
40
+ '/sandbox.v1.CodebaseService/CreateCodebase',
41
+ request_serializer=codebase__pb2.CreateCodebaseRequest.SerializeToString,
42
+ response_deserializer=codebase__pb2.Codebase.FromString,
43
+ _registered_method=True)
44
+ self.GetCodebase = channel.unary_unary(
45
+ '/sandbox.v1.CodebaseService/GetCodebase',
46
+ request_serializer=codebase__pb2.GetCodebaseRequest.SerializeToString,
47
+ response_deserializer=codebase__pb2.Codebase.FromString,
48
+ _registered_method=True)
49
+ self.ListCodebases = channel.unary_unary(
50
+ '/sandbox.v1.CodebaseService/ListCodebases',
51
+ request_serializer=codebase__pb2.ListCodebasesRequest.SerializeToString,
52
+ response_deserializer=codebase__pb2.ListCodebasesResponse.FromString,
53
+ _registered_method=True)
54
+ self.DeleteCodebase = channel.unary_unary(
55
+ '/sandbox.v1.CodebaseService/DeleteCodebase',
56
+ request_serializer=codebase__pb2.DeleteCodebaseRequest.SerializeToString,
57
+ response_deserializer=common__pb2.Empty.FromString,
58
+ _registered_method=True)
59
+ self.UploadFiles = channel.stream_unary(
60
+ '/sandbox.v1.CodebaseService/UploadFiles',
61
+ request_serializer=codebase__pb2.UploadChunk.SerializeToString,
62
+ response_deserializer=codebase__pb2.UploadResult.FromString,
63
+ _registered_method=True)
64
+ self.DownloadFile = channel.unary_stream(
65
+ '/sandbox.v1.CodebaseService/DownloadFile',
66
+ request_serializer=codebase__pb2.DownloadFileRequest.SerializeToString,
67
+ response_deserializer=codebase__pb2.FileChunk.FromString,
68
+ _registered_method=True)
69
+ self.ListFiles = channel.unary_unary(
70
+ '/sandbox.v1.CodebaseService/ListFiles',
71
+ request_serializer=codebase__pb2.ListFilesRequest.SerializeToString,
72
+ response_deserializer=codebase__pb2.ListFilesResponse.FromString,
73
+ _registered_method=True)
74
+
75
+
76
+ class CodebaseServiceServicer(object):
77
+ """CodebaseService manages user codebases (file folders)
78
+ """
79
+
80
+ def CreateCodebase(self, request, context):
81
+ """CreateCodebase creates a new codebase
82
+ """
83
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
84
+ context.set_details('Method not implemented!')
85
+ raise NotImplementedError('Method not implemented!')
86
+
87
+ def GetCodebase(self, request, context):
88
+ """GetCodebase retrieves information about a codebase
89
+ """
90
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
91
+ context.set_details('Method not implemented!')
92
+ raise NotImplementedError('Method not implemented!')
93
+
94
+ def ListCodebases(self, request, context):
95
+ """ListCodebases lists all codebases for an owner
96
+ """
97
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
98
+ context.set_details('Method not implemented!')
99
+ raise NotImplementedError('Method not implemented!')
100
+
101
+ def DeleteCodebase(self, request, context):
102
+ """DeleteCodebase deletes a codebase
103
+ """
104
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
105
+ context.set_details('Method not implemented!')
106
+ raise NotImplementedError('Method not implemented!')
107
+
108
+ def UploadFiles(self, request_iterator, context):
109
+ """UploadFiles uploads files to a codebase
110
+ """
111
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
112
+ context.set_details('Method not implemented!')
113
+ raise NotImplementedError('Method not implemented!')
114
+
115
+ def DownloadFile(self, request, context):
116
+ """DownloadFile downloads a file from a codebase
117
+ """
118
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
119
+ context.set_details('Method not implemented!')
120
+ raise NotImplementedError('Method not implemented!')
121
+
122
+ def ListFiles(self, request, context):
123
+ """ListFiles lists files in a codebase directory
124
+ """
125
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
126
+ context.set_details('Method not implemented!')
127
+ raise NotImplementedError('Method not implemented!')
128
+
129
+
130
+ def add_CodebaseServiceServicer_to_server(servicer, server):
131
+ rpc_method_handlers = {
132
+ 'CreateCodebase': grpc.unary_unary_rpc_method_handler(
133
+ servicer.CreateCodebase,
134
+ request_deserializer=codebase__pb2.CreateCodebaseRequest.FromString,
135
+ response_serializer=codebase__pb2.Codebase.SerializeToString,
136
+ ),
137
+ 'GetCodebase': grpc.unary_unary_rpc_method_handler(
138
+ servicer.GetCodebase,
139
+ request_deserializer=codebase__pb2.GetCodebaseRequest.FromString,
140
+ response_serializer=codebase__pb2.Codebase.SerializeToString,
141
+ ),
142
+ 'ListCodebases': grpc.unary_unary_rpc_method_handler(
143
+ servicer.ListCodebases,
144
+ request_deserializer=codebase__pb2.ListCodebasesRequest.FromString,
145
+ response_serializer=codebase__pb2.ListCodebasesResponse.SerializeToString,
146
+ ),
147
+ 'DeleteCodebase': grpc.unary_unary_rpc_method_handler(
148
+ servicer.DeleteCodebase,
149
+ request_deserializer=codebase__pb2.DeleteCodebaseRequest.FromString,
150
+ response_serializer=common__pb2.Empty.SerializeToString,
151
+ ),
152
+ 'UploadFiles': grpc.stream_unary_rpc_method_handler(
153
+ servicer.UploadFiles,
154
+ request_deserializer=codebase__pb2.UploadChunk.FromString,
155
+ response_serializer=codebase__pb2.UploadResult.SerializeToString,
156
+ ),
157
+ 'DownloadFile': grpc.unary_stream_rpc_method_handler(
158
+ servicer.DownloadFile,
159
+ request_deserializer=codebase__pb2.DownloadFileRequest.FromString,
160
+ response_serializer=codebase__pb2.FileChunk.SerializeToString,
161
+ ),
162
+ 'ListFiles': grpc.unary_unary_rpc_method_handler(
163
+ servicer.ListFiles,
164
+ request_deserializer=codebase__pb2.ListFilesRequest.FromString,
165
+ response_serializer=codebase__pb2.ListFilesResponse.SerializeToString,
166
+ ),
167
+ }
168
+ generic_handler = grpc.method_handlers_generic_handler(
169
+ 'sandbox.v1.CodebaseService', rpc_method_handlers)
170
+ server.add_generic_rpc_handlers((generic_handler,))
171
+ server.add_registered_method_handlers('sandbox.v1.CodebaseService', rpc_method_handlers)
172
+
173
+
174
+ # This class is part of an EXPERIMENTAL API.
175
+ class CodebaseService(object):
176
+ """CodebaseService manages user codebases (file folders)
177
+ """
178
+
179
+ @staticmethod
180
+ def CreateCodebase(request,
181
+ target,
182
+ options=(),
183
+ channel_credentials=None,
184
+ call_credentials=None,
185
+ insecure=False,
186
+ compression=None,
187
+ wait_for_ready=None,
188
+ timeout=None,
189
+ metadata=None):
190
+ return grpc.experimental.unary_unary(
191
+ request,
192
+ target,
193
+ '/sandbox.v1.CodebaseService/CreateCodebase',
194
+ codebase__pb2.CreateCodebaseRequest.SerializeToString,
195
+ codebase__pb2.Codebase.FromString,
196
+ options,
197
+ channel_credentials,
198
+ insecure,
199
+ call_credentials,
200
+ compression,
201
+ wait_for_ready,
202
+ timeout,
203
+ metadata,
204
+ _registered_method=True)
205
+
206
+ @staticmethod
207
+ def GetCodebase(request,
208
+ target,
209
+ options=(),
210
+ channel_credentials=None,
211
+ call_credentials=None,
212
+ insecure=False,
213
+ compression=None,
214
+ wait_for_ready=None,
215
+ timeout=None,
216
+ metadata=None):
217
+ return grpc.experimental.unary_unary(
218
+ request,
219
+ target,
220
+ '/sandbox.v1.CodebaseService/GetCodebase',
221
+ codebase__pb2.GetCodebaseRequest.SerializeToString,
222
+ codebase__pb2.Codebase.FromString,
223
+ options,
224
+ channel_credentials,
225
+ insecure,
226
+ call_credentials,
227
+ compression,
228
+ wait_for_ready,
229
+ timeout,
230
+ metadata,
231
+ _registered_method=True)
232
+
233
+ @staticmethod
234
+ def ListCodebases(request,
235
+ target,
236
+ options=(),
237
+ channel_credentials=None,
238
+ call_credentials=None,
239
+ insecure=False,
240
+ compression=None,
241
+ wait_for_ready=None,
242
+ timeout=None,
243
+ metadata=None):
244
+ return grpc.experimental.unary_unary(
245
+ request,
246
+ target,
247
+ '/sandbox.v1.CodebaseService/ListCodebases',
248
+ codebase__pb2.ListCodebasesRequest.SerializeToString,
249
+ codebase__pb2.ListCodebasesResponse.FromString,
250
+ options,
251
+ channel_credentials,
252
+ insecure,
253
+ call_credentials,
254
+ compression,
255
+ wait_for_ready,
256
+ timeout,
257
+ metadata,
258
+ _registered_method=True)
259
+
260
+ @staticmethod
261
+ def DeleteCodebase(request,
262
+ target,
263
+ options=(),
264
+ channel_credentials=None,
265
+ call_credentials=None,
266
+ insecure=False,
267
+ compression=None,
268
+ wait_for_ready=None,
269
+ timeout=None,
270
+ metadata=None):
271
+ return grpc.experimental.unary_unary(
272
+ request,
273
+ target,
274
+ '/sandbox.v1.CodebaseService/DeleteCodebase',
275
+ codebase__pb2.DeleteCodebaseRequest.SerializeToString,
276
+ common__pb2.Empty.FromString,
277
+ options,
278
+ channel_credentials,
279
+ insecure,
280
+ call_credentials,
281
+ compression,
282
+ wait_for_ready,
283
+ timeout,
284
+ metadata,
285
+ _registered_method=True)
286
+
287
+ @staticmethod
288
+ def UploadFiles(request_iterator,
289
+ target,
290
+ options=(),
291
+ channel_credentials=None,
292
+ call_credentials=None,
293
+ insecure=False,
294
+ compression=None,
295
+ wait_for_ready=None,
296
+ timeout=None,
297
+ metadata=None):
298
+ return grpc.experimental.stream_unary(
299
+ request_iterator,
300
+ target,
301
+ '/sandbox.v1.CodebaseService/UploadFiles',
302
+ codebase__pb2.UploadChunk.SerializeToString,
303
+ codebase__pb2.UploadResult.FromString,
304
+ options,
305
+ channel_credentials,
306
+ insecure,
307
+ call_credentials,
308
+ compression,
309
+ wait_for_ready,
310
+ timeout,
311
+ metadata,
312
+ _registered_method=True)
313
+
314
+ @staticmethod
315
+ def DownloadFile(request,
316
+ target,
317
+ options=(),
318
+ channel_credentials=None,
319
+ call_credentials=None,
320
+ insecure=False,
321
+ compression=None,
322
+ wait_for_ready=None,
323
+ timeout=None,
324
+ metadata=None):
325
+ return grpc.experimental.unary_stream(
326
+ request,
327
+ target,
328
+ '/sandbox.v1.CodebaseService/DownloadFile',
329
+ codebase__pb2.DownloadFileRequest.SerializeToString,
330
+ codebase__pb2.FileChunk.FromString,
331
+ options,
332
+ channel_credentials,
333
+ insecure,
334
+ call_credentials,
335
+ compression,
336
+ wait_for_ready,
337
+ timeout,
338
+ metadata,
339
+ _registered_method=True)
340
+
341
+ @staticmethod
342
+ def ListFiles(request,
343
+ target,
344
+ options=(),
345
+ channel_credentials=None,
346
+ call_credentials=None,
347
+ insecure=False,
348
+ compression=None,
349
+ wait_for_ready=None,
350
+ timeout=None,
351
+ metadata=None):
352
+ return grpc.experimental.unary_unary(
353
+ request,
354
+ target,
355
+ '/sandbox.v1.CodebaseService/ListFiles',
356
+ codebase__pb2.ListFilesRequest.SerializeToString,
357
+ codebase__pb2.ListFilesResponse.FromString,
358
+ options,
359
+ channel_credentials,
360
+ insecure,
361
+ call_credentials,
362
+ compression,
363
+ wait_for_ready,
364
+ timeout,
365
+ metadata,
366
+ _registered_method=True)
@@ -0,0 +1,47 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: common.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'common.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x63ommon.proto\x12\nsandbox.v1\"\x86\x01\n\x0ePermissionRule\x12\x0f\n\x07pattern\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0e\x32\x17.sandbox.v1.PatternType\x12*\n\npermission\x18\x03 \x01(\x0e\x32\x16.sandbox.v1.Permission\x12\x10\n\x08priority\x18\x04 \x01(\x05\"\x07\n\x05\x45mpty*}\n\nPermission\x12\x1a\n\x16PERMISSION_UNSPECIFIED\x10\x00\x12\x13\n\x0fPERMISSION_NONE\x10\x01\x12\x13\n\x0fPERMISSION_VIEW\x10\x02\x12\x13\n\x0fPERMISSION_READ\x10\x03\x12\x14\n\x10PERMISSION_WRITE\x10\x04*u\n\x0bPatternType\x12\x1c\n\x18PATTERN_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11PATTERN_TYPE_GLOB\x10\x01\x12\x1a\n\x16PATTERN_TYPE_DIRECTORY\x10\x02\x12\x15\n\x11PATTERN_TYPE_FILE\x10\x03*\x9d\x01\n\rSandboxStatus\x12\x1e\n\x1aSANDBOX_STATUS_UNSPECIFIED\x10\x00\x12\x1a\n\x16SANDBOX_STATUS_PENDING\x10\x01\x12\x1a\n\x16SANDBOX_STATUS_RUNNING\x10\x02\x12\x1a\n\x16SANDBOX_STATUS_STOPPED\x10\x03\x12\x18\n\x14SANDBOX_STATUS_ERROR\x10\x04*e\n\rSessionStatus\x12\x1e\n\x1aSESSION_STATUS_UNSPECIFIED\x10\x00\x12\x19\n\x15SESSION_STATUS_ACTIVE\x10\x01\x12\x19\n\x15SESSION_STATUS_CLOSED\x10\x02\x42=Z;github.com/AjaxZhan/AgentFense/api/gen/sandbox/v1;sandboxv1b\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'common_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ _globals['DESCRIPTOR']._loaded_options = None
34
+ _globals['DESCRIPTOR']._serialized_options = b'Z;github.com/AjaxZhan/AgentFense/api/gen/sandbox/v1;sandboxv1'
35
+ _globals['_PERMISSION']._serialized_start=174
36
+ _globals['_PERMISSION']._serialized_end=299
37
+ _globals['_PATTERNTYPE']._serialized_start=301
38
+ _globals['_PATTERNTYPE']._serialized_end=418
39
+ _globals['_SANDBOXSTATUS']._serialized_start=421
40
+ _globals['_SANDBOXSTATUS']._serialized_end=578
41
+ _globals['_SESSIONSTATUS']._serialized_start=580
42
+ _globals['_SESSIONSTATUS']._serialized_end=681
43
+ _globals['_PERMISSIONRULE']._serialized_start=29
44
+ _globals['_PERMISSIONRULE']._serialized_end=163
45
+ _globals['_EMPTY']._serialized_start=165
46
+ _globals['_EMPTY']._serialized_end=172
47
+ # @@protoc_insertion_point(module_scope)