secretlint / secretlint

Pluggable linting tool to prevent committing credential.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can I allow certain strings in Npmrc_authToken rule?

tomyam2020 opened this issue · comments

I have the following statement in my .npmrc:

# scope_name and registry_url are withheld.
@<scope_name>:registry=<registry_url>
<registry_url>:_authToken=${NPM_TOKEN}

To the _authToken=${NPM_TOKEN} in this file, I get error [Npmrc_authToken] found npmrc authToken: ${NPM_TOKEN} @secretlint/secretlint-rule-preset-recommend > @secretlint/secretlint-rule-npm. However, I think it is ok, since the token is not actually displayed.

If ${NPM_TOKEN} is set in the configuration file, how do I set it to allow the pattern?

commented

I think that we should change the pattern and to allow ${...} token value.

const AuthTokenPattern = /_authToken=(.*)/g;