Skip to content

Commit 69bb5d8

Browse files
committed
netauth/_gen: add generated code
1 parent 9953476 commit 69bb5d8

11 files changed

+2004
-0
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "protocol"]
2+
path = protocol
3+
url = https://github.com/netauth/protocol.git

Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
%PHONY: generate clean
2+
3+
generate: protocol/netauth.proto protocol/v2/rpc.proto
4+
$(VENV)/bin/python3 -m grpc_tools.protoc -I ./protocol \
5+
--python_out=netauth/_gen --pyi_out=netauth/_gen --grpc_python_out=netauth/_gen \
6+
./protocol/netauth.proto ./protocol/v2/rpc.proto
7+
# correct imports
8+
sed -i netauth/_gen/v2/rpc_pb2.py -e 's/import netauth_pb2/from .. &/'
9+
sed -i netauth/_gen/v2/rpc_pb2_grpc.py -e 's/from v2/from ./'
10+
11+
%.proto:
12+
@echo "Missing protocol definitions. Are submodules checked out?"
13+
14+
clean:
15+
rm netauth/_gen/netauth_pb2*
16+
rm netauth/_gen/v2/rpc_pb2*

netauth/_gen/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from . import v2 # noqa: F401
2+
from .netauth_pb2 import * # noqa: F403
3+
from .netauth_pb2_grpc import * # noqa: F403

netauth/_gen/netauth_pb2.py

