feat(Security): Warn about using annotations instead of attributes#46606
Merged
provokateurin merged 1 commit intomasterfrom Jul 18, 2024
Merged
feat(Security): Warn about using annotations instead of attributes#46606provokateurin merged 1 commit intomasterfrom
provokateurin merged 1 commit intomasterfrom
Conversation
Signed-off-by: provokateurin <kate@provokateurin.de>
nickvergessen
approved these changes
Jul 18, 2024
Member
nickvergessen
left a comment
There was a problem hiding this comment.
This will spam so hard :-X
Member
|
Should document similarly to nextcloud/documentation#12033 |
Member
Author
|
I already have a branch where I migrate all annotations in server (only partially done so far), does it makes sense to send a PR for that or let the app maintainers do it gradually? I fear such a big PR is not easy to review and any mistakes can be easily overlooked. |
Member
Good medicine has to be bitter. |
blizzz
approved these changes
Jul 18, 2024
Member
|
I would do server in one PR yeah. |
Merged
This was referenced Jul 25, 2024
Merged
Merged
This was referenced Jul 27, 2024
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Using annotation is a lot less safe since there is no checking that they are correctly set. For example a typo can make the annotation in-effective and thus lead to security problems. Same goes for giving arguments to the annotations, since they can not be type checked or any other type of check other than at runtime.
In contrast to that the attributes provide more safety and have been available since PHP 8.0 and thus can be used by almost every app developer out there. Adding these debug logs hopefully encourage developers to migrate to the attributes.
Checklist