From a59246bdf3e1064abb1086205016fa0481651137 Mon Sep 17 00:00:00 2001 From: Greg Schueler Date: Wed, 23 Apr 2014 16:18:41 -0700 Subject: [PATCH] Api sync for key storage * change ssh-key/ to keys/ in api paths --- .../java/org/rundeck/api/RundeckClient.java | 92 +++++++------- ...HKeyResource.java => BaseKeyResource.java} | 23 ++-- .../{SSHKeyResource.java => KeyResource.java} | 6 +- .../api/parser/SSHKeyResourceParser.java | 11 +- .../org/rundeck/api/RundeckClientTest.java | 112 +++++++++--------- .../{ssh_key_delete.yaml => key_delete.yaml} | 4 +- ...private.yaml => key_get_data_private.yaml} | 5 +- ...a_public.yaml => key_get_data_public.yaml} | 2 +- .../betamax/tapes/key_get_private.yaml | 23 ++++ ...ey_get_public.yaml => key_get_public.yaml} | 5 +- .../betamax/tapes/key_list_directory.yaml | 21 ++++ .../betamax/tapes/key_list_root.yaml | 21 ++++ ...re_private.yaml => key_store_private.yaml} | 5 +- ...tore_public.yaml => key_store_public.yaml} | 5 +- .../betamax/tapes/ssh_key_get_private.yaml | 22 ---- .../betamax/tapes/ssh_key_list_directory.yaml | 21 ---- .../betamax/tapes/ssh_key_list_root.yaml | 21 ---- 17 files changed, 200 insertions(+), 199 deletions(-) rename src/main/java/org/rundeck/api/domain/{BaseSSHKeyResource.java => BaseKeyResource.java} (65%) rename src/main/java/org/rundeck/api/domain/{SSHKeyResource.java => KeyResource.java} (68%) rename src/test/resources/betamax/tapes/{ssh_key_delete.yaml => key_delete.yaml} (86%) rename src/test/resources/betamax/tapes/{ssh_key_get_data_private.yaml => key_get_data_private.yaml} (54%) rename src/test/resources/betamax/tapes/{ssh_key_get_data_public.yaml => key_get_data_public.yaml} (88%) create mode 100644 src/test/resources/betamax/tapes/key_get_private.yaml rename src/test/resources/betamax/tapes/{ssh_key_get_public.yaml => key_get_public.yaml} (50%) create mode 100644 src/test/resources/betamax/tapes/key_list_directory.yaml create mode 100644 src/test/resources/betamax/tapes/key_list_root.yaml rename src/test/resources/betamax/tapes/{ssh_key_store_private.yaml => key_store_private.yaml} (50%) rename src/test/resources/betamax/tapes/{ssh_key_store_public.yaml => key_store_public.yaml} (53%) delete mode 100644 src/test/resources/betamax/tapes/ssh_key_get_private.yaml delete mode 100644 src/test/resources/betamax/tapes/ssh_key_list_directory.yaml delete mode 100644 src/test/resources/betamax/tapes/ssh_key_list_root.yaml diff --git a/src/main/java/org/rundeck/api/RundeckClient.java b/src/main/java/org/rundeck/api/RundeckClient.java index b0baa4c..8462dba 100644 --- a/src/main/java/org/rundeck/api/RundeckClient.java +++ b/src/main/java/org/rundeck/api/RundeckClient.java @@ -82,7 +82,7 @@ public class RundeckClient implements Serializable { private static final long serialVersionUID = 1L; public static final String JOBS_IMPORT = "/jobs/import"; public static final String STORAGE_ROOT_PATH = "/storage/"; - public static final String SSH_KEY_PATH = "ssh-key/"; + public static final String STORAGE_KEYS_PATH = "keys/"; /** * Supported version numbers @@ -2375,18 +2375,18 @@ public class RundeckClient implements Serializable { } /** - * Store an SSH key file - * @param path ssh key storage path, must start with "ssh-key/" + * Store an key file + * @param path ssh key storage path, must start with "keys/" * @param keyfile key file * @param privateKey true to store private key, false to store public key - * @return the SSH key resource + * @return the key resource * @throws RundeckApiException */ - public SSHKeyResource storeSshKey(final String path, final File keyfile, boolean privateKey) throws RundeckApiException{ - AssertUtil.notNull(path, "path is mandatory to store an SSH key."); - AssertUtil.notNull(keyfile, "keyfile is mandatory to store an SSH key."); - if (!path.startsWith(SSH_KEY_PATH)) { - throw new IllegalArgumentException("SSH key storage path must start with: " + SSH_KEY_PATH); + public KeyResource storeKey(final String path, final File keyfile, boolean privateKey) throws RundeckApiException{ + AssertUtil.notNull(path, "path is mandatory to store an key."); + AssertUtil.notNull(keyfile, "keyfile is mandatory to store an key."); + if (!path.startsWith(STORAGE_KEYS_PATH)) { + throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); } return new ApiCall(this).post( new ApiPathBuilder(STORAGE_ROOT_PATH, path).content( @@ -2398,42 +2398,42 @@ public class RundeckClient implements Serializable { } /** - * Get metadata for an SSH key file + * Get metadata for an key file * - * @param path ssh key storage path, must start with "ssh-key/" + * @param path ssh key storage path, must start with "keys/" * * @return the ssh key resource * * @throws RundeckApiException if there is an error, or if the path is a directory not a file */ - public SSHKeyResource getSshKey(final String path) throws RundeckApiException { - AssertUtil.notNull(path, "path is mandatory to get an SSH key."); - if (!path.startsWith(SSH_KEY_PATH)) { - throw new IllegalArgumentException("SSH key storage path must start with: " + SSH_KEY_PATH); + public KeyResource getKey(final String path) throws RundeckApiException { + AssertUtil.notNull(path, "path is mandatory to get an key."); + if (!path.startsWith(STORAGE_KEYS_PATH)) { + throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); } - SSHKeyResource storageResource = new ApiCall(this).get( + KeyResource storageResource = new ApiCall(this).get( new ApiPathBuilder(STORAGE_ROOT_PATH, path), new SSHKeyResourceParser("/resource") ); if (storageResource.isDirectory()) { - throw new RundeckApiException("SSH Key Path is a directory: " + path); + throw new RundeckApiException("Key Path is a directory: " + path); } return storageResource; } /** - * Get content for a public SSH key file - * @param path ssh key storage path, must start with "ssh-key/" + * Get content for a public key file + * @param path ssh key storage path, must start with "keys/" * @param out outputstream to write data to * * @return length of written data * @throws RundeckApiException */ - public int getPublicSshKeyContent(final String path, final OutputStream out) throws + public int getPublicKeyContent(final String path, final OutputStream out) throws RundeckApiException, IOException { - AssertUtil.notNull(path, "path is mandatory to get an SSH key."); - if (!path.startsWith(SSH_KEY_PATH)) { - throw new IllegalArgumentException("SSH key storage path must start with: " + SSH_KEY_PATH); + AssertUtil.notNull(path, "path is mandatory to get an key."); + if (!path.startsWith(STORAGE_KEYS_PATH)) { + throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); } try { return new ApiCall(this).get( @@ -2443,66 +2443,66 @@ public class RundeckClient implements Serializable { out ); } catch (RundeckApiException.RundeckApiHttpContentTypeException e) { - throw new RundeckApiException("Requested SSH Key path was not a Public key: " + path, e); + throw new RundeckApiException("Requested Key path was not a Public key: " + path, e); } } /** - * Get content for a public SSH key file - * @param path ssh key storage path, must start with "ssh-key/" + * Get content for a public key file + * @param path ssh key storage path, must start with "keys/" * @param out file to write data to * @return length of written data * @throws RundeckApiException */ - public int getPublicSshKeyContent(final String path, final File out) throws + public int getPublicKeyContent(final String path, final File out) throws RundeckApiException, IOException { final FileOutputStream fileOutputStream = new FileOutputStream(out); try { - return getPublicSshKeyContent(path, fileOutputStream); + return getPublicKeyContent(path, fileOutputStream); }finally { fileOutputStream.close(); } } /** - * List contents of root SSH key directory + * List contents of root key directory * - * @return list of SSH key resources + * @return list of key resources * @throws RundeckApiException */ - public List listSshKeyDirectoryRoot() throws RundeckApiException { - return listSshKeyDirectory(SSH_KEY_PATH); + public List listKeyDirectoryRoot() throws RundeckApiException { + return listKeyDirectory(STORAGE_KEYS_PATH); } /** - * List contents of SSH key directory + * List contents of key directory * - * @param path ssh key storage path, must start with "ssh-key/" + * @param path ssh key storage path, must start with "keys/" * * @throws RundeckApiException if there is an error, or if the path is a file not a directory */ - public List listSshKeyDirectory(final String path) throws RundeckApiException { - AssertUtil.notNull(path, "path is mandatory to get an SSH key."); - if (!path.startsWith(SSH_KEY_PATH)) { - throw new IllegalArgumentException("SSH key storage path must start with: " + SSH_KEY_PATH); + public List listKeyDirectory(final String path) throws RundeckApiException { + AssertUtil.notNull(path, "path is mandatory to get an key."); + if (!path.startsWith(STORAGE_KEYS_PATH)) { + throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); } - SSHKeyResource storageResource = new ApiCall(this).get( + KeyResource storageResource = new ApiCall(this).get( new ApiPathBuilder(STORAGE_ROOT_PATH, path), new SSHKeyResourceParser("/resource") ); if(!storageResource.isDirectory()) { - throw new RundeckApiException("SSH key path is not a directory path: " + path); + throw new RundeckApiException("key path is not a directory path: " + path); } return storageResource.getDirectoryContents(); } /** - * Delete an SSH key file - * @param path a path to a SSH key file, must start with "ssh-key/" + * Delete an key file + * @param path a path to a key file, must start with "keys/" */ - public void deleteSshKey(final String path){ - AssertUtil.notNull(path, "path is mandatory to delete an SSH key."); - if (!path.startsWith(SSH_KEY_PATH)) { - throw new IllegalArgumentException("SSH key storage path must start with: " + SSH_KEY_PATH); + public void deleteKey(final String path){ + AssertUtil.notNull(path, "path is mandatory to delete an key."); + if (!path.startsWith(STORAGE_KEYS_PATH)) { + throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); } new ApiCall(this).delete(new ApiPathBuilder(STORAGE_ROOT_PATH, path)); } diff --git a/src/main/java/org/rundeck/api/domain/BaseSSHKeyResource.java b/src/main/java/org/rundeck/api/domain/BaseKeyResource.java similarity index 65% rename from src/main/java/org/rundeck/api/domain/BaseSSHKeyResource.java rename to src/main/java/org/rundeck/api/domain/BaseKeyResource.java index b47d878..c1ed3b7 100644 --- a/src/main/java/org/rundeck/api/domain/BaseSSHKeyResource.java +++ b/src/main/java/org/rundeck/api/domain/BaseKeyResource.java @@ -1,21 +1,18 @@ package org.rundeck.api.domain; -import org.rundeck.api.RundeckClient; -import org.rundeck.api.parser.StorageResourceParser; - import java.util.ArrayList; import java.util.List; /** - * BaseSSHKeyResource is ... + * BaseKeyResource is ... * * @author Greg Schueler * @since 2014-04-04 */ -public class BaseSSHKeyResource extends BaseStorageResource implements SSHKeyResource { +public class BaseKeyResource extends BaseStorageResource implements KeyResource { private boolean privateKey; - public BaseSSHKeyResource() { + public BaseKeyResource() { } @@ -27,22 +24,22 @@ public class BaseSSHKeyResource extends BaseStorageResource implements SSHKeyRes this.privateKey = privateKey; } - ArrayList sshKeyResources = new ArrayList(); + ArrayList keyResources = new ArrayList(); @Override public void setDirectoryContents(List directoryContents) { for (StorageResource directoryContent : directoryContents) { - sshKeyResources.add(from(directoryContent)); + keyResources.add(from(directoryContent)); } } @Override - public List getDirectoryContents() { - return sshKeyResources; + public List getDirectoryContents() { + return keyResources; } - public static BaseSSHKeyResource from(final StorageResource source) { - final BaseSSHKeyResource baseSshKeyResource = new BaseSSHKeyResource(); + public static BaseKeyResource from(final StorageResource source) { + final BaseKeyResource baseSshKeyResource = new BaseKeyResource(); baseSshKeyResource.setDirectory(source.isDirectory()); baseSshKeyResource.setPath(source.getPath()); baseSshKeyResource.setName(source.getName()); @@ -51,7 +48,7 @@ public class BaseSSHKeyResource extends BaseStorageResource implements SSHKeyRes if (!baseSshKeyResource.isDirectory()) { baseSshKeyResource.setPrivateKey( null != baseSshKeyResource.getMetadata() && "private".equals(baseSshKeyResource.getMetadata().get - ("Rundeck-ssh-key-type")) + ("Rundeck-key-type")) ); } else if (null != source.getDirectoryContents()) { baseSshKeyResource.setDirectoryContents(source.getDirectoryContents()); diff --git a/src/main/java/org/rundeck/api/domain/SSHKeyResource.java b/src/main/java/org/rundeck/api/domain/KeyResource.java similarity index 68% rename from src/main/java/org/rundeck/api/domain/SSHKeyResource.java rename to src/main/java/org/rundeck/api/domain/KeyResource.java index 33bbbd5..ff1f7e1 100644 --- a/src/main/java/org/rundeck/api/domain/SSHKeyResource.java +++ b/src/main/java/org/rundeck/api/domain/KeyResource.java @@ -3,12 +3,12 @@ package org.rundeck.api.domain; import java.util.List; /** - * SSHKeyResource represents a directory or an SSH key file + * KeyResource represents a directory or an SSH key file * * @author Greg Schueler * @since 2014-04-04 */ -public interface SSHKeyResource extends StorageResource { +public interface KeyResource extends StorageResource { /** * Return true if this is a file and is a private SSH key file. * @return @@ -19,5 +19,5 @@ public interface SSHKeyResource extends StorageResource { * Return the list of SSH Key resources if this is a directory * @return */ - public List getDirectoryContents(); + public List getDirectoryContents(); } diff --git a/src/main/java/org/rundeck/api/parser/SSHKeyResourceParser.java b/src/main/java/org/rundeck/api/parser/SSHKeyResourceParser.java index 5485d31..091ab2b 100644 --- a/src/main/java/org/rundeck/api/parser/SSHKeyResourceParser.java +++ b/src/main/java/org/rundeck/api/parser/SSHKeyResourceParser.java @@ -1,9 +1,8 @@ package org.rundeck.api.parser; import org.dom4j.Node; -import org.rundeck.api.RundeckClient; -import org.rundeck.api.domain.BaseSSHKeyResource; -import org.rundeck.api.domain.SSHKeyResource; +import org.rundeck.api.domain.BaseKeyResource; +import org.rundeck.api.domain.KeyResource; /** * SSHKeyResourceParser is ... @@ -11,7 +10,7 @@ import org.rundeck.api.domain.SSHKeyResource; * @author Greg Schueler * @since 2014-04-04 */ -public class SSHKeyResourceParser extends BaseXpathParser implements XmlNodeParser { +public class SSHKeyResourceParser extends BaseXpathParser implements XmlNodeParser { public SSHKeyResourceParser() { } @@ -20,7 +19,7 @@ public class SSHKeyResourceParser extends BaseXpathParser implem } @Override - public SSHKeyResource parse(Node node) { - return BaseSSHKeyResource.from(new StorageResourceParser().parse(node)); + public KeyResource parse(Node node) { + return BaseKeyResource.from(new StorageResourceParser().parse(node)); } } diff --git a/src/test/java/org/rundeck/api/RundeckClientTest.java b/src/test/java/org/rundeck/api/RundeckClientTest.java index f989e69..fb01b80 100644 --- a/src/test/java/org/rundeck/api/RundeckClientTest.java +++ b/src/test/java/org/rundeck/api/RundeckClientTest.java @@ -1284,8 +1284,8 @@ public class RundeckClientTest { * Store ssh key */ @Test - @Betamax(tape = "ssh_key_store_private", mode = TapeMode.READ_ONLY) - public void storeSshKey_private() throws Exception { + @Betamax(tape = "key_store_private", mode = TapeMode.READ_ONLY) + public void storeKey_private() throws Exception { final RundeckClient client = createClient(TEST_TOKEN_7, 11); File temp = File.createTempFile("test-key", ".tmp"); temp.deleteOnExit(); @@ -1295,26 +1295,26 @@ public class RundeckClientTest { }finally { out.close(); } - SSHKeyResource storageResource = client.storeSshKey("ssh-key/test/example/file1.pem", temp, true); + KeyResource storageResource = client.storeKey("keys/test/example/file1.pem", temp, true); Assert.assertNotNull(storageResource); Assert.assertFalse(storageResource.isDirectory()); Assert.assertTrue(storageResource.isPrivateKey()); Assert.assertEquals("file1.pem", storageResource.getName()); - Assert.assertEquals("ssh-key/test/example/file1.pem", storageResource.getPath()); - Assert.assertEquals("http://dignan.local:4440/api/11/storage/ssh-key/test/example/file1.pem", + Assert.assertEquals("keys/test/example/file1.pem", storageResource.getPath()); + Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file1.pem", storageResource.getUrl()); Assert.assertEquals(0, storageResource.getDirectoryContents().size()); Map metadata = storageResource.getMetadata(); Assert.assertNotNull(metadata); Assert.assertEquals("application/octet-stream", metadata.get("Rundeck-content-type")); - Assert.assertEquals("private", metadata.get("Rundeck-ssh-key-type")); + Assert.assertEquals("private", metadata.get("Rundeck-key-type")); } /** * Store ssh key */ @Test - @Betamax(tape = "ssh_key_store_public", mode = TapeMode.READ_ONLY) - public void storeSshKey_public() throws Exception { + @Betamax(tape = "key_store_public", mode = TapeMode.READ_ONLY) + public void storeKey_public() throws Exception { final RundeckClient client = createClient(TEST_TOKEN_7, 11); File temp = File.createTempFile("test-key", ".tmp"); temp.deleteOnExit(); @@ -1324,76 +1324,76 @@ public class RundeckClientTest { }finally { out.close(); } - SSHKeyResource storageResource = client.storeSshKey("ssh-key/test/example/file2.pub", temp, false); + KeyResource storageResource = client.storeKey("keys/test/example/file2.pub", temp, false); Assert.assertNotNull(storageResource); Assert.assertFalse(storageResource.isDirectory()); Assert.assertFalse(storageResource.isPrivateKey()); Assert.assertEquals("file2.pub", storageResource.getName()); - Assert.assertEquals("ssh-key/test/example/file2.pub", storageResource.getPath()); - Assert.assertEquals("http://dignan.local:4440/api/11/storage/ssh-key/test/example/file2.pub", + Assert.assertEquals("keys/test/example/file2.pub", storageResource.getPath()); + Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file2.pub", storageResource.getUrl()); Assert.assertEquals(0, storageResource.getDirectoryContents().size()); Map metadata = storageResource.getMetadata(); Assert.assertNotNull(metadata); Assert.assertEquals("application/pgp-keys", metadata.get("Rundeck-content-type")); - Assert.assertEquals("public", metadata.get("Rundeck-ssh-key-type")); + Assert.assertEquals("public", metadata.get("Rundeck-key-type")); } /** * get ssh key */ @Test - @Betamax(tape = "ssh_key_get_public", mode = TapeMode.READ_ONLY) - public void getSshKey_public() throws Exception { + @Betamax(tape = "key_get_public", mode = TapeMode.READ_ONLY) + public void getKey_public() throws Exception { final RundeckClient client = createClient(TEST_TOKEN_7, 11); - SSHKeyResource storageResource = client.getSshKey("ssh-key/test/example/file2.pub"); + KeyResource storageResource = client.getKey("keys/test/example/file2.pub"); Assert.assertNotNull(storageResource); Assert.assertFalse(storageResource.isDirectory()); Assert.assertFalse(storageResource.isPrivateKey()); Assert.assertEquals("file2.pub", storageResource.getName()); - Assert.assertEquals("ssh-key/test/example/file2.pub", storageResource.getPath()); - Assert.assertEquals("http://dignan.local:4440/api/11/storage/ssh-key/test/example/file2.pub", + Assert.assertEquals("keys/test/example/file2.pub", storageResource.getPath()); + Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file2.pub", storageResource.getUrl()); Assert.assertEquals(0, storageResource.getDirectoryContents().size()); Map metadata = storageResource.getMetadata(); Assert.assertNotNull(metadata); Assert.assertEquals("application/pgp-keys", metadata.get("Rundeck-content-type")); - Assert.assertEquals("public", metadata.get("Rundeck-ssh-key-type")); + Assert.assertEquals("public", metadata.get("Rundeck-key-type")); } /** * get ssh key */ @Test - @Betamax(tape = "ssh_key_get_private", mode = TapeMode.READ_ONLY) - public void getSshKey_private() throws Exception { + @Betamax(tape = "key_get_private", mode = TapeMode.READ_ONLY) + public void getKey_private() throws Exception { final RundeckClient client = createClient(TEST_TOKEN_7, 11); - SSHKeyResource storageResource = client.getSshKey("ssh-key/test/example/file1.pem"); + KeyResource storageResource = client.getKey("keys/test/example/file1.pem"); Assert.assertNotNull(storageResource); Assert.assertFalse(storageResource.isDirectory()); Assert.assertTrue(storageResource.isPrivateKey()); Assert.assertEquals("file1.pem", storageResource.getName()); - Assert.assertEquals("ssh-key/test/example/file1.pem", storageResource.getPath()); - Assert.assertEquals("http://dignan.local:4440/api/11/storage/ssh-key/test/example/file1.pem", + Assert.assertEquals("keys/test/example/file1.pem", storageResource.getPath()); + Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file1.pem", storageResource.getUrl()); Assert.assertEquals(0, storageResource.getDirectoryContents().size()); Map metadata = storageResource.getMetadata(); Assert.assertNotNull(metadata); Assert.assertEquals("application/octet-stream", metadata.get("Rundeck-content-type")); - Assert.assertEquals("private", metadata.get("Rundeck-ssh-key-type")); + Assert.assertEquals("private", metadata.get("Rundeck-key-type")); } /** * get ssh key data */ @Test - @Betamax(tape = "ssh_key_get_data_private", mode = TapeMode.READ_ONLY) - public void getSshKeyData_private() throws Exception { + @Betamax(tape = "key_get_data_private", mode = TapeMode.READ_ONLY) + public void getKeyData_private() throws Exception { final RundeckClient client = createClient(TEST_TOKEN_7, 11); File temp = File.createTempFile("test-key", ".tmp"); temp.deleteOnExit(); try { - int data = client.getPublicSshKeyContent("ssh-key/test/example/file1.pem", temp); + int data = client.getPublicKeyContent("keys/test/example/file1.pem", temp); Assert.fail("expected failure"); } catch (RundeckApiException e) { - Assert.assertEquals("Requested SSH Key path was not a Public key: ssh-key/test/example/file1.pem", + Assert.assertEquals("Requested Key path was not a Public key: keys/test/example/file1.pem", e.getMessage()); } } @@ -1401,72 +1401,72 @@ public class RundeckClientTest { * get ssh key data */ @Test - @Betamax(tape = "ssh_key_get_data_public", mode = TapeMode.READ_ONLY) - public void getSshKeyData_public() throws Exception { + @Betamax(tape = "key_get_data_public", mode = TapeMode.READ_ONLY) + public void getKeyData_public() throws Exception { final RundeckClient client = createClient(TEST_TOKEN_7, 11); File temp = File.createTempFile("test-key", ".tmp"); temp.deleteOnExit(); - int length = client.getPublicSshKeyContent("ssh-key/test/example/file2.pub", temp); + int length = client.getPublicKeyContent("keys/test/example/file2.pub", temp); Assert.assertEquals(5, length); } /** * list directory */ @Test - @Betamax(tape = "ssh_key_list_directory", mode = TapeMode.READ_ONLY) - public void listSshKeyDirectory() throws Exception { + @Betamax(tape = "key_list_directory", mode = TapeMode.READ_ONLY) + public void listKeyDirectory() throws Exception { final RundeckClient client = createClient(TEST_TOKEN_7, 11); - List list = client.listSshKeyDirectory("ssh-key/test/example"); + List list = client.listKeyDirectory("keys/test/example"); Assert.assertEquals(2, list.size()); - SSHKeyResource storageResource1 = list.get(0); - SSHKeyResource storageResource2 = list.get(1); + KeyResource storageResource1 = list.get(0); + KeyResource storageResource2 = list.get(1); Assert.assertFalse(storageResource2.isDirectory()); Assert.assertTrue(storageResource2.isPrivateKey()); Assert.assertEquals("file1.pem", storageResource2.getName()); - Assert.assertEquals("ssh-key/test/example/file1.pem", storageResource2.getPath()); - Assert.assertEquals("http://dignan.local:4440/api/11/storage/ssh-key/test/example/file1.pem", storageResource2.getUrl()); + Assert.assertEquals("keys/test/example/file1.pem", storageResource2.getPath()); + Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file1.pem", storageResource2.getUrl()); Assert.assertNotNull(storageResource2.getMetadata()); Assert.assertEquals("application/octet-stream", storageResource2.getMetadata().get("Rundeck-content-type")); - Assert.assertEquals("private", storageResource2.getMetadata().get("Rundeck-ssh-key-type")); + Assert.assertEquals("private", storageResource2.getMetadata().get("Rundeck-key-type")); Assert.assertFalse(storageResource1.isDirectory()); Assert.assertFalse(storageResource1.isPrivateKey()); Assert.assertEquals("file2.pub", storageResource1.getName()); - Assert.assertEquals("ssh-key/test/example/file2.pub", storageResource1.getPath()); - Assert.assertEquals("http://dignan.local:4440/api/11/storage/ssh-key/test/example/file2.pub", + Assert.assertEquals("keys/test/example/file2.pub", storageResource1.getPath()); + Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file2.pub", storageResource1.getUrl()); Assert.assertNotNull(storageResource1.getMetadata()); Assert.assertEquals("application/pgp-keys", storageResource1.getMetadata().get("Rundeck-content-type")); - Assert.assertEquals("public", storageResource1.getMetadata().get("Rundeck-ssh-key-type")); + Assert.assertEquals("public", storageResource1.getMetadata().get("Rundeck-key-type")); } /** * list root */ @Test - @Betamax(tape = "ssh_key_list_root", mode = TapeMode.READ_ONLY) - public void listSshKeyDirectoryRoot() throws Exception { + @Betamax(tape = "key_list_root", mode = TapeMode.READ_ONLY) + public void listKeyDirectoryRoot() throws Exception { final RundeckClient client = createClient(TEST_TOKEN_7, 11); - List list = client.listSshKeyDirectoryRoot(); + List list = client.listKeyDirectoryRoot(); Assert.assertEquals(2, list.size()); - SSHKeyResource storageResource0 = list.get(0); - SSHKeyResource storageResource1 = list.get(1); + KeyResource storageResource0 = list.get(0); + KeyResource storageResource1 = list.get(1); Assert.assertFalse(storageResource0.isDirectory()); Assert.assertTrue(storageResource0.isPrivateKey()); Assert.assertEquals("test1.pem", storageResource0.getName()); - Assert.assertEquals("ssh-key/test1.pem", storageResource0.getPath()); - Assert.assertEquals("http://dignan.local:4440/api/11/storage/ssh-key/test1.pem", storageResource0.getUrl()); + Assert.assertEquals("keys/test1.pem", storageResource0.getPath()); + Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test1.pem", storageResource0.getUrl()); Assert.assertNotNull(storageResource0.getMetadata()); Assert.assertEquals("application/octet-stream", storageResource0.getMetadata().get("Rundeck-content-type")); - Assert.assertEquals("private", storageResource0.getMetadata().get("Rundeck-ssh-key-type")); + Assert.assertEquals("private", storageResource0.getMetadata().get("Rundeck-key-type")); Assert.assertTrue(storageResource1.toString(), storageResource1.isDirectory()); Assert.assertEquals(null, storageResource1.getName()); - Assert.assertEquals("ssh-key/test", storageResource1.getPath()); - Assert.assertEquals("http://dignan.local:4440/api/11/storage/ssh-key/test", + Assert.assertEquals("keys/test", storageResource1.getPath()); + Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test", storageResource1.getUrl()); Assert.assertNull(storageResource1.getMetadata()); @@ -1477,13 +1477,13 @@ public class RundeckClientTest { * delete ssh key */ @Test - @Betamax(tape = "ssh_key_delete", mode = TapeMode.READ_ONLY) - public void deleteSshKey() throws Exception { + @Betamax(tape = "key_delete", mode = TapeMode.READ_ONLY) + public void deleteKey() throws Exception { final RundeckClient client = createClient(TEST_TOKEN_7, 11); - client.deleteSshKey("ssh-key/test/example/file2.pub"); + client.deleteKey("keys/test/example/file2.pub"); try { - client.getSshKey("ssh-key/test/example/file2.pub"); + client.getKey("keys/test/example/file2.pub"); Assert.fail("expected failure"); } catch (RundeckApiException.RundeckApiHttpStatusException e) { Assert.assertEquals(404,e.getStatusCode()); diff --git a/src/test/resources/betamax/tapes/ssh_key_delete.yaml b/src/test/resources/betamax/tapes/key_delete.yaml similarity index 86% rename from src/test/resources/betamax/tapes/ssh_key_delete.yaml rename to src/test/resources/betamax/tapes/key_delete.yaml index fd46eae..b52ed7f 100644 --- a/src/test/resources/betamax/tapes/ssh_key_delete.yaml +++ b/src/test/resources/betamax/tapes/key_delete.yaml @@ -4,7 +4,7 @@ interactions: - recorded: 2014-04-04T23:16:02.256Z request: method: DELETE - uri: http://rundeck.local:4440/api/11/storage/ssh-key/test/example/file2.pub + uri: http://rundeck.local:4440/api/11/storage/keys/test/example/file2.pub headers: Host: rundeck.local:4440 Proxy-Connection: Keep-Alive @@ -20,7 +20,7 @@ interactions: - recorded: 2014-04-04T23:16:02.372Z request: method: GET - uri: http://rundeck.local:4440/api/11/storage/ssh-key/test/example/file2.pub + uri: http://rundeck.local:4440/api/11/storage/keys/test/example/file2.pub headers: Accept: text/xml Host: rundeck.local:4440 diff --git a/src/test/resources/betamax/tapes/ssh_key_get_data_private.yaml b/src/test/resources/betamax/tapes/key_get_data_private.yaml similarity index 54% rename from src/test/resources/betamax/tapes/ssh_key_get_data_private.yaml rename to src/test/resources/betamax/tapes/key_get_data_private.yaml index e5e742b..ef0f58f 100644 --- a/src/test/resources/betamax/tapes/ssh_key_get_data_private.yaml +++ b/src/test/resources/betamax/tapes/key_get_data_private.yaml @@ -4,7 +4,7 @@ interactions: - recorded: 2014-04-04T19:50:59.155Z request: method: GET - uri: http://rundeck.local:4440/api/11/storage/ssh-key/test/example/file1.pem + uri: http://rundeck.local:4440/api/11/storage/keys/test/example/file1.pem headers: Accept: application/pgp-keys Host: rundeck.local:4440 @@ -19,4 +19,5 @@ interactions: Server: Jetty(7.6.0.v20120127) Set-Cookie: JSESSIONID=1gzu37lkjr0fitxhf5fgkgsfu;Path=/ body: !!binary |- - eyJwYXRoIjoic3NoLWtleS90ZXN0L2V4YW1wbGUvZmlsZTEucGVtIiwidHlwZSI6ImZpbGUiLCJuYW1lIjoiZmlsZTEucGVtIiwidXJsIjoiaHR0cDovL2RpZ25hbi5sb2NhbDo0NDQwL2FwaS8xMS9zdG9yYWdlL3NzaC1rZXkvdGVzdC9leGFtcGxlL2ZpbGUxLnBlbSIsIm1ldGEiOnsiUnVuZGVjay1jb250ZW50LXR5cGUiOiJhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0iLCJSdW5kZWNrLWNvbnRlbnQtc2l6ZSI6IjUiLCJSdW5kZWNrLWNvbnRlbnQtbWFzayI6ImNvbnRlbnQiLCJSdW5kZWNrLXNzaC1rZXktdHlwZSI6InByaXZhdGUifX0= + eyJwYXRoIjoia2V5cy90ZXN0L2V4YW1wbGUvZmlsZTEucGVtIiwidHlwZSI6ImZpbGUiLCJuYW1lIjoiZmlsZTEucGVtIiwidXJsIjoiaHR0cDovL2RpZ25hbi5sb2NhbDo0NDQwL2FwaS8xMS9zdG9yYWdlL2tleXMvdGVzdC9leGFtcGxlL2ZpbGUxLnBlbSIsIm1ldGEiOnsiUnVuZGVjay1jb250ZW50LXR5cGUiOiJhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0iLCJSdW5kZWNrLWNvbnRlbnQtc2l6ZSI6IjUiLCJSdW5kZWNrLWNvbnRlbnQtbWFzayI6ImNvbnRlbnQiLCJSdW5kZWNrLWtleS10eXBlIjoicHJpdmF0ZSJ9fQo= + diff --git a/src/test/resources/betamax/tapes/ssh_key_get_data_public.yaml b/src/test/resources/betamax/tapes/key_get_data_public.yaml similarity index 88% rename from src/test/resources/betamax/tapes/ssh_key_get_data_public.yaml rename to src/test/resources/betamax/tapes/key_get_data_public.yaml index 1874e71..054599f 100644 --- a/src/test/resources/betamax/tapes/ssh_key_get_data_public.yaml +++ b/src/test/resources/betamax/tapes/key_get_data_public.yaml @@ -4,7 +4,7 @@ interactions: - recorded: 2014-04-04T20:20:44.331Z request: method: GET - uri: http://rundeck.local:4440/api/11/storage/ssh-key/test/example/file2.pub + uri: http://rundeck.local:4440/api/11/storage/keys/test/example/file2.pub headers: Accept: application/pgp-keys Host: rundeck.local:4440 diff --git a/src/test/resources/betamax/tapes/key_get_private.yaml b/src/test/resources/betamax/tapes/key_get_private.yaml new file mode 100644 index 0000000..57802a8 --- /dev/null +++ b/src/test/resources/betamax/tapes/key_get_private.yaml @@ -0,0 +1,23 @@ +!tape +name: ssh_key_get_private +interactions: +- recorded: 2014-04-04T19:47:29.880Z + request: + method: GET + uri: http://rundeck.local:4440/api/11/storage/keys/test/example/file1.pem + headers: + Accept: text/xml + Host: rundeck.local:4440 + Proxy-Connection: Keep-Alive + User-Agent: RunDeck API Java Client 11 + X-RunDeck-Auth-Token: 8Dp9op111ER6opsDRkddvE86K9sE499s + response: + status: 200 + headers: + Content-Type: application/xml;charset=utf-8 + Expires: Thu, 01 Jan 1970 00:00:00 GMT + Server: Jetty(7.6.0.v20120127) + Set-Cookie: JSESSIONID=nc5p0he3nw19e4gegidc4bs7;Path=/ + body: !!binary |- + PHJlc291cmNlIHBhdGg9J2tleXMvdGVzdC9leGFtcGxlL2ZpbGUxLnBlbScgdHlwZT0nZmlsZScgdXJsPSdodHRwOi8vZGlnbmFuLmxvY2FsOjQ0NDAvYXBpLzExL3N0b3JhZ2Uva2V5cy90ZXN0L2V4YW1wbGUvZmlsZTEucGVtJyBuYW1lPSdmaWxlMS5wZW0nPjxyZXNvdXJjZS1tZXRhPjxSdW5kZWNrLWNvbnRlbnQtdHlwZT5hcHBsaWNhdGlvbi9vY3RldC1zdHJlYW08L1J1bmRlY2stY29udGVudC10eXBlPjxSdW5kZWNrLWNvbnRlbnQtc2l6ZT41PC9SdW5kZWNrLWNvbnRlbnQtc2l6ZT48UnVuZGVjay1jb250ZW50LW1hc2s+Y29udGVudDwvUnVuZGVjay1jb250ZW50LW1hc2s+PFJ1bmRlY2sta2V5LXR5cGU+cHJpdmF0ZTwvUnVuZGVjay1rZXktdHlwZT48L3Jlc291cmNlLW1ldGE+PC9yZXNvdXJjZT4K + diff --git a/src/test/resources/betamax/tapes/ssh_key_get_public.yaml b/src/test/resources/betamax/tapes/key_get_public.yaml similarity index 50% rename from src/test/resources/betamax/tapes/ssh_key_get_public.yaml rename to src/test/resources/betamax/tapes/key_get_public.yaml index 8bede8d..32c2510 100644 --- a/src/test/resources/betamax/tapes/ssh_key_get_public.yaml +++ b/src/test/resources/betamax/tapes/key_get_public.yaml @@ -4,7 +4,7 @@ interactions: - recorded: 2014-04-04T19:47:29.626Z request: method: GET - uri: http://rundeck.local:4440/api/11/storage/ssh-key/test/example/file2.pub + uri: http://rundeck.local:4440/api/11/storage/keys/test/example/file2.pub headers: Accept: text/xml Host: rundeck.local:4440 @@ -19,4 +19,5 @@ interactions: Server: Jetty(7.6.0.v20120127) Set-Cookie: JSESSIONID=r6p6fl87ftrb1mkwwi0pcak5i;Path=/ body: !!binary |- - PHJlc291cmNlIHBhdGg9J3NzaC1rZXkvdGVzdC9leGFtcGxlL2ZpbGUyLnB1YicgdHlwZT0nZmlsZScgdXJsPSdodHRwOi8vZGlnbmFuLmxvY2FsOjQ0NDAvYXBpLzExL3N0b3JhZ2Uvc3NoLWtleS90ZXN0L2V4YW1wbGUvZmlsZTIucHViJyBuYW1lPSdmaWxlMi5wdWInPjxyZXNvdXJjZS1tZXRhPjxSdW5kZWNrLWNvbnRlbnQtdHlwZT5hcHBsaWNhdGlvbi9wZ3Ata2V5czwvUnVuZGVjay1jb250ZW50LXR5cGU+PFJ1bmRlY2stY29udGVudC1zaXplPjU8L1J1bmRlY2stY29udGVudC1zaXplPjxSdW5kZWNrLXNzaC1rZXktdHlwZT5wdWJsaWM8L1J1bmRlY2stc3NoLWtleS10eXBlPjwvcmVzb3VyY2UtbWV0YT48L3Jlc291cmNlPg== + PHJlc291cmNlIHBhdGg9J2tleXMvdGVzdC9leGFtcGxlL2ZpbGUyLnB1YicgdHlwZT0nZmlsZScgdXJsPSdodHRwOi8vZGlnbmFuLmxvY2FsOjQ0NDAvYXBpLzExL3N0b3JhZ2Uva2V5cy90ZXN0L2V4YW1wbGUvZmlsZTIucHViJyBuYW1lPSdmaWxlMi5wdWInPjxyZXNvdXJjZS1tZXRhPjxSdW5kZWNrLWNvbnRlbnQtdHlwZT5hcHBsaWNhdGlvbi9wZ3Ata2V5czwvUnVuZGVjay1jb250ZW50LXR5cGU+PFJ1bmRlY2stY29udGVudC1zaXplPjU8L1J1bmRlY2stY29udGVudC1zaXplPjxSdW5kZWNrLWtleS10eXBlPnB1YmxpYzwvUnVuZGVjay1rZXktdHlwZT48L3Jlc291cmNlLW1ldGE+PC9yZXNvdXJjZT4N + diff --git a/src/test/resources/betamax/tapes/key_list_directory.yaml b/src/test/resources/betamax/tapes/key_list_directory.yaml new file mode 100644 index 0000000..fb4c6f6 --- /dev/null +++ b/src/test/resources/betamax/tapes/key_list_directory.yaml @@ -0,0 +1,21 @@ +!tape +name: key_list_directory +interactions: +- recorded: 2014-04-04T20:33:07.968Z + request: + method: GET + uri: http://rundeck.local:4440/api/11/storage/keys/test/example + headers: + Accept: text/xml + Host: rundeck.local:4440 + Proxy-Connection: Keep-Alive + User-Agent: RunDeck API Java Client 11 + X-RunDeck-Auth-Token: 8Dp9op111ER6opsDRkddvE86K9sE499s + response: + status: 200 + headers: + Content-Type: text/html;charset=UTF-8 + Expires: Thu, 01 Jan 1970 00:00:00 GMT + Server: Jetty(7.6.0.v20120127) + Set-Cookie: JSESSIONID=1stwtoatsosy91ca0gcrzde698;Path=/ + body: application/pgp-keys5publicapplication/octet-stream5contentprivate diff --git a/src/test/resources/betamax/tapes/key_list_root.yaml b/src/test/resources/betamax/tapes/key_list_root.yaml new file mode 100644 index 0000000..b040c3e --- /dev/null +++ b/src/test/resources/betamax/tapes/key_list_root.yaml @@ -0,0 +1,21 @@ +!tape +name: key_list_root +interactions: +- recorded: 2014-04-04T20:41:16.501Z + request: + method: GET + uri: http://rundeck.local:4440/api/11/storage/keys/ + headers: + Accept: text/xml + Host: rundeck.local:4440 + Proxy-Connection: Keep-Alive + User-Agent: RunDeck API Java Client 11 + X-RunDeck-Auth-Token: 8Dp9op111ER6opsDRkddvE86K9sE499s + response: + status: 200 + headers: + Content-Type: text/html;charset=UTF-8 + Expires: Thu, 01 Jan 1970 00:00:00 GMT + Server: Jetty(7.6.0.v20120127) + Set-Cookie: JSESSIONID=5sj36vytg4y1182mziim4868b;Path=/ + body: application/octet-stream1679contentprivate diff --git a/src/test/resources/betamax/tapes/ssh_key_store_private.yaml b/src/test/resources/betamax/tapes/key_store_private.yaml similarity index 50% rename from src/test/resources/betamax/tapes/ssh_key_store_private.yaml rename to src/test/resources/betamax/tapes/key_store_private.yaml index 6ef2def..1a5d0b0 100644 --- a/src/test/resources/betamax/tapes/ssh_key_store_private.yaml +++ b/src/test/resources/betamax/tapes/key_store_private.yaml @@ -4,7 +4,7 @@ interactions: - recorded: 2014-04-04T19:30:35.367Z request: method: POST - uri: http://rundeck.local:4440/api/11/storage/ssh-key/test/example/file1.pem + uri: http://rundeck.local:4440/api/11/storage/keys/test/example/file1.pem headers: Accept: text/xml Content-Length: '5' @@ -22,4 +22,5 @@ interactions: Server: Jetty(7.6.0.v20120127) Set-Cookie: JSESSIONID=ktmwc4h53xfud6v2ch67x5p9;Path=/ body: !!binary |- - PHJlc291cmNlIHBhdGg9J3NzaC1rZXkvdGVzdC9leGFtcGxlL2ZpbGUxLnBlbScgdHlwZT0nZmlsZScgdXJsPSdodHRwOi8vZGlnbmFuLmxvY2FsOjQ0NDAvYXBpLzExL3N0b3JhZ2Uvc3NoLWtleS90ZXN0L2V4YW1wbGUvZmlsZTEucGVtJyBuYW1lPSdmaWxlMS5wZW0nPjxyZXNvdXJjZS1tZXRhPjxSdW5kZWNrLWNvbnRlbnQtdHlwZT5hcHBsaWNhdGlvbi9vY3RldC1zdHJlYW08L1J1bmRlY2stY29udGVudC10eXBlPjxSdW5kZWNrLWNvbnRlbnQtc2l6ZT41PC9SdW5kZWNrLWNvbnRlbnQtc2l6ZT48UnVuZGVjay1jb250ZW50LW1hc2s+Y29udGVudDwvUnVuZGVjay1jb250ZW50LW1hc2s+PFJ1bmRlY2stc3NoLWtleS10eXBlPnByaXZhdGU8L1J1bmRlY2stc3NoLWtleS10eXBlPjwvcmVzb3VyY2UtbWV0YT48L3Jlc291cmNlPg== + PHJlc291cmNlIHBhdGg9J2tleXMvdGVzdC9leGFtcGxlL2ZpbGUxLnBlbScgdHlwZT0nZmlsZScgdXJsPSdodHRwOi8vZGlnbmFuLmxvY2FsOjQ0NDAvYXBpLzExL3N0b3JhZ2Uva2V5cy90ZXN0L2V4YW1wbGUvZmlsZTEucGVtJyBuYW1lPSdmaWxlMS5wZW0nPjxyZXNvdXJjZS1tZXRhPjxSdW5kZWNrLWNvbnRlbnQtdHlwZT5hcHBsaWNhdGlvbi9vY3RldC1zdHJlYW08L1J1bmRlY2stY29udGVudC10eXBlPjxSdW5kZWNrLWNvbnRlbnQtc2l6ZT41PC9SdW5kZWNrLWNvbnRlbnQtc2l6ZT48UnVuZGVjay1jb250ZW50LW1hc2s+Y29udGVudDwvUnVuZGVjay1jb250ZW50LW1hc2s+PFJ1bmRlY2sta2V5LXR5cGU+cHJpdmF0ZTwvUnVuZGVjay1rZXktdHlwZT48L3Jlc291cmNlLW1ldGE+PC9yZXNvdXJjZT4N + diff --git a/src/test/resources/betamax/tapes/ssh_key_store_public.yaml b/src/test/resources/betamax/tapes/key_store_public.yaml similarity index 53% rename from src/test/resources/betamax/tapes/ssh_key_store_public.yaml rename to src/test/resources/betamax/tapes/key_store_public.yaml index 8a1b18a..fdd7638 100644 --- a/src/test/resources/betamax/tapes/ssh_key_store_public.yaml +++ b/src/test/resources/betamax/tapes/key_store_public.yaml @@ -4,7 +4,7 @@ interactions: - recorded: 2014-04-04T19:34:02.683Z request: method: POST - uri: http://rundeck.local:4440/api/11/storage/ssh-key/test/example/file2.pub + uri: http://rundeck.local:4440/api/11/storage/keys/test/example/file2.pub headers: Accept: text/xml Content-Length: '5' @@ -22,4 +22,5 @@ interactions: Server: Jetty(7.6.0.v20120127) Set-Cookie: JSESSIONID=2l3g8m0tvwef19jn2bu23bzk6;Path=/ body: !!binary |- - PHJlc291cmNlIHBhdGg9J3NzaC1rZXkvdGVzdC9leGFtcGxlL2ZpbGUyLnB1YicgdHlwZT0nZmlsZScgdXJsPSdodHRwOi8vZGlnbmFuLmxvY2FsOjQ0NDAvYXBpLzExL3N0b3JhZ2Uvc3NoLWtleS90ZXN0L2V4YW1wbGUvZmlsZTIucHViJyBuYW1lPSdmaWxlMi5wdWInPjxyZXNvdXJjZS1tZXRhPjxSdW5kZWNrLWNvbnRlbnQtdHlwZT5hcHBsaWNhdGlvbi9wZ3Ata2V5czwvUnVuZGVjay1jb250ZW50LXR5cGU+PFJ1bmRlY2stY29udGVudC1zaXplPjU8L1J1bmRlY2stY29udGVudC1zaXplPjxSdW5kZWNrLXNzaC1rZXktdHlwZT5wdWJsaWM8L1J1bmRlY2stc3NoLWtleS10eXBlPjwvcmVzb3VyY2UtbWV0YT48L3Jlc291cmNlPg== + PHJlc291cmNlIHBhdGg9J2tleXMvdGVzdC9leGFtcGxlL2ZpbGUyLnB1YicgdHlwZT0nZmlsZScgdXJsPSdodHRwOi8vZGlnbmFuLmxvY2FsOjQ0NDAvYXBpLzExL3N0b3JhZ2Uva2V5cy90ZXN0L2V4YW1wbGUvZmlsZTIucHViJyBuYW1lPSdmaWxlMi5wdWInPjxyZXNvdXJjZS1tZXRhPjxSdW5kZWNrLWNvbnRlbnQtdHlwZT5hcHBsaWNhdGlvbi9wZ3Ata2V5czwvUnVuZGVjay1jb250ZW50LXR5cGU+PFJ1bmRlY2stY29udGVudC1zaXplPjU8L1J1bmRlY2stY29udGVudC1zaXplPjxSdW5kZWNrLWtleS10eXBlPnB1YmxpYzwvUnVuZGVjay1rZXktdHlwZT48L3Jlc291cmNlLW1ldGE+PC9yZXNvdXJjZT4K + diff --git a/src/test/resources/betamax/tapes/ssh_key_get_private.yaml b/src/test/resources/betamax/tapes/ssh_key_get_private.yaml deleted file mode 100644 index fa0ff2c..0000000 --- a/src/test/resources/betamax/tapes/ssh_key_get_private.yaml +++ /dev/null @@ -1,22 +0,0 @@ -!tape -name: ssh_key_get_private -interactions: -- recorded: 2014-04-04T19:47:29.880Z - request: - method: GET - uri: http://rundeck.local:4440/api/11/storage/ssh-key/test/example/file1.pem - headers: - Accept: text/xml - Host: rundeck.local:4440 - Proxy-Connection: Keep-Alive - User-Agent: RunDeck API Java Client 11 - X-RunDeck-Auth-Token: 8Dp9op111ER6opsDRkddvE86K9sE499s - response: - status: 200 - headers: - Content-Type: application/xml;charset=utf-8 - Expires: Thu, 01 Jan 1970 00:00:00 GMT - Server: Jetty(7.6.0.v20120127) - Set-Cookie: JSESSIONID=nc5p0he3nw19e4gegidc4bs7;Path=/ - body: !!binary |- - PHJlc291cmNlIHBhdGg9J3NzaC1rZXkvdGVzdC9leGFtcGxlL2ZpbGUxLnBlbScgdHlwZT0nZmlsZScgdXJsPSdodHRwOi8vZGlnbmFuLmxvY2FsOjQ0NDAvYXBpLzExL3N0b3JhZ2Uvc3NoLWtleS90ZXN0L2V4YW1wbGUvZmlsZTEucGVtJyBuYW1lPSdmaWxlMS5wZW0nPjxyZXNvdXJjZS1tZXRhPjxSdW5kZWNrLWNvbnRlbnQtdHlwZT5hcHBsaWNhdGlvbi9vY3RldC1zdHJlYW08L1J1bmRlY2stY29udGVudC10eXBlPjxSdW5kZWNrLWNvbnRlbnQtc2l6ZT41PC9SdW5kZWNrLWNvbnRlbnQtc2l6ZT48UnVuZGVjay1jb250ZW50LW1hc2s+Y29udGVudDwvUnVuZGVjay1jb250ZW50LW1hc2s+PFJ1bmRlY2stc3NoLWtleS10eXBlPnByaXZhdGU8L1J1bmRlY2stc3NoLWtleS10eXBlPjwvcmVzb3VyY2UtbWV0YT48L3Jlc291cmNlPg== diff --git a/src/test/resources/betamax/tapes/ssh_key_list_directory.yaml b/src/test/resources/betamax/tapes/ssh_key_list_directory.yaml deleted file mode 100644 index e49f941..0000000 --- a/src/test/resources/betamax/tapes/ssh_key_list_directory.yaml +++ /dev/null @@ -1,21 +0,0 @@ -!tape -name: ssh_key_list_directory -interactions: -- recorded: 2014-04-04T20:33:07.968Z - request: - method: GET - uri: http://rundeck.local:4440/api/11/storage/ssh-key/test/example - headers: - Accept: text/xml - Host: rundeck.local:4440 - Proxy-Connection: Keep-Alive - User-Agent: RunDeck API Java Client 11 - X-RunDeck-Auth-Token: 8Dp9op111ER6opsDRkddvE86K9sE499s - response: - status: 200 - headers: - Content-Type: text/html;charset=UTF-8 - Expires: Thu, 01 Jan 1970 00:00:00 GMT - Server: Jetty(7.6.0.v20120127) - Set-Cookie: JSESSIONID=1stwtoatsosy91ca0gcrzde698;Path=/ - body: application/pgp-keys5publicapplication/octet-stream5contentprivate diff --git a/src/test/resources/betamax/tapes/ssh_key_list_root.yaml b/src/test/resources/betamax/tapes/ssh_key_list_root.yaml deleted file mode 100644 index dcefe5e..0000000 --- a/src/test/resources/betamax/tapes/ssh_key_list_root.yaml +++ /dev/null @@ -1,21 +0,0 @@ -!tape -name: ssh_key_list_root -interactions: -- recorded: 2014-04-04T20:41:16.501Z - request: - method: GET - uri: http://rundeck.local:4440/api/11/storage/ssh-key/ - headers: - Accept: text/xml - Host: rundeck.local:4440 - Proxy-Connection: Keep-Alive - User-Agent: RunDeck API Java Client 11 - X-RunDeck-Auth-Token: 8Dp9op111ER6opsDRkddvE86K9sE499s - response: - status: 200 - headers: - Content-Type: text/html;charset=UTF-8 - Expires: Thu, 01 Jan 1970 00:00:00 GMT - Server: Jetty(7.6.0.v20120127) - Set-Cookie: JSESSIONID=5sj36vytg4y1182mziim4868b;Path=/ - body: application/octet-stream1679contentprivate