Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(framework) Amend user auth protocols in exec.proto for strong typing #4701

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/proto/flwr/proto/exec.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,19 @@ message ListRunsResponse {
}

message GetLoginDetailsRequest {}
message GetLoginDetailsResponse { map<string, string> login_details = 1; }
message GetLoginDetailsResponse {
string auth_type = 1;
string device_code = 2;
string verification_uri_complete = 3;
int64 expires_in = 4;
int64 interval = 5;
}

message GetAuthTokensRequest { map<string, string> auth_details = 1; }
message GetAuthTokensResponse { map<string, string> auth_tokens = 1; }
message GetAuthTokensRequest { string device_code = 1; }
message GetAuthTokensResponse {
string access_token = 1;
string refresh_token = 2;
}

message StopRunRequest { uint64 run_id = 1; }
message StopRunResponse { bool success = 1; }
36 changes: 12 additions & 24 deletions src/py/flwr/proto/exec_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 27 additions & 54 deletions src/py/flwr/proto/exec_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -143,77 +143,50 @@ global___GetLoginDetailsRequest = GetLoginDetailsRequest

class GetLoginDetailsResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
class LoginDetailsEntry(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
KEY_FIELD_NUMBER: builtins.int
VALUE_FIELD_NUMBER: builtins.int
key: typing.Text
value: typing.Text
def __init__(self,
*,
key: typing.Text = ...,
value: typing.Text = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...

LOGIN_DETAILS_FIELD_NUMBER: builtins.int
@property
def login_details(self) -> google.protobuf.internal.containers.ScalarMap[typing.Text, typing.Text]: ...
AUTH_TYPE_FIELD_NUMBER: builtins.int
DEVICE_CODE_FIELD_NUMBER: builtins.int
VERIFICATION_URI_COMPLETE_FIELD_NUMBER: builtins.int
EXPIRES_IN_FIELD_NUMBER: builtins.int
INTERVAL_FIELD_NUMBER: builtins.int
auth_type: typing.Text
device_code: typing.Text
verification_uri_complete: typing.Text
expires_in: builtins.int
interval: builtins.int
def __init__(self,
*,
login_details: typing.Optional[typing.Mapping[typing.Text, typing.Text]] = ...,
auth_type: typing.Text = ...,
device_code: typing.Text = ...,
verification_uri_complete: typing.Text = ...,
expires_in: builtins.int = ...,
interval: builtins.int = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["login_details",b"login_details"]) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["auth_type",b"auth_type","device_code",b"device_code","expires_in",b"expires_in","interval",b"interval","verification_uri_complete",b"verification_uri_complete"]) -> None: ...
global___GetLoginDetailsResponse = GetLoginDetailsResponse

class GetAuthTokensRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
class AuthDetailsEntry(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
KEY_FIELD_NUMBER: builtins.int
VALUE_FIELD_NUMBER: builtins.int
key: typing.Text
value: typing.Text
def __init__(self,
*,
key: typing.Text = ...,
value: typing.Text = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...

AUTH_DETAILS_FIELD_NUMBER: builtins.int
@property
def auth_details(self) -> google.protobuf.internal.containers.ScalarMap[typing.Text, typing.Text]: ...
DEVICE_CODE_FIELD_NUMBER: builtins.int
device_code: typing.Text
def __init__(self,
*,
auth_details: typing.Optional[typing.Mapping[typing.Text, typing.Text]] = ...,
device_code: typing.Text = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["auth_details",b"auth_details"]) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["device_code",b"device_code"]) -> None: ...
global___GetAuthTokensRequest = GetAuthTokensRequest

class GetAuthTokensResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
class AuthTokensEntry(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
KEY_FIELD_NUMBER: builtins.int
VALUE_FIELD_NUMBER: builtins.int
key: typing.Text
value: typing.Text
def __init__(self,
*,
key: typing.Text = ...,
value: typing.Text = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...

AUTH_TOKENS_FIELD_NUMBER: builtins.int
@property
def auth_tokens(self) -> google.protobuf.internal.containers.ScalarMap[typing.Text, typing.Text]: ...
ACCESS_TOKEN_FIELD_NUMBER: builtins.int
REFRESH_TOKEN_FIELD_NUMBER: builtins.int
access_token: typing.Text
refresh_token: typing.Text
def __init__(self,
*,
auth_tokens: typing.Optional[typing.Mapping[typing.Text, typing.Text]] = ...,
access_token: typing.Text = ...,
refresh_token: typing.Text = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["auth_tokens",b"auth_tokens"]) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["access_token",b"access_token","refresh_token",b"refresh_token"]) -> None: ...
global___GetAuthTokensResponse = GetAuthTokensResponse

class StopRunRequest(google.protobuf.message.Message):
Expand Down
Loading