You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Vitor-Avila (via GitHub)" <gi...@apache.org> on 2025/05/23 14:52:28 UTC

[PR] fix(Security): Apply permissions to the AllEntities list/get_objects API endpoint [superset]

Vitor-Avila opened a new pull request, #33577:
URL: https://github.com/apache/superset/pull/33577

   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(Security): Apply permissions to the AllEntities list/get_objects API endpoint [superset]

Posted by "Vitor-Avila (via GitHub)" <gi...@apache.org>.
Vitor-Avila merged PR #33577:
URL: https://github.com/apache/superset/pull/33577


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(Security): Apply permissions to the AllEntities list/get_objects API endpoint [superset]

Posted by "korbit-ai[bot] (via GitHub)" <gi...@apache.org>.
korbit-ai[bot] commented on code in PR #33577:
URL: https://github.com/apache/superset/pull/33577#discussion_r2115089540


##########
superset-frontend/src/features/allEntities/AllEntitiesTable.tsx:
##########
@@ -106,8 +104,7 @@ export default function AllEntitiesTable({
                 tags={tags.filter(
                   (tag: Tag) =>
                     tag.type !== undefined &&
-                    ['TagType.custom', 1].includes(tag.type) &&
-                    tag.id !== tagId,
+                    ['TagType.custom', 1].includes(tag.type),
                 )}

Review Comment:
   ### Invalid Tag Type Comparison <sub>![category Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The tag filtering logic includes a string literal 'TagType.custom' which will never match any actual tag type values. This will cause custom tags to not be displayed correctly.
   
   
   ###### Why this matters
   The code is comparing an enum value with its string representation, which will always fail the comparison and prevent custom tags from being shown in the UI.
   
   ###### Suggested change ∙ *Feature Preview*
   Replace the string enum comparison with the actual enum value:
   ```typescript
   tags.filter(
     (tag: Tag) =>
       tag.type !== undefined &&
       [TagType.custom, 1].includes(tag.type),
   )
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7e7a4f13-d0b6-4c3f-bb01-860ec7f401fd/upvote) [![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7e7a4f13-d0b6-4c3f-bb01-860ec7f401fd?what_not_true=true)  [![Not in Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7e7a4f13-d0b6-4c3f-bb01-860ec7f401fd?what_out_of_scope=true) [![Not in coding standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7e7a4f13-d0b6-4c3f-bb01-860ec7f401fd?what_not_in_standard=true) [![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7e7a4f13-d0b6-4c3f-bb01-860ec7f401fd)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:35466c1f-b163-4ebc-bc91-a6dec6501a46 -->
   
   
   [](35466c1f-b163-4ebc-bc91-a6dec6501a46)



##########
superset/daos/tag.py:
##########
@@ -139,6 +136,13 @@ def find_by_name(name: str) -> Tag:
         """
         return db.session.query(Tag).filter(Tag.name == name).first()
 
+    @staticmethod
+    def find_by_names(names: list[str]) -> list[Tag]:
+        """
+        returns tags by their names.
+        """
+        return db.session.query(Tag).filter(Tag.name.in_(names)).all()

Review Comment:
   ### Incomplete docstring for find_by_names <sub>![category Documentation](https://img.shields.io/badge/Documentation-7c3aed)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The docstring is too brief and doesn't explain the behavior when tags aren't found or names is empty.
   
   
   ###### Why this matters
   Developers would need to read the code to understand edge cases, which defeats the purpose of documentation.
   
   ###### Suggested change ∙ *Feature Preview*
   """Returns a list of Tag objects that match the provided names.
   
   Args:
       names: A list of tag names to search for.
   
   Returns:
       A list of found Tag objects. Tags that don't exist will be excluded from the result.
       Returns an empty list if names is empty.
   """
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/b2c9fdf3-b0a6-4a7d-9fd5-15b3a27a2247/upvote) [![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/b2c9fdf3-b0a6-4a7d-9fd5-15b3a27a2247?what_not_true=true)  [![Not in Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/b2c9fdf3-b0a6-4a7d-9fd5-15b3a27a2247?what_out_of_scope=true) [![Not in coding standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/b2c9fdf3-b0a6-4a7d-9fd5-15b3a27a2247?what_not_in_standard=true) [![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/b2c9fdf3-b0a6-4a7d-9fd5-15b3a27a2247)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:5631795c-bf3f-49e8-8f2a-6930fe3773e3 -->
   
   
   [](5631795c-bf3f-49e8-8f2a-6930fe3773e3)



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org