Skip to content

docs(dev): document #[\SensitiveParameter] for secrets in stack traces - #15705

Open
whoalin1 wants to merge 2 commits into
nextcloud:masterfrom
whoalin1:docs-register-sensitive-methods-logging
Open

whoalin1 wants to merge 2 commits into
nextcloud:masterfrom
whoalin1:docs-register-sensitive-methods-logging

Conversation

@whoalin1

@whoalin1 whoalin1 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Documents how app authors keep secrets out of logged exception stack traces in developer_manual/basics/logging.rst.

  • New section after Logging exceptions: mark parameters that take secrets with PHP's standard #[\SensitiveParameter] attribute, with a short example.
  • States that since Nextcloud 36 the logger handles the attribute like its other sensitive data (feat(log): Add support for \SensitiveParameter attribute server#65412).
  • deprecated:: 36 note for IRegistrationContext::registerSensitiveMethods().
  • Note that this only covers stack traces. Never put passwords, tokens, or personal data into a log message yourself.

Closes #15680

sphinx-lint passes locally on the changed file. I have not run the full Sphinx build.


AI disclosure

This PR was drafted with the help of AI coding assistants (Cursor agents / LLM-based tools), including the description. I am responsible for it and happy to rework anything that doesn't fit.

All commits carry an Assisted-by: Cursor:grok-4.7 trailer.

Assisted-by: Cursor:grok-4.7
Signed-off-by: whoalin1 <whoalin414@gmail.com>
@whoalin1
whoalin1 force-pushed the docs-register-sensitive-methods-logging branch from c348221 to 789e2ae Compare October 9, 2026 14:13
@skjnldsv

Copy link
Copy Markdown
Member

Make sense to me, but I'll wait for other approvals

@come-nc come-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, the standard attribute from PHP should be used instead nowadays: https://www.php.net/manual/en/class.sensitiveparameter.php

We should deprecate our custom implementation for this and rely on this standard mechanism as well for core functions. (We can since we dropped 8.1 support in 33)

@come-nc

come-nc commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

See nextcloud/server#65412 to fully support SensitiveParameter and deprecate registerSensitiveMethods.

@pabzm
pabzm removed their request for review October 14, 2026 09:29
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

…iveMethods()

registerSensitiveMethods() is deprecated since Nextcloud 36
(nextcloud/server#65412); document the standard PHP attribute instead.

Assisted-by: Cursor:grok-4.7
Signed-off-by: whoalin1 <whoalin414@gmail.com>
@whoalin1 whoalin1 changed the title docs(dev): document registerSensitiveMethods() in logging.rst docs(dev): document #[\SensitiveParameter] for secrets in stack traces Oct 23, 2026
@whoalin1

Copy link
Copy Markdown
Contributor Author

@come-nc thanks, makes sense. Now that nextcloud/server#65412 is merged, I reworked the section in e7cdeea. It now recommends #[\SensitiveParameter] with an example, and has a deprecated:: 36 note for registerSensitiveMethods(). I updated the title and description to match.

AI disclosure: this reply and the change were drafted with help from an AI assistant.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Developer manual: document registerSensitiveMethods() in logging.rst

3 participants