diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eb3970..e2d6ec9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [3.0.0] - 2020-06-22 ### Fixed - Encode spaces to "%20" instead of "+". This encoding fixes an issue where Conjur variables that have spaces were not encoded correctly @@ -17,6 +19,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. code - README has been updated with example SSLContext setup and it's use in Conjur class constructors +- Introduced [upgrade instructions](https://github.com/cyberark/conjur-api-java/UPGRADING.md) to provide instructions for + upgrading to 3.0.0, or make use of published artifacts. These can be found in + `UPGRADING.md`. ([cyberark/conjur-api-java#77](https://github.com/cyberark/conjur-api-java/issues/77)) + +### Changed +- Revised package references from `net.conjur.api` to `com.cyberark.conjur.api` + ([cyberark/conjur-api-java#6](https://github.com/cyberark/conjur-api-java/issues/6)) ## [2.2.1] - 2020-05-08 ### Fixed @@ -55,7 +64,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Authn tokens now use the new Conjur 5 format - [PR #21](https://github.com/cyberark/conjur-api-java/pull/21) - Configuration change. When using environment variables, use `CONJUR_AUTHN_LOGIN` and `CONJUR_AUTHN_API_KEY` now instead of `CONJUR_CREDENTIALS` - https://github.com/cyberark/conjur-api-java/commit/60344308fc48cb5380c626e612b91e1e720c03fb -[Unreleased]: https://github.com/cyberark/conjur-api-java/compare/v2.2.1...HEAD +[Unreleased]: https://github.com/cyberark/conjur-api-java/compare/v3.0.0...HEAD +[3.0.0]: https://github.com/cyberark/conjur-api-java/compare/v2.2.1...v3.0.0 [2.0.0]: https://github.com/cyberark/conjur-api-java/compare/v1.1.0...v2.0.0 [2.1.0]: https://github.com/cyberark/conjur-api-java/compare/v2.0.0...v2.1.0 [2.2.0]: https://github.com/cyberark/conjur-api-java/compare/v2.1.0...v2.2.0 diff --git a/Jenkinsfile b/Jenkinsfile index b299811..182e5a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { } } } - + stage('Create and archive the Maven package') { steps { sh './bin/build.sh' @@ -37,12 +37,21 @@ pipeline { } } - stage('Publish the Maven package') { + stage('Perform Snapshot Deployment') { when { branch 'master' } steps { - echo 'TODO' + sh 'summon ./bin/deploy-snapshot.sh' + } + } + + stage('Perform Release Deployment') { + when { + buildingTag() + } + steps { + sh 'summon ./bin/deploy-release.sh' } } } diff --git a/README.md b/README.md index de06a59..893deb0 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ To do so from the source using Maven, following the setup steps below: ```xml - net.conjur.api + com.cyberark.conjur.api conjur-api 2.2.0 @@ -95,12 +95,76 @@ our [Contributing](https://github.com/cyberark/conjur-api-java/blob/master/CONTR or ```sh-session $ mvn install:install-file -Dfile=/path/to/api/repo/target/conjur-api-$VERSION-with-dependencies.jar \ - -DgroupId=net.conjur.api \ + -DgroupId=com.cyberark.conjur.api \ -DartifactId=conjur-api \ -Dversion=$VERSION \ -Dpackaging=jar ``` +### Using Maven Releases + +To make use of tagged releases published to Maven, verify that you have the dependency +added to your `pom.xml` + +1. Add the following snippet to `pom.xml` +```xml + + com.cyberark.conjur.api + conjur-java-api + x.x.x + +``` + +### Using Maven Snapshots +To make use of SNAPSHOTS, which are deployed following a nightly build, there are +several steps required for configuring your project. + +> Note: Snapshots contain the latest changes to `conjur-java-api`, but it is recommended +> to use the current stable release unless there is a significant update required by your +> project + +1. Add the following to your `settings.xml` +```xml + + + allow-snapshots + true + + + snapshots-repo + https://oss.sonatype.org/content/repositories/snapshots + false + true + + + + +``` + +Alternatively, add the following to your list of repositories in `pom.xml` +```xml + + oss.sonatype.org-snapshot + http://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + +``` + +2. In your `pom.xml`, verify that your `conjur-java-api` dependency includes `SNAPSHOT` +in the version tag. +```xml + + com.cyberark.conjur.api + conjur-java-api + x.x.x-SNAPSHOT + +``` + ## Configuration Once the setup steps have been successfully run, we will now define the variables needed @@ -317,7 +381,7 @@ export CONJUR_AUTHN_LOGIN= export CONJUR_AUTHN_API_KEY= ``` ```java -import net.conjur.api.Conjur; +import com.cyberark.conjur.api.Conjur; // Configured using environment variables Conjur conjur = new Conjur(); @@ -335,7 +399,7 @@ $ java -jar myConjurClient.jar \ -DCONJUR_AUTHN_API_KEY= ``` ```java -import net.conjur.api.Conjur; +import com.cyberark.conjur.api.Conjur; // Configured using system properties Conjur conjur = new Conjur(); @@ -354,7 +418,7 @@ $ mvn exec:java \ -Dexec.mainClass="com.myorg.client.App" ``` ```java -import net.conjur.api.Conjur; +import com.cyberark.conjur.api.Conjur; // Configured using system properties Conjur conjur = new Conjur(); @@ -370,7 +434,7 @@ export CONJUR_APPLIANCE_URL= ``` ```java -import net.conjur.api.Conjur; +import com.cyberark.conjur.api.Conjur; // Authenticate using provided username/hostname and password/API key. See notes about // `CONJUR_AUTHN_URL` regarding how 'password-or-api-key' is processed. @@ -389,8 +453,8 @@ export CONJUR_APPLIANCE_URL= ``` ```java -import net.conjur.api.Conjur; -import net.conjur.api.Credentials; +import com.cyberark.conjur.api.Conjur; +import com.cyberark.conjur.api.Credentials; // Authenticate using a Credentials object. See notes about `CONJUR_AUTHN_URL` // regarding how 'password-or-api-key' is processed. @@ -410,8 +474,8 @@ export CONJUR_APPLIANCE_URL= ``` ```java -import net.conjur.api.Conjur; -import net.conjur.api.Token; +import com.cyberark.conjur.api.Conjur; +import com.cyberark.conjur.api.Token; Token token = Token.fromFile(Paths.get('path/to/conjur/authentication/token.json')); Conjur conjur = new Conjur(token); @@ -428,8 +492,8 @@ export CONJUR_APPLIANCE_URL= export CONJUR_AUTHN_TOKEN_FILE="path/to/conjur/authentication/token.json" ``` ```java -import net.conjur.api.Conjur; -import net.conjur.api.Token; +import com.cyberark.conjur.api.Conjur; +import com.cyberark.conjur.api.Token; Token token = Token.fromEnv(); Conjur conjur = new Conjur(token); @@ -443,7 +507,7 @@ To use the client, you will first create an instance of the client and then call to send requests to the Conjur API. The most common use case is adding and retrieving a secret from Conjur, so we provide some sample code for this use case below. -### Conjur Client Instance (`net.conjur.api.Conjur`) +### Conjur Client Instance (`com.cyberark.conjur.api.Conjur`) The client can be instantiated with any of these methods: ```java @@ -471,7 +535,7 @@ Sets a variable to a specific value based on its ID. Example: ```java -import net.conjur.api.Conjur; +import com.cyberark.conjur.api.Conjur; Conjur conjur = new Conjur(); conjur.variables().addSecret(VARIABLE_ID, VARIABLE_VALUE); @@ -487,7 +551,7 @@ Retireves a variable based on its ID. Example: ```java -import net.conjur.api.Conjur; +import com.cyberark.conjur.api.Conjur; Conjur conjur = new Conjur(); conjur.variables().retrieveSecret(""); @@ -504,7 +568,7 @@ alternative implementation. ## Troubleshooting -### `error: package net.conjur does not exist` +### `error: package com.cyberark.conjur does not exist` This is caused by Maven's (or your dependency resolution tooling) inability to find Conjur APIs. Please ensure that you have followed the [setup](#setup) section to properly install diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000..2fde6a5 --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,60 @@ +# Upgrading Conjur Java API + +This guide describes how to upgrade your project to use Conjur Java API. + +The main scenario covered in this document is migrating a project with a Conjur-Java-API +to v3.0.0. + +For more details about using the Conjur API, or contributing to development, please +refer to the [Conjur Java API](https://github.com/cyberark/conjur-api-java). + +For further assistance installing and configuring the Conjur Java API, +please refer to the [Setup](README.md#Setup) section of +the Conjur Java API [README.md](README.md) file. + +## Migrating to 3.0.0 + +With the update to v.3.0.0, the Conjur Java API now makes use of the `com.cyberark` +project namespace. This allows us to publish artifacts to this namespace, which are +immediately available to use in project. As such, your project can make use of the +Conjur Java API without needing to build the Jarfile locally. + +### Changes to your code base +Due to the change to the project namespace, we have modified the package name from +`net.conjur.api` to `com.cyberark.conjur.api`. As such, all import statements must be +updated to reflect this. + +### Example +Before: +```java +import net.conjur.api.AuthnProvider +``` + +After: +```java +import com.cyberark.conjur.api.AuthnProvider +``` + +### Changes to your `pom.xml` +Due to the change to the project namespace, we have modified the package name from +`net.conjur.api` to `com.cyberark.conjur.api`. As such, your dependency configuration +must be updated to reflect this. + +### Example +Before: +```xml + + net.conjur.api + conjur-api + 2.2.0 + +``` + +After: +```xml + + com.cyberark.conjur.api + conjur-api + 3.0.0 + +``` diff --git a/bin/build.sh b/bin/build.sh index 410a7d2..ac9093d 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash set -eo pipefail - -#TODO - add rest of steps needed to build the package - -docker run --rm -v "$PWD:/conjurinc/api-java" -w /conjurinc/api-java maven:3-jdk-8 /bin/bash -c \ -"mvn -X -e clean package -Dmaven.test.skip=true" \ No newline at end of file +docker run --rm \ + -v "$PWD:/cyberark/conjur-java-api" \ + -w /cyberark/conjur-java-api maven:3-jdk-8 \ + /bin/bash -ec "mvn -X -e clean package -Dmaven.test.skip=true" diff --git a/bin/deploy-release.sh b/bin/deploy-release.sh new file mode 100755 index 0000000..02b0748 --- /dev/null +++ b/bin/deploy-release.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -exo pipefail + +# Strip the 'v' from the Tag Name +export TAG=${TAG_NAME//"v"} + +# Deploy release to Sonatype OSSRH (OSS Repository Hosting) +# Setup: Import our GPG key and passphrase +# 1. Set the version in the POM to the Tagged Version +# 2. Sign our build and deploy to OSSRH +# 3. Release our staged deployment +# +# Note: The autoReleaseAfterClose for the nexus-staging-maven-plugin should be +# set to "false" if we do not want releases published automatically +docker run --rm \ + -e OSSRH_USERNAME \ + -e OSSRH_PASSWORD \ + -v "$PWD:/cyberark/conjur-java-api" \ + -v "$GPG_PASSWORD:/gpg_password" \ + -v "$GPG_PRIVATE_KEY:/gpg_key" \ + -w /cyberark/conjur-java-api maven:3-jdk-8 \ + /bin/bash -ec "gpg --batch --passphrase-file /gpg_password --trust-model always --import /gpg_key + mvn versions:set -DnewVersion=${TAG} + mvn --settings settings.xml clean deploy -Dmaven.test.skip=true -P ossrh,sign + mvn nexus-staging:release" diff --git a/bin/deploy-snapshot.sh b/bin/deploy-snapshot.sh new file mode 100755 index 0000000..083cfb5 --- /dev/null +++ b/bin/deploy-snapshot.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -exo pipefail + +# Deploy snapshot to Sonatype OSSRH (OSS Repository Hosting) +# Setup: Import our GPG key and passphrase +# 1. Deploy to snapshot repository of OSSRH +# +# Note: Snapshot releases do not need to meet Maven central requirements, +# but it is best to do so whenever possible +docker run --rm \ + -e OSSRH_USERNAME \ + -e OSSRH_PASSWORD \ + -v "$PWD:/cyberark/conjur-java-api" \ + -v "$GPG_PASSWORD:/gpg_password" \ + -v "$GPG_PRIVATE_KEY:/gpg_key" \ + -w /cyberark/conjur-java-api maven:3-jdk-8 \ + /bin/bash -ec "gpg --batch --passphrase-file /gpg_password --trust-model always --import /gpg_key + mvn --settings settings.xml clean deploy -Dmaven.test.skip=true -P ossrh,sign" diff --git a/pom.xml b/pom.xml index 43dd16c..775e9f1 100644 --- a/pom.xml +++ b/pom.xml @@ -1,17 +1,146 @@ 4.0.0 - net.conjur.api + com.cyberark.conjur.api conjur-api - 2.2.1 + + 3.0.0-SNAPSHOT + jar Conjur Client for the Conjur API + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + Cyberark Conjur + conj_maintainers@cyberark.com + Cyberark Software Ltd. + https://conjur.org + + + + scm:git:git://github.com/cyberark/conjur-api-java.git + scm:git:ssh://github.com:cyberark/conjur-api-java.git https://github.com/cyberark/conjur-api-java + + + + artifactory + + + conjurinc-releases + conjurinc-releases + https://conjurinc.artifactoryonline.com/conjurinc/libs-release-local + + + conjurinc-snapshots + conjurinc-snapshots + https://conjurinc.artifactoryonline.com/conjurinc/libs-snapshot-local + + + + + + + ossrh + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + + + + + + + + + sign + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + --pinentry-mode + loopback + --passphrase-file + /gpg_password + + + + + + + + + + UTF-8 2.0 @@ -83,21 +212,6 @@ - jar - - - - conjurinc-releases - conjurinc-releases - https://conjurinc.artifactoryonline.com/conjurinc/libs-release-local - - - conjurinc-snapshots - conjurinc-snapshots - https://conjurinc.artifactoryonline.com/conjurinc/libs-snapshot-local - - - src/main/java @@ -166,6 +280,22 @@ + + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + true + false + ossrh,sign + deploy + v@{project.version} + + + diff --git a/secrets.yml b/secrets.yml index cf47a56..9cfe269 100644 --- a/secrets.yml +++ b/secrets.yml @@ -1,2 +1,4 @@ -ARTIFACTORY_USERNAME: !var artifactory/users/jenkins/username -ARTIFACTORY_PASSWORD: !var artifactory/users/jenkins/password \ No newline at end of file +OSSRH_USERNAME: !var ecosystems/java/ossrh/username +OSSRH_PASSWORD: !var ecosystems/java/ossrh/password +GPG_PRIVATE_KEY: !var:file ecosystems/java/gpg/private-key +GPG_PASSWORD: !var:file ecosystems/java/gpg/password diff --git a/settings.xml b/settings.xml index 1f9fe94..d9276bb 100644 --- a/settings.xml +++ b/settings.xml @@ -1,17 +1,12 @@ - - - - ${env.ARTIFACTORY_USERNAME} - ${env.ARTIFACTORY_PASSWORD} - conjurinc-releases - - - ${env.ARTIFACTORY_USERNAME} - ${env.ARTIFACTORY_PASSWORD} - conjurinc-snapshots - - + + + + ossrh + ${env.OSSRH_USERNAME} + ${env.OSSRH_PASSWORD} + + diff --git a/src/main/java/net/conjur/api/AuthnProvider.java b/src/main/java/com/cyberark/conjur/api/AuthnProvider.java similarity index 96% rename from src/main/java/net/conjur/api/AuthnProvider.java rename to src/main/java/com/cyberark/conjur/api/AuthnProvider.java index 2a67344..70cd2e5 100644 --- a/src/main/java/net/conjur/api/AuthnProvider.java +++ b/src/main/java/com/cyberark/conjur/api/AuthnProvider.java @@ -1,4 +1,4 @@ -package net.conjur.api; +package com.cyberark.conjur.api; /** diff --git a/src/main/java/net/conjur/api/Conjur.java b/src/main/java/com/cyberark/conjur/api/Conjur.java similarity index 99% rename from src/main/java/net/conjur/api/Conjur.java rename to src/main/java/com/cyberark/conjur/api/Conjur.java index a06238c..493a2b1 100644 --- a/src/main/java/net/conjur/api/Conjur.java +++ b/src/main/java/com/cyberark/conjur/api/Conjur.java @@ -1,4 +1,4 @@ -package net.conjur.api; +package com.cyberark.conjur.api; import javax.net.ssl.SSLContext; diff --git a/src/main/java/net/conjur/api/Constants.java b/src/main/java/com/cyberark/conjur/api/Constants.java similarity index 93% rename from src/main/java/net/conjur/api/Constants.java rename to src/main/java/com/cyberark/conjur/api/Constants.java index 9f50f2e..3aaeca0 100644 --- a/src/main/java/net/conjur/api/Constants.java +++ b/src/main/java/com/cyberark/conjur/api/Constants.java @@ -1,4 +1,4 @@ -package net.conjur.api; +package com.cyberark.conjur.api; public class Constants { diff --git a/src/main/java/net/conjur/api/Credentials.java b/src/main/java/com/cyberark/conjur/api/Credentials.java similarity index 92% rename from src/main/java/net/conjur/api/Credentials.java rename to src/main/java/com/cyberark/conjur/api/Credentials.java index 8040363..023f362 100644 --- a/src/main/java/net/conjur/api/Credentials.java +++ b/src/main/java/com/cyberark/conjur/api/Credentials.java @@ -1,6 +1,6 @@ -package net.conjur.api; +package com.cyberark.conjur.api; -import net.conjur.util.Properties; +import com.cyberark.conjur.util.Properties; /** * Stores credentials for a Conjur identity. @@ -80,9 +80,9 @@ public String toString(){ @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof net.conjur.api.Credentials)) return false; + if (!(o instanceof com.cyberark.conjur.api.Credentials)) return false; - net.conjur.api.Credentials that = (net.conjur.api.Credentials) o; + com.cyberark.conjur.api.Credentials that = (com.cyberark.conjur.api.Credentials) o; if (!password.equals(that.getPassword())) return false; if (!username.equals(that.getUsername())) return false; diff --git a/src/main/java/net/conjur/api/Endpoints.java b/src/main/java/com/cyberark/conjur/api/Endpoints.java similarity index 95% rename from src/main/java/net/conjur/api/Endpoints.java rename to src/main/java/com/cyberark/conjur/api/Endpoints.java index 00be3e4..9998775 100644 --- a/src/main/java/net/conjur/api/Endpoints.java +++ b/src/main/java/com/cyberark/conjur/api/Endpoints.java @@ -1,7 +1,7 @@ -package net.conjur.api; +package com.cyberark.conjur.api; -import net.conjur.util.Args; -import net.conjur.util.Properties; +import com.cyberark.conjur.util.Args; +import com.cyberark.conjur.util.Properties; import java.io.Serializable; import java.net.URI; diff --git a/src/main/java/net/conjur/api/ResourceProvider.java b/src/main/java/com/cyberark/conjur/api/ResourceProvider.java similarity index 94% rename from src/main/java/net/conjur/api/ResourceProvider.java rename to src/main/java/com/cyberark/conjur/api/ResourceProvider.java index 4cc7908..fce682d 100644 --- a/src/main/java/net/conjur/api/ResourceProvider.java +++ b/src/main/java/com/cyberark/conjur/api/ResourceProvider.java @@ -1,4 +1,4 @@ -package net.conjur.api; +package com.cyberark.conjur.api; /** * Provides methods for retrieving and setting Conjur resources diff --git a/src/main/java/net/conjur/api/Token.java b/src/main/java/com/cyberark/conjur/api/Token.java similarity index 98% rename from src/main/java/net/conjur/api/Token.java rename to src/main/java/com/cyberark/conjur/api/Token.java index f8cc7ae..f5c7cf0 100644 --- a/src/main/java/net/conjur/api/Token.java +++ b/src/main/java/com/cyberark/conjur/api/Token.java @@ -1,7 +1,7 @@ -package net.conjur.api; +package com.cyberark.conjur.api; import com.google.gson.annotations.SerializedName; -import net.conjur.util.JsonSupport; +import com.cyberark.conjur.util.JsonSupport; import org.apache.commons.codec.binary.Base64; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormat; diff --git a/src/main/java/net/conjur/api/Variables.java b/src/main/java/com/cyberark/conjur/api/Variables.java similarity index 90% rename from src/main/java/net/conjur/api/Variables.java rename to src/main/java/com/cyberark/conjur/api/Variables.java index 1eab1b4..2fc1e36 100644 --- a/src/main/java/net/conjur/api/Variables.java +++ b/src/main/java/com/cyberark/conjur/api/Variables.java @@ -1,8 +1,8 @@ -package net.conjur.api; +package com.cyberark.conjur.api; import javax.net.ssl.SSLContext; -import net.conjur.api.clients.ResourceClient; +import com.cyberark.conjur.api.clients.ResourceClient; public class Variables { diff --git a/src/main/java/net/conjur/api/clients/AuthnClient.java b/src/main/java/com/cyberark/conjur/api/clients/AuthnClient.java similarity index 89% rename from src/main/java/net/conjur/api/clients/AuthnClient.java rename to src/main/java/com/cyberark/conjur/api/clients/AuthnClient.java index 2c4bd6d..f98b990 100644 --- a/src/main/java/net/conjur/api/clients/AuthnClient.java +++ b/src/main/java/com/cyberark/conjur/api/clients/AuthnClient.java @@ -1,6 +1,6 @@ -package net.conjur.api.clients; +package com.cyberark.conjur.api.clients; -import static net.conjur.util.EncodeUriComponent.encodeUriComponent; +import static com.cyberark.conjur.util.EncodeUriComponent.encodeUriComponent; import javax.net.ssl.SSLContext; import javax.ws.rs.WebApplicationException; @@ -10,11 +10,11 @@ import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Response; -import net.conjur.api.AuthnProvider; -import net.conjur.api.Credentials; -import net.conjur.api.Endpoints; -import net.conjur.api.Token; -import net.conjur.util.rs.HttpBasicAuthFilter; +import com.cyberark.conjur.api.AuthnProvider; +import com.cyberark.conjur.api.Credentials; +import com.cyberark.conjur.api.Endpoints; +import com.cyberark.conjur.api.Token; +import com.cyberark.conjur.util.rs.HttpBasicAuthFilter; /** * Conjur authentication service client. diff --git a/src/main/java/net/conjur/api/clients/AuthnTokenClient.java b/src/main/java/com/cyberark/conjur/api/clients/AuthnTokenClient.java similarity index 72% rename from src/main/java/net/conjur/api/clients/AuthnTokenClient.java rename to src/main/java/com/cyberark/conjur/api/clients/AuthnTokenClient.java index 2bf845e..ab838dd 100644 --- a/src/main/java/net/conjur/api/clients/AuthnTokenClient.java +++ b/src/main/java/com/cyberark/conjur/api/clients/AuthnTokenClient.java @@ -1,6 +1,6 @@ -package net.conjur.api.clients; -import net.conjur.api.AuthnProvider; -import net.conjur.api.Token; +package com.cyberark.conjur.api.clients; +import com.cyberark.conjur.api.AuthnProvider; +import com.cyberark.conjur.api.Token; public class AuthnTokenClient implements AuthnProvider { private Token token; diff --git a/src/main/java/net/conjur/api/clients/ResourceClient.java b/src/main/java/com/cyberark/conjur/api/clients/ResourceClient.java similarity index 91% rename from src/main/java/net/conjur/api/clients/ResourceClient.java rename to src/main/java/com/cyberark/conjur/api/clients/ResourceClient.java index a9ad3f6..81b77ed 100644 --- a/src/main/java/net/conjur/api/clients/ResourceClient.java +++ b/src/main/java/com/cyberark/conjur/api/clients/ResourceClient.java @@ -1,4 +1,4 @@ -package net.conjur.api.clients; +package com.cyberark.conjur.api.clients; import javax.net.ssl.SSLContext; import javax.ws.rs.WebApplicationException; @@ -8,12 +8,12 @@ import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Response; -import net.conjur.api.Credentials; -import net.conjur.api.Endpoints; -import net.conjur.api.ResourceProvider; -import net.conjur.api.Token; -import net.conjur.util.EncodeUriComponent; -import net.conjur.util.rs.TokenAuthFilter; +import com.cyberark.conjur.api.Credentials; +import com.cyberark.conjur.api.Endpoints; +import com.cyberark.conjur.api.ResourceProvider; +import com.cyberark.conjur.api.Token; +import com.cyberark.conjur.util.EncodeUriComponent; +import com.cyberark.conjur.util.rs.TokenAuthFilter; /** * Conjur service client. diff --git a/src/main/java/net/conjur/util/Args.java b/src/main/java/com/cyberark/conjur/util/Args.java similarity index 98% rename from src/main/java/net/conjur/util/Args.java rename to src/main/java/com/cyberark/conjur/util/Args.java index 0996f6a..7c7d76f 100644 --- a/src/main/java/net/conjur/util/Args.java +++ b/src/main/java/com/cyberark/conjur/util/Args.java @@ -1,4 +1,4 @@ -package net.conjur.util; +package com.cyberark.conjur.util; /* * Copied from org.apache.http.utils.Args to avoid dependencies. */ diff --git a/src/main/java/net/conjur/util/Callable.java b/src/main/java/com/cyberark/conjur/util/Callable.java similarity index 67% rename from src/main/java/net/conjur/util/Callable.java rename to src/main/java/com/cyberark/conjur/util/Callable.java index 6f3b901..eca3814 100644 --- a/src/main/java/net/conjur/util/Callable.java +++ b/src/main/java/com/cyberark/conjur/util/Callable.java @@ -1,4 +1,4 @@ -package net.conjur.util; +package com.cyberark.conjur.util; public interface Callable { public T call() throws Exception; diff --git a/src/main/java/net/conjur/util/EncodeUriComponent.java b/src/main/java/com/cyberark/conjur/util/EncodeUriComponent.java similarity index 93% rename from src/main/java/net/conjur/util/EncodeUriComponent.java rename to src/main/java/com/cyberark/conjur/util/EncodeUriComponent.java index f99d14a..522d0c9 100644 --- a/src/main/java/net/conjur/util/EncodeUriComponent.java +++ b/src/main/java/com/cyberark/conjur/util/EncodeUriComponent.java @@ -1,4 +1,4 @@ -package net.conjur.util; +package com.cyberark.conjur.util; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; diff --git a/src/main/java/net/conjur/util/JsonSupport.java b/src/main/java/com/cyberark/conjur/util/JsonSupport.java similarity index 95% rename from src/main/java/net/conjur/util/JsonSupport.java rename to src/main/java/com/cyberark/conjur/util/JsonSupport.java index 34f4b6b..5d709cc 100644 --- a/src/main/java/net/conjur/util/JsonSupport.java +++ b/src/main/java/com/cyberark/conjur/util/JsonSupport.java @@ -1,4 +1,4 @@ -package net.conjur.util; +package com.cyberark.conjur.util; import com.google.gson.Gson; diff --git a/src/main/java/net/conjur/util/Lang.java b/src/main/java/com/cyberark/conjur/util/Lang.java similarity index 80% rename from src/main/java/net/conjur/util/Lang.java rename to src/main/java/com/cyberark/conjur/util/Lang.java index 1ce1e02..0d983bb 100644 --- a/src/main/java/net/conjur/util/Lang.java +++ b/src/main/java/com/cyberark/conjur/util/Lang.java @@ -1,4 +1,4 @@ -package net.conjur.util; +package com.cyberark.conjur.util; /** * diff --git a/src/main/java/net/conjur/util/Properties.java b/src/main/java/com/cyberark/conjur/util/Properties.java similarity index 96% rename from src/main/java/net/conjur/util/Properties.java rename to src/main/java/com/cyberark/conjur/util/Properties.java index 1de0118..d38af01 100644 --- a/src/main/java/net/conjur/util/Properties.java +++ b/src/main/java/com/cyberark/conjur/util/Properties.java @@ -1,4 +1,4 @@ -package net.conjur.util; +package com.cyberark.conjur.util; /** * Properties helpers diff --git a/src/main/java/net/conjur/util/TextUtils.java b/src/main/java/com/cyberark/conjur/util/TextUtils.java similarity index 98% rename from src/main/java/net/conjur/util/TextUtils.java rename to src/main/java/com/cyberark/conjur/util/TextUtils.java index 4549cc5..c9f7ac3 100644 --- a/src/main/java/net/conjur/util/TextUtils.java +++ b/src/main/java/com/cyberark/conjur/util/TextUtils.java @@ -1,4 +1,4 @@ -package net.conjur.util; +package com.cyberark.conjur.util; import java.io.UnsupportedEncodingException; diff --git a/src/main/java/net/conjur/util/rs/HttpBasicAuthFilter.java b/src/main/java/com/cyberark/conjur/util/rs/HttpBasicAuthFilter.java similarity index 97% rename from src/main/java/net/conjur/util/rs/HttpBasicAuthFilter.java rename to src/main/java/com/cyberark/conjur/util/rs/HttpBasicAuthFilter.java index ef1bb62..a030716 100644 --- a/src/main/java/net/conjur/util/rs/HttpBasicAuthFilter.java +++ b/src/main/java/com/cyberark/conjur/util/rs/HttpBasicAuthFilter.java @@ -1,4 +1,4 @@ -package net.conjur.util.rs; +package com.cyberark.conjur.util.rs; import org.apache.commons.codec.binary.Base64; diff --git a/src/main/java/net/conjur/util/rs/JsonBodyReader.java b/src/main/java/com/cyberark/conjur/util/rs/JsonBodyReader.java similarity index 98% rename from src/main/java/net/conjur/util/rs/JsonBodyReader.java rename to src/main/java/com/cyberark/conjur/util/rs/JsonBodyReader.java index 3bfb384..6a1ad16 100644 --- a/src/main/java/net/conjur/util/rs/JsonBodyReader.java +++ b/src/main/java/com/cyberark/conjur/util/rs/JsonBodyReader.java @@ -1,5 +1,5 @@ -package net.conjur.util.rs; +package com.cyberark.conjur.util.rs; import com.google.gson.Gson; import edu.emory.mathcs.backport.java.util.Collections; diff --git a/src/main/java/net/conjur/util/rs/JsonReadable.java b/src/main/java/com/cyberark/conjur/util/rs/JsonReadable.java similarity index 89% rename from src/main/java/net/conjur/util/rs/JsonReadable.java rename to src/main/java/com/cyberark/conjur/util/rs/JsonReadable.java index f4dd7bd..2dd1f69 100644 --- a/src/main/java/net/conjur/util/rs/JsonReadable.java +++ b/src/main/java/com/cyberark/conjur/util/rs/JsonReadable.java @@ -1,4 +1,4 @@ -package net.conjur.util.rs; +package com.cyberark.conjur.util.rs; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/net/conjur/util/rs/TokenAuthFilter.java b/src/main/java/com/cyberark/conjur/util/rs/TokenAuthFilter.java similarity index 85% rename from src/main/java/net/conjur/util/rs/TokenAuthFilter.java rename to src/main/java/com/cyberark/conjur/util/rs/TokenAuthFilter.java index b402abe..f0786ab 100644 --- a/src/main/java/net/conjur/util/rs/TokenAuthFilter.java +++ b/src/main/java/com/cyberark/conjur/util/rs/TokenAuthFilter.java @@ -1,8 +1,8 @@ -package net.conjur.util.rs; +package com.cyberark.conjur.util.rs; -import net.conjur.api.AuthnProvider; -import net.conjur.api.Token; -import net.conjur.util.Args; +import com.cyberark.conjur.api.AuthnProvider; +import com.cyberark.conjur.api.Token; +import com.cyberark.conjur.util.Args; import javax.ws.rs.client.ClientRequestContext; import javax.ws.rs.client.ClientRequestFilter; diff --git a/src/test/java/net/conjur/api/ConjurTest.java b/src/test/java/net/conjur/api/ConjurTest.java index 4fcb1e5..d8ab80d 100644 --- a/src/test/java/net/conjur/api/ConjurTest.java +++ b/src/test/java/net/conjur/api/ConjurTest.java @@ -1,4 +1,4 @@ -package net.conjur.api; +package com.cyberark.conjur.api; import org.junit.Assert; import org.junit.Rule;