Git Product home page Git Product logo

Comments (6)

tomasbjerre avatar tomasbjerre commented on July 25, 2024 1

This is now released in 1.65. Thanks again for this!!

from violation-comments-to-stash-plugin.

jetersen avatar jetersen commented on July 25, 2024

Takes the credentials and paste it into clear text

private static void setCredentialsIfExists(
final TaskListener listener, final ViolationsToBitbucketServerConfig configExpanded) {
if (configExpanded.isUseUsernamePasswordCredentials()) {
if (!isNullOrEmpty(configExpanded.getUsernamePasswordCredentialsId())) {
final Optional<StandardUsernamePasswordCredentials> credentials =
findCredentials(configExpanded.getUsernamePasswordCredentialsId());
if (credentials.isPresent()) {
final String username =
checkNotNull(
emptyToNull(credentials.get().getUsername()),
"Credentials username selected but not set!");
final String password =
checkNotNull(
emptyToNull(credentials.get().getPassword().getPlainText()),
"Credentials password selected but not set!");
configExpanded.setUsername(username);
configExpanded.setPassword(password);
listener.getLogger().println("Using username and password from credentials");
} else {
listener.getLogger().println("Credentials not found!");
return;
}
} else {
listener.getLogger().println("Credentials checked but not selected!");
return;
}
}
}

if I then go and save any configuration afterwards the password is now in clear text on the Jenkins instance

😭

logger.println(FIELD_PASSWORD + ": " + !isNullOrEmpty(config.getPassword()));

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

Nice! It all sounds very good!

I am generally a bit frustrated about the terrible API:s in Jenkins. And credentials is not an exception. Undocumented, lots of deprications and just very unclear how it should be used. Often feels like things are unnecessary complex... So your refactorings are more than welcome =)

Your findings probably needs fixing in these plugins as well:

from violation-comments-to-stash-plugin.

jetersen avatar jetersen commented on July 25, 2024

@tomasbjerre after a little tweaking. I got this.
image

Current progress on simplified generator:

ViolationsToBitbucketServer([violationConfigs: [[parser: 'ANDROIDLINT', pattern: 'b', reporter: 'a'], [parser: 'CHECKSTYLE', pattern: 'b', reporter: 'a']]])

In the process of deprecating username, password πŸ‘

from violation-comments-to-stash-plugin.

jetersen avatar jetersen commented on July 25, 2024

whats the default behaviour between create one comment per violation and create one big comment with all violations

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

I think the first one is most used. I would vote for that being default.

from violation-comments-to-stash-plugin.

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.