Managing Credentials

It is possible to define server wide credentials that can help configure generic accounts. Such accounts can be used by any PC-lint Plus View user in order to connect to repository connectors, data providers and such third party tools.

These credentials are stored on disk and can be encrypted. If defined, PC-lint Plus View server automatically uses them to connect to the corresponding tools.

Credentials and master key are stored in respective files, credentials.xml and credentialsSecurity.xml, located in folder:

  • Linux: $HOME/.pclpview

  • Windows: %USERPROFILE%\.pclpview

Before going further, make sure you have downloaded PC-lint Plus View agent on the machine hosting PC-lint Plus View server.

Saving credentials

To store credentials, simply execute the following command and provide the prompted information:

java -jar pclpview-agent.jar --save-credentials

Where:

  • Server ID, is the server URL for which to save the password or token. It can be PC-lint Plus View’s URL, SCM’s or any other tool’s.

  • Token, is the user token. For an example of a PC-lint Plus View token, see: Authentication and Security.

  • Login, is the username for which to save the password.

  • Password, is the user password.

The following is an example of a credentials.xml file where both token and login/password have been defined for the same server ID:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<credentials version="1.0">
    <server>
        <id>http://localhost:8280</id>
        <credential>
            <token>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjIsImlhd[...]</token>
        </credential>
        <credential>
            <login>demo</login>
            <password>demo</password>
        </credential>
    </server>
    ...
</credentials>

The encryption confirmation prompt can be bypassed by using the --ignore-master-key option in the command line, as follows:

java -jar pclpview-agent.jar http://localhost:8280 --save-credentials --username demo --ignore-master-key

The interactive prompt can be bypassed by directly providing the information in the command line, as follows:

java -jar pclpview-agent.jar http://localhost:8280 --save-credentials --username demo --password demo

If you want to clear the credentials, simply remove the file $HOME/.pclpview/credentials.xml on Linux or %USERPROFILE%\.pclpview\credentials.xml on Windows.

Encrypting credentials

It is possible to define a master key in order to encrypt the credentials defined in the credentials.xml file.

To define the master key, simply execute the following command and provide the prompted information:

java -jar pclpview-agent.jar --encrypt-master-key

Where:

  • Master key, is the passphrase/password that will be used to encrypt the credentials.

The file credentialsSecurity.xml will be generated containing the encrypted master key:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<credentialsSecurity>
    <masterKey>{t/+kctF9r6gHitDsnLrWWQcxmGESPbuISPnnJsTNqZ8=}</masterKey>
</credentialsSecurity>

Then, any credentials added using PC-lint Plus View agent will be encrypted in the credentials.xml file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<credentials version="1.0">
    <server>
        <id>http://localhost:8280/</id>
        <credential>
            <login>demo</login>
            <token>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjIsImlhd[...]</token>
            <password>demo</password>
        </credential>
    </server>
    <server>
        <id>http://svn/server/url/project/trunk/</id>
        <credential>
            <login>username</login>
            <password>{JaUtuyMkEBcHvJRqj7a2c5V4Mv8gVPPrlgCLmpaGhoE=}</password>
        </credential>
    </server>
    ...
</credentials>

The interactive prompt can be bypassed by directly providing the information in the command line, as follows:

java -jar pclpview-agent.jar --encrypt-master-key <master-key>

If you want to clear the master key, simply remove the file $HOME/.pclpview/credentialsSecurity.xml on Linux or %USERPROFILE%\.pclpview\credentialsSecurity.xml on Windows.

Migrating old credentials format

Old credentials format stored in file .squorerc, can be migrated to the new credentials.xml format.

Just execute the following command:

java -jar pclpview-agent.jar http://localhost:8280 --migrate-legacy-data

If the credentials already exists in the credentials.xml file, they will not be replaced.