Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #85 from FultonBrowne/security
Browse files Browse the repository at this point in the history
Security
  • Loading branch information
Fulton Browne committed Feb 16, 2020
2 parents 0c947cf + df33748 commit 8cbca6d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/andromeda/araserver/iot/NewDevice.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class NewDevice {
i.startsWith("user=") -> key = i.replace("user=", "")
else -> throw SecurityException("not a valid set of arguments")
}
if(key.equals("")) throw SecurityException("not a valid user")
val idDB =key+id
DevicesDB().getDB(client, key!!, id!!)
val rm = RegistryManager.createFromConnectionString("HostName=Ara-iot.azure-devices.net;SharedAccessKeyName=registryReadWrite;SharedAccessKey=jCfMMHFTQdud0aBUNy0fzWgmJLEh9T/xe0S4OZ6Xhtg=")
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/andromeda/araserver/pages/UpdateDB.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class UpdateDB {
i.startsWith("prop=") -> prop = i.replace("prop=", "")

}
if(key.equals("")) throw SecurityException("not a valid user")
val dbLink = System.getenv("IOTDB")
val client = DocumentClient("https://ara-account-data.documents.azure.com:443/", dbLink, ConnectionPolicy(), ConsistencyLevel.Session)
update(client, key!!, id!!, prop!!, newVal)
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/andromeda/araserver/util/NewDoc.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class NewDoc {
i.startsWith("user=") -> key = i.replace("user=", "")

}
if(key.equals("")) throw SecurityException("not a valid user")
val dbLink = System.getenv("IOTDB")

newDoc(key!!, newVal!!, id!!)
Expand Down

0 comments on commit 8cbca6d

Please sign in to comment.