Skip to content

Add maskCredentials as a pluginOption #1212

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

Merged

Conversation

Devon-White
Copy link
Contributor

@Devon-White Devon-White commented Jul 20, 2025

Description

Related issue: #1157 (second reported issue)

added maskCredentials as a plugin option.

Motivation and Context

We have had multiple customers complain about our REST docs being "broken" because they would copy the generated code snippets that mask the API credentials. After some investigation and realizing this design was by choice, I figured I would add a plugin option to revert back to the original behavior.

Due to the number of complaints from our customers, we have gone ahead and rolled back to a older Docusaurus version (3.6.3) & plugin version (4.3.0) as a compromise for our customers. We however would like to keep the old behavior of the plugin while also being able to benefit from the new future flags Docusaurus has exposed to speed up build times.

The credentials will still be masked by default, but setting maskCredentials: false will revert back to original behavior.

How Has This Been Tested?

Locally forked, and built.

Test suite ran, and all passed.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@sserrata sserrata self-assigned this Jul 21, 2025
@sserrata sserrata added the reviewing 👀 Undergoing manual audit to determine if issue should still be active label Jul 21, 2025
@sserrata
Copy link
Member

Thanks @Devon-White!

As a reminder, swizzling is another option for overriding the credential masking behavior but I believe there is definitely space for your proposed feature.

I think the key is that credential masking will be true by default with the option for users to implicitly "accept the risk" of un-masking them. I'll spend time testing/reviewing your PR and will let you know if any revisions are needed. Thanks!

@sserrata sserrata added the enhancement New feature or request label Jul 21, 2025
Copy link

Visit the preview URL for this PR (updated for commit 0da0a2f):

https://docusaurus-openapi-36b86--pr1212-f50qxc17.web.app

(expires Wed, 27 Aug 2025 14:15:36 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

Copy link
Member

@sserrata sserrata left a comment

Choose a reason for hiding this comment

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

LGTM

@sserrata sserrata removed the reviewing 👀 Undergoing manual audit to determine if issue should still be active label Jul 28, 2025
@sserrata sserrata merged commit afa156a into PaloAltoNetworks:main Jul 28, 2025
13 checks passed
@Devon-White
Copy link
Contributor Author

Devon-White commented Aug 11, 2025

@sserrata sorry to be pinging on a old PR, was just wondering if you had a estimate on when this new addition will be added to a new release! Thanks for for reviewing and approving! :)

Edit: Looks like the main released was skipped, but canary version was released: https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/actions/runs/16571851556/job/47222835499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants