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(Security): Warn about using annotations instead of attributes #46606

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

provokateurin
Copy link
Member

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

Signed-off-by: provokateurin <kate@provokateurin.de>
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

This will spam so hard :-X

@nickvergessen nickvergessen added the pending documentation This pull request needs an associated documentation update label Jul 18, 2024
@nickvergessen
Copy link
Member

Should document similarly to nextcloud/documentation#12033

@provokateurin
Copy link
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.

@blizzz
Copy link
Member

blizzz commented Jul 18, 2024

This will spam so hard :-X

Good medicine has to be bitter.

@provokateurin provokateurin removed the pending documentation This pull request needs an associated documentation update label Jul 18, 2024
@nickvergessen
Copy link
Member

I would do server in one PR yeah.
Psalm should cover missing imports etc. and the rest should be reviewed by the reviewers and the author of the PR

This was referenced Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants