aru-trackunit opened a new issue, #29192:
URL: https://github.com/apache/airflow/issues/29192

   ### Description
   
   When deleting dag via API/CLI could perform an additional action declared in 
additional file/script in order to for example: delete file from s3 bucket. 
   
   There is already a similar approach taken in webserver config 
https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/security/webserver.html
   ```
   from flask_appbuilder.security.manager import AUTH_OAUTH
   import os
   
   AUTH_TYPE = AUTH_OAUTH
   AUTH_ROLES_SYNC_AT_LOGIN = True  # Checks roles on every login
   AUTH_USER_REGISTRATION = True  # allow users who are not already in the FAB 
DB to register
   # Make sure to replace this with the path to your security manager class
   FAB_SECURITY_MANAGER_CLASS = "your_module.your_security_manager_class"
   AUTH_ROLES_MAPPING = {
       "Viewer": ["Viewer"],
       "Admin": ["Admin"],
   }
   # If you wish, you can add multiple OAuth providers.
   OAUTH_PROVIDERS = [
       {
           "name": "github",
           "icon": "fa-github",
           "token_key": "access_token",
           "remote_app": {
               "client_id": os.getenv("OAUTH_APP_ID"),
               "client_secret": os.getenv("OAUTH_APP_SECRET"),
               "api_base_url": "https://api.github.com";,
               "client_kwargs": {"scope": "read:user, read:org"},
               "access_token_url": 
"https://github.com/login/oauth/access_token";,
               "authorize_url": "https://github.com/login/oauth/authorize";,
               "request_token_url": None,
           },
       },
   ]
   ```
   
   ### Use case/motivation
   
   After browsing airflow issues regarding deleting dags, there is a 
misunderstanding what it should do vs what it does. From user perspective when 
someone deletes dag it should never appear again (but currently user needs to 
know internals to understand why it's not deleted). 
   
   However it very depends on the implementation how the dag should be deleted. 
It can be deleted from the file system, s3 bucket etc.
   
   In my case I would add the code that removes the dag from an s3 repository 
by calling an external client.
   
   Using airflow inside AWS (MWAA), I tried to delete the dag from the UI and 
it disappeared till next dag sync was performed and popped up again, because it 
was still present on s3 bucket.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to