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

sources: prevent deletion of built-in source #12914

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

dominic-r
Copy link
Contributor

@dominic-r dominic-r commented Feb 1, 2025

sdko/sources/no-delete-built-in

What?

This PR modifies renderToolbarSelected to disable the "Delete" button for the built-in authentik login source. While the source will reappear after a server restart, the change is intended as a precaution to prevent potential issues by blocking deletion. Furthermore, it adds a function to the SourceViewSet class to return an error when attmpting to delete the source using the API url.

Testing:

  • Attempted to delete the built-in source
  • Added sources normally and attempted to remove them to ensure no functionality was lost
  • If the built-in source is in a multi-select with a valid source, the deletion won't proceed

Details

REPLACE ME


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

@dominic-r dominic-r requested a review from a team as a code owner February 1, 2025 22:36
Copy link

netlify bot commented Feb 1, 2025

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 9c06398
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67ab55e30f7f2a0008ede48a
😎 Deploy Preview https://deploy-preview-12914--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 1, 2025

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 9c06398
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/67ab55e3faa5490008eba3fa
😎 Deploy Preview https://deploy-preview-12914--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Feb 1, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 92.75%. Comparing base (b6cf27b) to head (9c06398).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
authentik/core/api/sources.py 33.33% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12914   +/-   ##
=======================================
  Coverage   92.75%   92.75%           
=======================================
  Files         785      785           
  Lines       39580    39586    +6     
=======================================
+ Hits        36711    36719    +8     
+ Misses       2869     2867    -2     
Flag Coverage Δ
e2e 48.51% <33.33%> (+0.01%) ⬆️
integration 24.54% <0.00%> (-0.01%) ⬇️
unit 90.42% <33.33%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dominic-r dominic-r requested a review from a team as a code owner February 1, 2025 22:53
@dominic-r dominic-r changed the title web: sources: disable "delete" button for built-in source sources: prevent deletion of built-in source Feb 1, 2025
@dominic-r
Copy link
Contributor Author

Hi @BeryJu. Sorry to bother. Do you think you could take a look at this when you have a second? Thanks

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.

1 participant