+39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netauth/_gen/netauth_pb2.pyi

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
from google.protobuf.internal import containers as _containers
2+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
3+
from google.protobuf import descriptor as _descriptor
4+
from google.protobuf import message as _message
5+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
6+
7+
DESCRIPTOR: _descriptor.FileDescriptor
8+
9+
class Capability(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
10+
__slots__ = ()
11+
GLOBAL_ROOT: _ClassVar[Capability]
12+
CREATE_ENTITY: _ClassVar[Capability]
13+
DESTROY_ENTITY: _ClassVar[Capability]
14+
MODIFY_ENTITY_META: _ClassVar[Capability]
15+
MODIFY_ENTITY_KEYS: _ClassVar[Capability]
16+
CHANGE_ENTITY_SECRET: _ClassVar[Capability]
17+
LOCK_ENTITY: _ClassVar[Capability]
18+
UNLOCK_ENTITY: _ClassVar[Capability]
19+
CREATE_GROUP: _ClassVar[Capability]
20+
DESTROY_GROUP: _ClassVar[Capability]
21+
MODIFY_GROUP_META: _ClassVar[Capability]
22+
MODIFY_GROUP_MEMBERS: _ClassVar[Capability]
23+
24+
class ExpansionMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
25+
__slots__ = ()
26+
INCLUDE: _ClassVar[ExpansionMode]
27+
EXCLUDE: _ClassVar[ExpansionMode]
28+
DROP: _ClassVar[ExpansionMode]
29+
GLOBAL_ROOT: Capability
30+
CREATE_ENTITY: Capability
31+
DESTROY_ENTITY: Capability
32+
MODIFY_ENTITY_META: Capability
33+
MODIFY_ENTITY_KEYS: Capability
34+
CHANGE_ENTITY_SECRET: Capability
35+
LOCK_ENTITY: Capability
36+
UNLOCK_ENTITY: Capability
37+
CREATE_GROUP: Capability
38+
DESTROY_GROUP: Capability
39+
MODIFY_GROUP_META: Capability
40+
MODIFY_GROUP_MEMBERS: Capability
41+
INCLUDE: ExpansionMode
42+
EXCLUDE: ExpansionMode
43+
DROP: ExpansionMode
44+
45+
class KVData(_message.Message):
46+
__slots__ = ("Key", "Values")
47+
KEY_FIELD_NUMBER: _ClassVar[int]
48+
VALUES_FIELD_NUMBER: _ClassVar[int]
49+
Key: str
50+
Values: _containers.RepeatedCompositeFieldContainer[KVValue]
51+
def __init__(self, Key: _Optional[str] = ..., Values: _Optional[_Iterable[_Union[KVValue, _Mapping]]] = ...) -> None: ...
52+
53+
class KVValue(_message.Message):
54+
__slots__ = ("Value", "Index")
55+
VALUE_FIELD_NUMBER: _ClassVar[int]
56+
INDEX_FIELD_NUMBER: _ClassVar[int]
57+
Value: str
58+
Index: int
59+
def __init__(self, Value: _Optional[str] = ..., Index: _Optional[int] = ...) -> None: ...
60+
61+
class Entity(_message.Message):
62+
__slots__ = ("ID", "Number", "secret", "meta")
63+
ID_FIELD_NUMBER: _ClassVar[int]
64+
NUMBER_FIELD_NUMBER: _ClassVar[int]
65+
SECRET_FIELD_NUMBER: _ClassVar[int]
66+
META_FIELD_NUMBER: _ClassVar[int]
67+
ID: str
68+
Number: int
69+
secret: str
70+
meta: EntityMeta
71+
def __init__(self, ID: _Optional[str] = ..., Number: _Optional[int] = ..., secret: _Optional[str] = ..., meta: _Optional[_Union[EntityMeta, _Mapping]] = ...) -> None: ...
72+
73+
class EntityMeta(_message.Message):
74+
__slots__ = ("PrimaryGroup", "GECOS", "LegalName", "DisplayName", "Home", "Shell", "GraphicalShell", "BadgeNumber", "Locked", "Groups", "Capabilities", "Keys", "UntypedMeta", "KV")
75+
PRIMARYGROUP_FIELD_NUMBER: _ClassVar[int]
76+
GECOS_FIELD_NUMBER: _ClassVar[int]
77+
LEGALNAME_FIELD_NUMBER: _ClassVar[int]
78+
DISPLAYNAME_FIELD_NUMBER: _ClassVar[int]
79+
HOME_FIELD_NUMBER: _ClassVar[int]
80+
SHELL_FIELD_NUMBER: _ClassVar[int]
81+
GRAPHICALSHELL_FIELD_NUMBER: _ClassVar[int]
82+
BADGENUMBER_FIELD_NUMBER: _ClassVar[int]
83+
LOCKED_FIELD_NUMBER: _ClassVar[int]
84+
GROUPS_FIELD_NUMBER: _ClassVar[int]
85+
CAPABILITIES_FIELD_NUMBER: _ClassVar[int]
86+
KEYS_FIELD_NUMBER: _ClassVar[int]
87+
UNTYPEDMETA_FIELD_NUMBER: _ClassVar[int]
88+
KV_FIELD_NUMBER: _ClassVar[int]
89+
PrimaryGroup: str
90+
GECOS: str
91+
LegalName: str
92+
DisplayName: str
93+
Home: str
94+
Shell: str
95+
GraphicalShell: str
96+
BadgeNumber: str
97+
Locked: bool
98+
Groups: _containers.RepeatedScalarFieldContainer[str]
99+
Capabilities: _containers.RepeatedScalarFieldContainer[Capability]
100+
Keys: _containers.RepeatedScalarFieldContainer[str]
101+
UntypedMeta: _containers.RepeatedScalarFieldContainer[str]
102+
KV: _containers.RepeatedCompositeFieldContainer[KVData]
103+
def __init__(self, PrimaryGroup: _Optional[str] = ..., GECOS: _Optional[str] = ..., LegalName: _Optional[str] = ..., DisplayName: _Optional[str] = ..., Home: _Optional[str] = ..., Shell: _Optional[str] = ..., GraphicalShell: _Optional[str] = ..., BadgeNumber: _Optional[str] = ..., Locked: bool = ..., Groups: _Optional[_Iterable[str]] = ..., Capabilities: _Optional[_Iterable[_Union[Capability, str]]] = ..., Keys: _Optional[_Iterable[str]] = ..., UntypedMeta: _Optional[_Iterable[str]] = ..., KV: _Optional[_Iterable[_Union[KVData, _Mapping]]] = ...) -> None: ...
104+
105+
class Group(_message.Message):
106+
__slots__ = ("Name", "DisplayName", "Number", "ManagedBy", "Capabilities", "Expansions", "UntypedMeta", "KV")
107+
NAME_FIELD_NUMBER: _ClassVar[int]
108+
DISPLAYNAME_FIELD_NUMBER: _ClassVar[int]
109+
NUMBER_FIELD_NUMBER: _ClassVar[int]
110+
MANAGEDBY_FIELD_NUMBER: _ClassVar[int]
111+
CAPABILITIES_FIELD_NUMBER: _ClassVar[int]
112+
EXPANSIONS_FIELD_NUMBER: _ClassVar[int]
113+
UNTYPEDMETA_FIELD_NUMBER: _ClassVar[int]
114+
KV_FIELD_NUMBER: _ClassVar[int]
115+
Name: str
116+
DisplayName: str
117+
Number: int
118+
ManagedBy: str
119+
Capabilities: _containers.RepeatedScalarFieldContainer[Capability]
120+
Expansions: _containers.RepeatedScalarFieldContainer[str]
121+
UntypedMeta: _containers.RepeatedScalarFieldContainer[str]
122+
KV: _containers.RepeatedCompositeFieldContainer[KVData]
123+
def __init__(self, Name: _Optional[str] = ..., DisplayName: _Optional[str] = ..., Number: _Optional[int] = ..., ManagedBy: _Optional[str] = ..., Capabilities: _Optional[_Iterable[_Union[Capability, str]]] = ..., Expansions: _Optional[_Iterable[str]] = ..., UntypedMeta: _Optional[_Iterable[str]] = ..., KV: _Optional[_Iterable[_Union[KVData, _Mapping]]] = ...) -> None: ...

netauth/_gen/netauth_pb2_grpc.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
7+
GRPC_GENERATED_VERSION = '1.65.1'
8+
GRPC_VERSION = grpc.__version__
9+
EXPECTED_ERROR_RELEASE = '1.66.0'
10+
SCHEDULED_RELEASE_DATE = 'August 6, 2024'
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+
warnings.warn(
21+
f'The grpc package installed is at version {GRPC_VERSION},'
22+
+ f' but the generated code in netauth_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+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
27+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
28+
RuntimeWarning
29+
)

netauth/_gen/v2/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from .rpc_pb2 import * # noqa: F403
2+
from .rpc_pb2_grpc import * # noqa: F403

netauth/_gen/v2/rpc_pb2.py

+64
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)