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

feat(framework) Add abstract user auth plugin #4618

Merged
merged 35 commits into from
Dec 10, 2024
Merged

Conversation

danielnugraha
Copy link
Contributor

@danielnugraha danielnugraha commented Dec 3, 2024

This is the second PR introducing user authentication. The changes include:

  • Adding abstract base classes: ExecAuthPlugin and CliAuthPlugin.

Please merge #4244 first before merging this PR.

src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
src/py/flwr/common/auth_plugin/auth_plugin.py Outdated Show resolved Hide resolved
panh99
panh99 previously approved these changes Dec 4, 2024
Copy link
Contributor

@panh99 panh99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

panh99
panh99 previously approved these changes Dec 4, 2024
@panh99 panh99 changed the base branch from main to add-flwr-login December 4, 2024 13:57
@panh99 panh99 force-pushed the add-abc-auth-plugin branch from 5d3eb8b to 473cd86 Compare December 6, 2024 08:10
panh99
panh99 previously approved these changes Dec 6, 2024
@panh99 panh99 force-pushed the add-abc-auth-plugin branch from da5de46 to ac88a18 Compare December 7, 2024 16:04
@abstractmethod
def login(
login_details: dict[str, str],
config: dict[str, Any],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it better to make use of some of the types we have for configs ? For example

UserConfig = dict[str, UserConfigValue]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function expects a json dictionary here, and it would be rather flexible if we just use dict[str, Any]. Though we normally just need to store scalars in the json dict, I am not quite sure what's the benefit of enforcing a stricter type here.

Copy link
Contributor

@jafermarq jafermarq Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It receives a {string: string} (

message GetLoginDetailsResponse { map<string, string> login_details = 1; }
) unless we modify the exec.proto. Happy to leave it as Any, but in other parts of the code we are more strict with these things (e.g. typing.UserConfig)

Base automatically changed from add-flwr-login to main December 9, 2024 13:20
@danieljanes danieljanes dismissed panh99’s stale review December 9, 2024 13:20

The base branch was changed.

@danieljanes danieljanes enabled auto-merge (squash) December 10, 2024 13:59
@danieljanes danieljanes merged commit 1b43ac7 into main Dec 10, 2024
55 checks passed
@danieljanes danieljanes deleted the add-abc-auth-plugin branch December 10, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants