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

Fix runWithRoles without api version in config #26

Merged
merged 3 commits into from
Jun 12, 2024
Merged

Conversation

ferishili
Copy link
Contributor

This PR fixes #23,

Description

refer to the issue's desc.

Reason

The checker for hasVersion forces to call the performGet which ends up having overwrite the arguments of the Client object before the main call!

Solution

Cloning the object to get the version!

Copy link
Contributor

@reiferschris reiferschris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix, it works as expected.
Minor detail, not sure if it is good to use the X-RUN-WITH-ROLES Header with the User also for the request to /api/version/default? This is probably just ignored by OC?

src/OpencastApi/Rest/OcRestClient.php Outdated Show resolved Hide resolved
Co-authored-by: reiferschris <34450887+reiferschris@users.noreply.github.com>
@ferishili
Copy link
Contributor Author

ferishili commented Jun 12, 2024

You are right, that headers for that call is not optimal, although it is denied (there is no validation) for that endpoint.
Anyways, I will remove it

@ferishili
Copy link
Contributor Author

Thanks @reiferschris for your reporting and testing it

@ferishili ferishili merged commit 5621e07 into master Jun 12, 2024
16 of 18 checks passed
@ferishili ferishili deleted the issue-23 branch June 13, 2024 13:16
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.

runWithRoles: header X-RUN-WITH-ROLES isn't set if api version is not defined in config
2 participants