usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [11/50] [abbrv] git commit: Added a todo for admin authentication. Removed useless payload test code. Removed instances of s3_token and replaced with name admin token instead. Created a todo for global filenames, where global filenames are not needed.
Date Tue, 25 Feb 2014 06:21:25 GMT
Added a todo for admin authentication.
Removed useless payload test code.
Removed instances of s3_token and replaced with name admin token instead.
Created a todo for global filenames, where global filenames are not needed.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/66040615
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/66040615
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/66040615

Branch: refs/pull/60/head
Commit: 66040615c3407dafc85cd35d96aa8b9c3d3e8811
Parents: 75ccff1
Author: GERey <greyes@apigee.com>
Authored: Thu Feb 6 11:42:08 2014 -0800
Committer: GERey <greyes@apigee.com>
Committed: Thu Feb 6 11:42:08 2014 -0800

----------------------------------------------------------------------
 .../rest/management/ManagementResource.java     |  2 +-
 .../rest/management/ManagementResourceIT.java   | 36 ++------------------
 .../org/usergrid/management/ExportInfo.java     |  6 ++--
 .../management/export/ExportServiceImpl.java    |  1 +
 4 files changed, 7 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/66040615/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java
b/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java
index f6c66da..b2e6d36 100644
--- a/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java
+++ b/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java
@@ -445,7 +445,7 @@ public class ManagementResource extends AbstractContextResource {
         }
     }
     //TODO: url encoded form of export
-
+    //TODO: add authorization.
 
     @POST
     @Path( "export" )

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/66040615/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java
b/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java
index e0d7029..f1563f3 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java
@@ -532,37 +532,13 @@ public class ManagementResourceIT extends AbstractRestIT {
     public void exportCallSuccessful() throws Exception {
         Status responseStatus = Status.ACCEPTED;
         JsonNode node = null;
-                ;
-
-        //        Map<String, String> payload =
-        //                hashMap( "grant_type", "password" ).map( "username", "test@usergrid.com"
).map( "password", "test" )
-        //                                                   .map( "ttl", Long.MAX_VALUE
+ "" );
-       // Map<String, String> storageinfo = hashMap ( "s3_token","insert_token_data_here").map("s3_key","insert_secret_here")
-       //         .map( "bucket_location","insert_bucket_location_here");
-       // Map<String, Object> propertiesPayload = hashMap("storage_provider",(Object)"s3").map("storage_info",storageinfo);
-       // Map<String, Object> payload = hashMap( "path","test-organization/test-app/user");
-        //payload.put( "properties", propertiesPayload );
-        //.map( "properties",propertiesPayload);
-        //problem with payload
-
-        //Map<String,String> altPropertiesPayload = hashMap("storage_provider","s3").map(
"storage_info",
-        //        String.valueOf( storageinfo ) );
-
-        //Map<String, String> payload = hashMap( "path","test-organization/test-app/user");
-       // payload.put( "properties", String.valueOf( propertiesPayload ) );
-
-        //Map<String, Object> payload = new HashMap<String, Object>();
-
-
-        //HashMap<String, Object> payload = new HashMap<String, Object>();
-        //Map<String, Object> properties = new HashMap<String, Object>();
-        //properties.put( "securityLevel", 5 );
 
         HashMap<String, Object> payload = new HashMap<String, Object>();
         Map<String, Object> properties = new HashMap<String, Object>();
         Map<String, Object> storage_info = new HashMap<String, Object>();
+        //TODO: make sure to put a valid admin token here.
+        storage_info.put( "admin_token","insert_token_data_here" );
         //TODO: always put dummy values here and ignore this test.
-        storage_info.put( "s3_token","insert_token_data_here" );
         storage_info.put( "s3_key","insert key here" );
         storage_info.put( "s3_accessId","insert access id here");
         storage_info.put( "bucket_location","insert bucket name here");
@@ -573,14 +549,6 @@ public class ManagementResourceIT extends AbstractRestIT {
         payload.put( "path", "test-organization/test-app/user");
         payload.put( "properties", properties);
 
-
-       // Map<String, String> payload =
-       //         hashMap( "grant_type", "password" ).map( "username", "test@usergrid.com"
).map( "password", "test" );
-
-        //JsonNode node = resource().path( "/management/me" ).accept( MediaType.APPLICATION_JSON
)
-          //                        .type( MediaType.APPLICATION_JSON_TYPE ).post( JsonNode.class,
payload );
-
-
         try {
             node = resource().path( "/management/export" ).accept( MediaType.APPLICATION_JSON
)
                       .type( MediaType.APPLICATION_JSON_TYPE ).post( JsonNode.class, payload
);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/66040615/stack/services/src/main/java/org/usergrid/management/ExportInfo.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/usergrid/management/ExportInfo.java b/stack/services/src/main/java/org/usergrid/management/ExportInfo.java
index e1dfb8e..5dbb771 100644
--- a/stack/services/src/main/java/org/usergrid/management/ExportInfo.java
+++ b/stack/services/src/main/java/org/usergrid/management/ExportInfo.java
@@ -13,7 +13,7 @@ public class ExportInfo {
     private String storage_provider;
     private Map<String, Object> storage_info;
     private String s3_accessId;
-    private String s3_token;
+    private String admin_token;
     private String s3_key;
     private String bucket_location;
 
@@ -23,7 +23,7 @@ public class ExportInfo {
         storage_provider = (String) properties.get ("storage_provider");
         storage_info = (Map) properties.get("storage_info");
         s3_accessId = (String) storage_info.get("s3_accessId");
-        s3_token = (String) storage_info.get("s3_token");
+        admin_token = (String) storage_info.get("admin_token");
         s3_key = (String) storage_info.get("s3_key");
         bucket_location = (String) storage_info.get("bucket_location");
     }
@@ -44,7 +44,7 @@ public class ExportInfo {
 
     public Map<String, Object> getStorage_info () { return storage_info; }
 
-    public String getS3_token () { return s3_token; }
+    public String getAdmin_token () { return admin_token; }
     //TODO: is this a security concern? How would we get rid of the key once we're done with
this value?
     public String getS3_key () { return s3_key; }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/66040615/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java
b/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java
index f980728..b9cacc7 100644
--- a/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java
+++ b/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java
@@ -369,6 +369,7 @@ public class ExportServiceImpl implements ExportService{
         str.append( ".json" );
 
         String outputFileName = str.toString();
+        //TODO:this is , i feel, bad practice so make sure to come back here and fix it up.
         filename = outputFileName;
 
         //logger.info( "Creating output filename:" + outputFileName );


Mime
View raw message