avioconsulting / mule-vault-connector

HashiCorp Vault Connector for Mule 4
BSD 2-Clause "Simplified" License
11 stars 5 forks source link

How to add Vault connector in Anypoint Studio Mule pallette #1

Closed fogboundturtle closed 4 years ago

fogboundturtle commented 4 years ago

I am new to anypoint studio. I was asked to look at integration between hashicorp and mulesoft. I am unable to add the vault connector in my anypoint studio mule palette. Can you help me with some step by step instruction ?

Thanks.

adammead commented 4 years ago

Hi @fogboundturtle, here are the steps for getting it added locally. I'll add these to the README too, but I wanted to get you going as soon as possible.

  1. Clone this project locally
  2. Execute mvn install from repository base directory (containing the pom.xml) to install the connector into your local maven repository, it will compile and run tests in test containers, so you need docker locally too. Alternatively, you can run mvn install -Dmaven.test.skip=true to skip those tests.
  3. Add the dependency below to your pom.xml:
    <dependency>
    <groupId>f2ea2cb4-c600-4bb5-88e8-e952ff5591ee</groupId>
    <artifactId>vault-connector</artifactId>
    <version>0.2.0</version>
    <classifier>mule-plugin</classifier>
    </dependency>
  4. After saving the pom.xml, Anypoint Studio will load the connector in the palette
fogboundturtle commented 4 years ago

I am using the embedded maven of Anypoint studio 7.4 on Windows. I don't have MVN install on my PC. Do I need to get Maven install separately ?

adammead commented 4 years ago

Yes, you need to install maven separately to build and install the connector.

fogboundturtle commented 4 years ago

Thank you for your help. I got it to work.

fogboundturtle commented 4 years ago

I am getting a lot of Java warning with your vault connector and I don't see any connection to my local hashicorp vault

image

adammead commented 4 years ago

What does your Vault Config look like under Global Configurations?

fogboundturtle commented 4 years ago

image

this is running my local hashicorp server. I am running in -dev mode v1. When I compile the application

[INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running com.avioconsulting.mule.connector.vault.provider.VaultEc2IDDocAuthTestCase [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.697 s <<< FAILURE! - in com.avioconsulting.mule.connector.vault.provider.VaultEc2IDDocAuthTestCase [ERROR] initializationError(com.avioconsulting.mule.connector.vault.provider.VaultEc2IDDocAuthTestCase) Time elapsed: 0.005 s <<< ERROR! java.lang.IllegalArgumentException: pom file doesn't exits for path: E:\AnypointStudio\studio-workspace\Vault%20Connector\pom.xml

[INFO] Running com.avioconsulting.mule.connector.vault.provider.VaultEc2MetaDataAuthenticationTestCase [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 s <<< FAILURE! - in com.avioconsulting.mule.connector.vault.provider.VaultEc2MetaDataAuthenticationTestCase [ERROR] initializationError(com.avioconsulting.mule.connector.vault.provider.VaultEc2MetaDataAuthenticationTestCase) Time elapsed: 0 s <<< ERROR! java.lang.IllegalArgumentException: pom file doesn't exits for path: E:\AnypointStudio\studio-workspace\Vault%20Connector\pom.xml

[INFO] Running com.avioconsulting.mule.connector.vault.provider.VaultIamAuthTestCase [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in com.avioconsulting.mule.connector.vault.provider.VaultIamAuthTestCase [ERROR] initializationError(com.avioconsulting.mule.connector.vault.provider.VaultIamAuthTestCase) Time elapsed: 0 s <<< ERROR! java.lang.IllegalArgumentException: pom file doesn't exits for path: E:\AnypointStudio\studio-workspace\Vault%20Connector\pom.xml

[INFO] Running com.avioconsulting.mule.connector.vault.provider.VaultOperationsTestCase [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in com.avioconsulting.mule.connector.vault.provider.VaultOperationsTestCase [ERROR] initializationError(com.avioconsulting.mule.connector.vault.provider.VaultOperationsTestCase) Time elapsed: 0 s <<< ERROR! java.lang.IllegalArgumentException: pom file doesn't exits for path: E:\AnypointStudio\studio-workspace\Vault%20Connector\pom.xml

[INFO] Running com.avioconsulting.mule.connector.vault.provider.VaultSSLConnectionTestCase [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in com.avioconsulting.mule.connector.vault.provider.VaultSSLConnectionTestCase [ERROR] initializationError(com.avioconsulting.mule.connector.vault.provider.VaultSSLConnectionTestCase) Time elapsed: 0 s <<< ERROR! java.lang.IllegalArgumentException: pom file doesn't exits for path: E:\AnypointStudio\studio-workspace\Vault%20Connector\pom.xml

adammead commented 4 years ago

Anypoint Studio is trying to compile the connector code while building your Mule project. Close the connector project in studio and it should build properly.

fogboundturtle commented 4 years ago

Alright. This is good now. Thanks again for you support.