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

Feat: Make authorization per-instance #343

Merged
merged 14 commits into from
Jan 25, 2024

Conversation

Meldiron
Copy link
Contributor

@Meldiron Meldiron commented Oct 19, 2023

Makes auth validator instance-aware, to make it work fine with corutines server

  • Update tests

src/Database/Database.php Outdated Show resolved Hide resolved
src/Database/Database.php Outdated Show resolved Hide resolved
@abnegate abnegate requested a review from fogelito October 24, 2023 07:08
@Meldiron Meldiron marked this pull request as ready for review January 3, 2024 13:17
@Meldiron Meldiron mentioned this pull request Jan 3, 2024
Copy link
Member

@abnegate abnegate left a comment

Choose a reason for hiding this comment

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

Can't comment on the Base.php diff since it's so big 😅 but do we need both the static and instance Authorization instances there?

src/Database/Validator/Authorization.php Outdated Show resolved Hide resolved
src/Database/Database.php Outdated Show resolved Hide resolved
src/Database/Validator/Authorization.php Outdated Show resolved Hide resolved
src/Database/Validator/Authorization.php Outdated Show resolved Hide resolved
src/Database/Validator/Authorization.php Outdated Show resolved Hide resolved
@Meldiron
Copy link
Contributor Author

Meldiron commented Jan 8, 2024

@abnegate

but do we need both the static and instance Authorization instances there?

Authorization:: is no more. You always must new Authroization(). No backwards compatibility. Breaking change.

@abnegate
Copy link
Member

abnegate commented Jan 8, 2024

@abnegate

but do we need both the static and instance Authorization instances there?

Authorization:: is no more. You always must new Authroization(). No backwards compatibility. Breaking change.

@Meldiron I mean in the test base class we have an instance var authorization and a static var authorizationSingleton, I think we only need one or the other

@Meldiron
Copy link
Contributor Author

authorizationSingleton

I cant improve this without renaming var in ~100 lines. The setup that is there still make sense - it's not Utopia-spepcfiic, but PHPUnit-specific.
static-var is there so state of it is shared across all tests.
instnace-var is there so we don't need to call static method in all tests.

src/Database/Database.php Outdated Show resolved Hide resolved
src/Database/Database.php Outdated Show resolved Hide resolved
src/Database/Validator/Authorization.php Show resolved Hide resolved
tests/Database/Base.php Outdated Show resolved Hide resolved
@abnegate abnegate merged commit b64caf4 into feat-framework-v2 Jan 25, 2024
9 checks passed
@abnegate abnegate deleted the feat-authorization-v2 branch January 25, 2024 11:30
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