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

✨ web-api: user's privacy settings #6904

Merged
merged 37 commits into from
Dec 6, 2024

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Dec 4, 2024

What do these changes do?

ReDoc

This PR introduces a draft for implementing privacy controls for user profiles. Key points include:

  1. Default Privacy Settings:

    • Personal details (e.g., full name, email) are hidden by default.
    • The username becomes the primary identifier for users on the platform.
    • Email visibility is restricted unless explicitly enabled by the user in their privacy settings.
  2. User-Controlled Privacy Settings:

    • Users can manage their privacy preferences via the profile endpoint:
      • Access: GET /me (or get_my_profile)
      • Update: PATCH /me (or update_my_profile)
    • These settings determine the visibility of personal details to others in the same organization.
  3. Upcoming Enhancements: (next PR)

    • In subsequent updates, organization-wide user lists (GET /groups/{organization_id}/users) will respect individual privacy settings.
    • Profiles will display only the details permitted by each user’s configured privacy policy.

This approach ensures user control over their data while streamlining identifiers within the platform.

NOTE to reviewers: This plugin is outdated. This PR intentionally focuses on creating a functional draft without applying any refactoring at this stage. Comprehensive refactoring will be addressed in subsequent PRs.

Highlights

  • get_my_profile returns now username and privacy settings section. It also deprecate gravatar_id
    image
  • update_my_profile is now PATCH and allows changing also userName
    image

Related issue/s

How to test

Driving tests

cd services/web/server
make install-dev
pytest -vv tests/unit/**/test_*users*.py

Dev-ops

None

@pcrespov pcrespov self-assigned this Dec 4, 2024
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 83.47826% with 19 lines in your changes missing coverage. Please review.

Project coverage is 89.32%. Comparing base (fcb92ea) to head (5f6c627).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6904      +/-   ##
==========================================
+ Coverage   88.36%   89.32%   +0.96%     
==========================================
  Files        1569     1382     -187     
  Lines       61555    55057    -6498     
  Branches     1987     1019     -968     
==========================================
- Hits        54390    49181    -5209     
+ Misses       6830     5699    -1131     
+ Partials      335      177     -158     
Flag Coverage Δ
integrationtests 65.04% <55.55%> (-0.03%) ⬇️
unittests 87.30% <83.47%> (+0.75%) ⬆️
Components Coverage Δ
api 76.84% <ø> (ø)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library 91.07% <70.49%> (-0.29%) ⬇️
pkg_notifications_library 84.57% <ø> (ø)
pkg_postgres_database 88.00% <100.00%> (+<0.01%) ⬆️
pkg_service_integration 70.02% <ø> (ø)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.38% <ø> (ø)
agent 97.00% <ø> (ø)
api_server 90.04% <100.00%> (+0.01%) ⬆️
autoscaling 95.21% <ø> (ø)
catalog 90.57% <ø> (ø)
clusters_keeper 98.72% <ø> (ø)
dask_sidecar 91.26% <ø> (ø)
datcore_adapter 93.18% <ø> (ø)
director 76.40% <ø> (-0.09%) ⬇️
director_v2 91.38% <ø> (ø)
dynamic_scheduler 97.07% <ø> (ø)
dynamic_sidecar 89.75% <ø> (ø)
efs_guardian 90.12% <ø> (ø)
invitations 93.44% <ø> (ø)
osparc_gateway_server ∅ <ø> (∅)
payments 92.65% <ø> (ø)
resource_usage_tracker 89.07% <ø> (ø)
storage 89.66% <ø> (ø)
webclient ∅ <ø> (∅)
webserver 88.32% <97.77%> (-0.03%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcb92ea...5f6c627. Read the comment docs.

@pcrespov pcrespov added this to the Event Horizon milestone Dec 5, 2024
@pcrespov pcrespov added the a:webserver issue related to the webserver service label Dec 5, 2024
@pcrespov pcrespov changed the title WIP: Is1779/user api ✨ web-api: user's privacy settings Dec 5, 2024
@pcrespov pcrespov marked this pull request as ready for review December 5, 2024 23:04
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

thanks!

Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

Merci

Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

Very nice, thanks a lot

.github/PULL_REQUEST_TEMPLATE.md Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Dec 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants