Skip to content

sources: prevent deletion of built-in source#12914

Merged
BeryJu merged 16 commits intogoauthentik:mainfrom
dominic-r:sdko/sources/no-delete-built-in
Mar 14, 2025
Merged

sources: prevent deletion of built-in source#12914
BeryJu merged 16 commits intogoauthentik:mainfrom
dominic-r:sdko/sources/no-delete-built-in

Conversation

@dominic-r
Copy link
Member

@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
@netlify
Copy link

netlify bot commented Feb 1, 2025

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 778b52e
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67b22308d667a3000857399b
😎 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.

@netlify
Copy link

netlify bot commented Feb 1, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit 778b52e
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/67b223082413980008b9d6cf

@codecov
Copy link

codecov bot commented Feb 1, 2025

Codecov Report

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

Project coverage is 92.74%. Comparing base (e9c944c) to head (778b52e).
Report is 266 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.76%   92.74%   -0.03%     
==========================================
  Files         785      785              
  Lines       39636    39643       +7     
==========================================
- Hits        36768    36765       -3     
- Misses       2868     2878      +10     
Flag Coverage Δ
e2e 48.47% <42.85%> (-0.06%) ⬇️
integration 24.54% <14.28%> (-0.01%) ⬇️
unit 90.42% <42.85%> (-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.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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
Member Author

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

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@dominic-r
Copy link
Member Author

@rissson / @BeryJu , just checking in to see if there's an update regarding the above ^

@BeryJu BeryJu merged commit a3f8611 into goauthentik:main Mar 14, 2025
85 of 86 checks passed
@dominic-r dominic-r deleted the sdko/sources/no-delete-built-in branch March 14, 2025 17:39
kensternberg-authentik added a commit that referenced this pull request Apr 25, 2025
* main:
  website/docs: dev docs: bump node/postgres requirements  (#13516)
  sources: prevent deletion of built-in source (#12914)
  core: bump django-tenants (#13536)
  website/docs: dev docs: full: remove note on installing shell plugin (#13515)
  sources/oauth: fix duplicate authentication (#13322)
  web/admin: fix comment being rendered (#13530)
  core: Bump aws-cdk-lib from 2.183.0 to 2.184.0 (#13522)
  core, web: update translations (#13520)
  lifecycle/aws: Bump aws-cdk from 2.1003.0 to 2.1004.0 in /lifecycle/aws (#13524)
  core: Bump github.com/coreos/go-oidc/v3 from 3.12.0 to 3.13.0 (#13525)
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.

3 participants