Skip to content

Add maskCredentials as a pluginOption#1212

Merged
sserrata merged 2 commits intoPaloAltoNetworks:mainfrom
Devon-White:Devon/credential-plugin-option
Jul 28, 2025
Merged

Add maskCredentials as a pluginOption#1212
sserrata merged 2 commits intoPaloAltoNetworks:mainfrom
Devon-White:Devon/credential-plugin-option

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
@github-actions
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

dsuket pushed a commit to dsuket/docusaurus-openapi-docs that referenced this pull request Oct 13, 2025
* Add maskCredentials as a pluginOption

* fix formatting to be consistent
@alienzhangyw
Copy link

When will this feature be available in a new public release?

@waldyrious
Copy link

Since @Devon-White's context comment in #1157 is a little buried in that thread, I'll add a quick note here for future reference and convenience:

In essence, PR #1050 (released in v4.3.1) introduced the behavior of masking credentials in the code samples; the maskCredentials option added here provides a way to disable the masking behavior (though it remains the default).

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.

4 participants