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

Remove Google OAuth admin authentication provider #802

Merged
merged 17 commits into from
Mar 2, 2023

Conversation

pcustic
Copy link
Contributor

@pcustic pcustic commented Feb 9, 2023

Description

This PR removes Google OAuth admin authentication provider (GoogleOAuthAdminAuthenticationProvider) and all the code related to id. However, it leaves supporting code for having another external authentication provider even though Google OAuth was the only one currently implemented.

Motivation and Context

The circulation manager has an admin authentication integration meant to allow admins to authenticate via Google to log into the circulation manager. We are not using this integration anywhere, and the library that it is built on oauth2client is deprecated and not meant to be used anymore.

Notion

How Has This Been Tested?

Removed tests that used Google OAuth, all other tests passed. Also, manually tested sign-in functionality.

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Patch coverage: 75.00% and project coverage change: -0.06 ⚠️

Comparison is base (3ba082c) 89.36% compared to head (f9aac70) 89.31%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #802      +/-   ##
==========================================
- Coverage   89.36%   89.31%   -0.06%     
==========================================
  Files         183      181       -2     
  Lines       32492    32275     -217     
  Branches     7244     7196      -48     
==========================================
- Hits        29037    28825     -212     
  Misses       2282     2282              
+ Partials     1173     1168       -5     
Impacted Files Coverage Δ
api/admin/admin_authentication_provider.py 60.00% <ø> (-11.43%) ⬇️
api/admin/problem_details.py 100.00% <ø> (ø)
api/admin/routes.py 95.24% <ø> (-0.14%) ⬇️
core/model/admin.py 97.00% <ø> (-0.09%) ⬇️
core/model/configuration.py 93.92% <ø> (-0.41%) ⬇️
api/admin/controller/__init__.py 88.43% <66.66%> (-1.40%) ⬇️
api/admin/config.py 95.83% <100.00%> (ø)
...pi/admin/password_admin_authentication_provider.py 98.11% <0.00%> (-1.89%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pcustic pcustic marked this pull request as ready for review February 10, 2023 09:58
@pcustic pcustic requested a review from a team February 10, 2023 09:59
@pcustic
Copy link
Contributor Author

pcustic commented Feb 10, 2023

I see there is significant drop in the code coverage in api/admin/controller/admin_auth_services.py, I'll try to figure out what lines are currently missed and try to add some more tests.

EDITED: This is due to the fact that we removed only external auth admin provider so there is no way to test that lines currently.

@pcustic
Copy link
Contributor Author

pcustic commented Feb 10, 2023

@jonathangreen I left the option (existing code) for other external admin auth providers in the future, is that OK? Should I just completely remove option for other auth providers except classic username/password?

@jonathangreen
Copy link
Member

@pcustic I would completely remove the code for external admin auth providers. That should help the code coverage. We can revist it if we need to in the future, but having dead code around that is never called just slows down our development.

@pcustic
Copy link
Contributor Author

pcustic commented Feb 13, 2023

@pcustic I would completely remove the code for external admin auth providers. That should help the code coverage. We can revist it if we need to in the future, but having dead code around that is never called just slows down our development.

Sure, makes sense 👍

@@ -393,22 +387,6 @@ def collection_library_registrations():
)


@app.route("/admin/admin_auth_services", methods=["GET", "POST"])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will require update to the admin UI, we will need to remove the Admin Auth from the settings so users on the CM cannot (try) to access these endpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pcustic
Copy link
Contributor Author

pcustic commented Feb 14, 2023

@jonathangreen (I think) I removed all the external admin auth stuff. I'll create PR from removing admin auth views in admin UI.

I don't quite understand this codecov/patch thing, I'll need to look into that a bit more.

@jonathangreen
Copy link
Member

@pcustic now that ThePalaceProject/circulation-admin#75 is merged, and I made a release that includes it https://github.com/ThePalaceProject/circulation-admin/releases/tag/v1.5.1 can you update the package version here: https://github.com/ThePalaceProject/circulation/blob/main/api/admin/config.py#L16

Once that is updated, this should be good to go.

@pcustic
Copy link
Contributor Author

pcustic commented Mar 1, 2023

@pcustic now that ThePalaceProject/circulation-admin#75 is merged, and I made a release that includes it https://github.com/ThePalaceProject/circulation-admin/releases/tag/v1.5.1 can you update the package version here: https://github.com/ThePalaceProject/circulation/blob/main/api/admin/config.py#L16

Once that is updated, this should be good to go.

@jonathangreen updated 0845185!

@pcustic pcustic merged commit ba04370 into main Mar 2, 2023
@pcustic pcustic deleted the feature/remove-google-oauth branch March 2, 2023 07:39
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.

2 participants