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

Unused subscription name in subscriptions/<account>/<name>/Rules/States endpoint #6345

Closed
maany opened this issue Oct 5, 2023 · 3 comments
Closed
Assignees
Milestone

Comments

@maany
Copy link
Member

maany commented Oct 5, 2023

Description

The endpoint requires specifying a subscription name

states_view = States.as_view('states')
bp.add_url_rule('/<account>/<name>/Rules/States', view_func=states_view, methods=['get', ])

However, it returns rule states for all subscriptions for the provided account

def generate(vo):
for row in list_subscription_rule_states(account=account, vo=vo):
yield dumps(row, cls=APIEncoder) + '\n'

So technically, a request to https://rucio-server.com/subscriptions/jdoe/HOLWAMJFDRSI/Rules/States is a valid request

Steps to reproduce

Make a request to
https://rucio-server.com/subscriptions/validAccount/invalidSubscription/Rules/Satetes

Rucio Version

32.x

Additional Information

Depending on how this feature is fixed, we might have to make changes in the new webui. We also need to make sure that the change is backward compatible with older clients.

@maany maany added the bug label Oct 5, 2023
@bari12
Copy link
Member

bari12 commented Oct 10, 2023

@cserf do you remember the reasoning here, or was this just a mistake?

@cserf
Copy link
Contributor

cserf commented Nov 29, 2023

That's a mistake.

@alexanderrichards
Copy link
Contributor

Am I missing something or is this fix simply a matter of parsing the name to the api thusly:

def generate(vo):
-    for row in list_subscription_rule_states(account=account, vo=vo):
+    for row in list_subscription_rule_states(name=name, account=account, vo=vo):
        yield dumps(row, cls=APIEncoder) + '\n'

If so, I can do this right away

alexanderrichards added a commit to alexanderrichards/rucio that referenced this issue Dec 12, 2023
@bari12 bari12 closed this as completed in a6f76e6 Jan 23, 2024
@bari12 bari12 added this to the 33.3.1 / 33.4.0 milestone Jan 23, 2024
rdimaio pushed a commit to rdimaio/rucio that referenced this issue Jan 23, 2024
rdimaio pushed a commit to rdimaio/rucio that referenced this issue Jan 24, 2024
voetberg pushed a commit to voetberg/rucio that referenced this issue Mar 21, 2024
voetberg pushed a commit to voetberg/rucio that referenced this issue Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants