Connect to the Endor Labs Patch Factory
Learn how to connect to the Endor Labs Patch Factory and use an Endor patch.
You can start using Endor patches with 3 simple steps:
- Configure an API Key to connect to the Endor Labs Patch Factory
- Configure your package manager to use Endor patches.
- Specify the Endor Patch you want to use.
Create an API key
To gain Rest API access to Endor Labs Patch Factory, you have to generate API credentials to authenticate to the repository.
- From Manage, navigate to API Keys.
- Select Generate API Key.
- Enter a name to identify the API key, such as “Endor Patch Factory”.
- Select the permissions to apply to the API Key, you’ll need at least Read Only.
- Select the expiration date of the API key. This may be either 30, 60, or 90 days.
Using these credentials, you can configure Endor Labs your package manager or Artifact Repository proxy to authenticate to the Endor Patch Factory.
Configure Gradle
- Open the
build.gradle
file of the package you’d like to configure to use patches. - Include a repositories section in the
build.gradle
file to establish a repository connection to the Endor Labs Patch Factory. Make sure to replacenamespace
with the name of your Endor Labs namespace. - Include a reference to the Endor Patch version in the
build.gradle
file.
Example repositories section:
repositories {
mavenCentral()
maven {
url "https://factory.endorlabs.com/v1/namespaces/<namespace>/maven2"
credentials {
username "$ENDOR_API_CREDENTIALS_KEY"
password "$ENDOR_API_CREDENTIALS_SECRET"
}
}
Finally, include the Endor Labs patch version you’d like to use. For example, to use the latest patched version from Endor Labs add -endor-latest
to the version of your dependency.
dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:2.9.10.3-endor-latest")
}
Configure Maven
- Open the
pom.xml
file of the package you’d like to configure to use patches. - If there is no
section in the pom.xml
, then create one. - Include a repositories section in the
pom.xml
file to establish a repository connection to the Endor Labs Patch Factory. Make sure to replacewith the name of your Endor Labs namespace.
<repositories>
<repository>
<id>endorlabs</id>
<url>https://factory.endorlabs.com/v1/namespaces/<namespace>/maven2</url>
</repository>
</repositories>
- Next, open the Maven
settings.xml
file located at$HOME/.m2/settings.xml
and add asection to the settings file with your Endor Labs credentials. - The
username
value must be your API key. - The
password
must be your API key secret. - The
id
value must be same as the value provided in thepom.xml
.
- The
Example:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>endorlabs</id>
<username>${env.ENDOR_API_CREDENTIALS_KEY}</username>
<password>${env.ENDOR_API_CREDENTIALS_SECRET}</password>
</server>
</servers>
</settings>
- Finally, include the Endor Labs patch version you’d like to use in to your manifest. For example, to use the latest patched version from Endor Labs include
-endor-latest
to the version of your dependency.
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.3-endor-latest</version>
</dependency>
Feedback
Was this page helpful?
Thanks for the feedback. Write to us at support@endor.ai to tell us more.
Thanks for the feedback. Write to us at support@endor.ai to tell us more.