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

Improve ActingAsKeycloakUser trait #114

Merged
merged 9 commits into from
May 25, 2024

Conversation

elnurvl
Copy link
Contributor

@elnurvl elnurvl commented May 8, 2024

The aim of the change is to allow passing custom claims to the test token as well as adding widely accepted claims by default.

@elnurvl
Copy link
Contributor Author

elnurvl commented May 16, 2024

@robsontenorio , is it possible that we can make a progress here? I have noticed the PR is open for over a week but there is no response. I'd be happy to make necessary adjustments if you have any concern regarding merging the PR.

To be clear, due to the lack of customizing the token payload the library becomes unusable in certain projects where the exact token payload is being asserted.

@robsontenorio
Copy link
Owner

robsontenorio commented May 17, 2024

Please , include tests and update the README if needed.

@tuytoosh could you please review it?

@elnurvl
Copy link
Contributor Author

elnurvl commented May 17, 2024

@robsontenorio , done. @tuytoosh , please note I have also made some change to use the configured db column instead of hard-coded username. Let me know if you don't agree with anything.

@@ -16,7 +16,8 @@
"prefer-stable": true,
"require": {
"firebase/php-jwt": "^6.3",
"php": "^8.0"
"php": "^8.0",
"ext-openssl": "*"
Copy link
Owner

Choose a reason for hiding this comment

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

Are you sure is this needed ?

if so , please, use a specific version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The library depends on openssl extension and it is good to specify the requirement so consumers would be aware of it. I cannot be sure of the minimum required version of the extension for this particular library, but even existence of this line should be enough to force consumers installing one of the modern versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@robsontenorio , I am not sure if this is the holding part for the PR, but I can remove the line if it bothers you to speed up the release. We are going to release a feature depending on this repository in our project, but cannot make tests pass unless the library allows configuring the test token payload. Therefore, your efforts in merging this PR quickly will be greatly appreciated.

Also I am not sure if it is you or @tuytoosh the reviewer as you are the one assigned for this PR.

@elnurvl elnurvl force-pushed the token-payload branch 4 times, most recently from ebd395d to e6d164a Compare May 20, 2024 07:48
@hamidhaghdoost
Copy link
Contributor

Sorry for the late feedback. From my point of view, it is quite OK to be merged.

README.md Outdated
@@ -331,7 +331,7 @@ Auth::hasAnyScope(['scope-f', 'scope-k']) // false

# Acting as a Keycloak user in tests
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is not the main title, we can change it to H2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the README. Do you think this can be merged followed by release of a new version into packagist this week? I assume it is possible since there is not much change request around the PR, but not sure about your release schedules.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know about release schedule but since it's not a major version, it can be released ASAP.

@robsontenorio robsontenorio merged commit 25ca4d2 into robsontenorio:master May 25, 2024
6 checks passed
@robsontenorio
Copy link
Owner

Thanks guys !

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