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 5 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 button 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 canceled.

Name Link
🔨 Latest commit f4cacc4
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/679ead3f4c826d00089ad7f5

Copy link

netlify bot commented Feb 1, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit f4cacc4
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/679ead3f255d2300088e653f

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.67%. Comparing base (7686d12) to head (f4cacc4).

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.72%   92.67%   -0.06%     
==========================================
  Files         770      770              
  Lines       38945    38951       +6     
==========================================
- Hits        36113    36096      -17     
- Misses       2832     2855      +23     
Flag Coverage Δ
e2e 48.51% <33.33%> (-0.04%) ⬇️
integration 24.59% <0.00%> (-0.01%) ⬇️
unit 90.36% <33.33%> (-0.01%) ⬇️

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 added 3 commits February 1, 2025 17:58
Signed-off-by: Dominic R <[email protected]>
nvm
Signed-off-by: Dominic R <[email protected]>
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