mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
User ease of use
Make email retrieveable client-facing
This commit is contained in:
parent
dc3d233711
commit
0b85980d2a
@ -1,6 +1,7 @@
|
|||||||
import com.amazonaws.services.lambda.AWSLambdaClientBuilder;
|
import com.amazonaws.services.lambda.AWSLambdaClientBuilder;
|
||||||
import com.amazonaws.services.lambda.model.InvokeRequest;
|
import com.amazonaws.services.lambda.model.InvokeRequest;
|
||||||
import com.amazonaws.services.lambda.model.InvokeResult;
|
import com.amazonaws.services.lambda.model.InvokeResult;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
import java.security.AccessControlException;
|
import java.security.AccessControlException;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
@ -56,7 +57,7 @@ public class ListSharer implements CallHandler {
|
|||||||
if (invokeResult.getStatusCode() != 200) {
|
if (invokeResult.getStatusCode() != 200) {
|
||||||
throw new InputMismatchException("Could not find specified user to share with");
|
throw new InputMismatchException("Could not find specified user to share with");
|
||||||
}
|
}
|
||||||
String shareWithSub = new String(invokeResult.getPayload().array()).replace("\"", "");
|
String shareWithSub = new Gson().fromJson(new String(invokeResult.getPayload().array()), User.class).cognitoID;
|
||||||
// checkAccess.setString(2, shareWithSub);
|
// checkAccess.setString(2, shareWithSub);
|
||||||
// checkAccessRS = checkAccess.executeQuery();
|
// checkAccessRS = checkAccess.executeQuery();
|
||||||
// if (checkAccessRS.next()) {
|
// if (checkAccessRS.next()) {
|
||||||
|
|||||||
26
Lambdas/Lists/User/src/User.java
Normal file
26
Lambdas/Lists/User/src/User.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
public class User {
|
||||||
|
String cognitoID;
|
||||||
|
String email;
|
||||||
|
|
||||||
|
public User(String cognitoID, String email) {
|
||||||
|
this.cognitoID = cognitoID;
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCognitoID() {
|
||||||
|
return cognitoID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCognitoID(String cognitoID) {
|
||||||
|
this.cognitoID = cognitoID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -66,6 +66,6 @@ public class UserGetter implements CallHandler {
|
|||||||
}
|
}
|
||||||
System.out.println(attribute.getName() + ": " + attribute.getValue());
|
System.out.println(attribute.getName() + ": " + attribute.getValue());
|
||||||
}
|
}
|
||||||
return attributeToReturn;
|
return new User(cognitoID, attributeToReturn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,27 @@
|
|||||||
package com.example.listify.data;
|
package com.example.listify.data;
|
||||||
|
|
||||||
public class User {
|
public class User {
|
||||||
|
String cognitoID;
|
||||||
|
String email;
|
||||||
|
|
||||||
|
public User(String cognitoID, String email) {
|
||||||
|
this.cognitoID = cognitoID;
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCognitoID() {
|
||||||
|
return cognitoID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCognitoID(String cognitoID) {
|
||||||
|
this.cognitoID = cognitoID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user