Git Product home page Git Product logo

Comments (5)

KevinHock avatar KevinHock commented on August 19, 2024 2

This was solved by the wonderful @dgzlopes

from detect-secrets.

asdrubalos avatar asdrubalos commented on August 19, 2024

Help me please.
how write # pragma: whitelist secret in java?

I have 2 false positive:
1)
this.clientSecret = clientSecret; //# pragma: whitelist secret
2)
String x =", clientSecret='" + this.clientSecret +"'"; //# pragma: whitelist secret

from detect-secrets.

KevinHock avatar KevinHock commented on August 19, 2024

Hi @asdrubalos, I believe you can put a space after the //

When I scan

$ cat test.java 
API_KEY = "blahwww"
API_KEY = "blah-blah-but-actually-not-secret" # pragma: whitelist secret
1)
this.clientSecret = clientSecret; // # pragma: whitelist secret
2)
String x =", clientSecret='" + this.clientSecret +"'"; //# pragma: whitelist secret

with the latest detect-secrets (0.12.0) this.clientSecret = clientSecret; was reported if I did not have a space between // and #

from detect-secrets.

KevinHock avatar KevinHock commented on August 19, 2024

Also @asdrubalos , I will be sure to make quotes required for keyword secrets in .java files in the next version after #133 is merged

Thank you for the report 👍

from detect-secrets.

KevinHock avatar KevinHock commented on August 19, 2024

Actually just // should work as well, e.g. // pragma: whitelist secret, this is due to this PR https://github.com/Yelp/detect-secrets/pull/105/files

We should document that better though 👍 We'll be sure to do that too

from detect-secrets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.