Git Product home page Git Product logo

Comments (9)

tggagne avatar tggagne commented on July 18, 2024

Apparently, the same "encrypt" command used for obscuring passwords in config.properties works for database-conf.xml, too.

from dataloader.

tggagne avatar tggagne commented on July 18, 2024

I should re-open this. The encrypted password seems to work for postgres, but does not work for SqlServer. I have yet to try it with Oracle. I begin to wonder if the fact it worked with Postgres was an accident or some other environmental issue.

from dataloader.

diracz avatar diracz commented on July 18, 2024

I think what you might look into: http://stackoverflow.com/questions/12834604/using-encrypted-password-for-the-datasource-used-in-spring-applicationcontext-xm

DatabaeReader/Writer uses org.apache.commons.dbcp.BasicDataSource, which you can override to have getPassword/setPassword decrypt/encrypt password.

Hope that helps.

from dataloader.

tggagne avatar tggagne commented on July 18, 2024

I think it does...

So, if I created a subclass of org.apache.commons.dbcp.BasicDataSource I would have to specify its name in the database-conf.xml's bean for my DB connection?

If the subclass was named ObscuredPasswordDataSource the bean would look like..

<bean id="mypostgres" class="org.apache.commons.dbcp.ObscuredPasswordDataSource" .. >
    ...
    <property name="password" value="some encrypted value" />
</bean>

from dataloader.

tggagne avatar tggagne commented on July 18, 2024

Not being a Maven expert... how can I rebuild dataloader from the command line and skip the step where it tries to "install" it on my mac?

from dataloader.

tggagne avatar tggagne commented on July 18, 2024

diracz, I followed the advice from that stackoverflow link and created a new class, DataSource, that does the simple base64 decoding of the password.

While this obscures the password it doesn't obscure as well as dataloader's encryption/decryption of the sfdc.password.

I would prefer to use that approach, but hacking the Config class doesn't quite seem the right approach.

Do you know how I might get some help or clues if there's a better way to use Config's encryption?

The code has been committed to my repository here.

tggagne@e0562ab

from dataloader.

tggagne avatar tggagne commented on July 18, 2024

I hacked in the UncryptUtil stuff, so the password may be decrypted. To be /totally/ compatible with Config's use of encryption, it needs to use the keyfile -- which it doesn't yet.

As it is, a password encrypted with "encrypt -e password" should be used. And the bean's classname should be "com.salesforce.dataloader.dao.database.DataSource".

It could use some improved exception handling, but I'm a little out of my element inside Java.

The latest commit is below. I don't know if it's pull request. I have a few people I need to share the jar with--because none of us wants to push a configuration file to git with our passwords in the clear.

tggagne@b9e82f6

from dataloader.

tggagne avatar tggagne commented on July 18, 2024

Is there a way to reference the ProcessRunner instance from other classes?

The ProcessRunner has the current config, which means it has already processed the key file and has an initialized EncryptionUtil instance (config.encrypter).

Rather than initializing my own inside DataSource without the benefit of the keyfile, it would be valuable to just use the already-initialized one.

from dataloader.

tggagne avatar tggagne commented on July 18, 2024

For our next trick, we should get the keyfile working. Until then, let's call this closed.

from dataloader.

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.