From 94b81297b37105f376ff3b35cffd8c62d1005c4f Mon Sep 17 00:00:00 2001 From: Nils Schwabe Date: Thu, 10 Apr 2014 10:08:15 +0200 Subject: added new thrift methods: - authentication (for server) - submitImage (for server) --- .../thrift/server/ImageServerHandler.java | 26 ++++++++++++++++++++++ src/main/thrift/imagemaster.thrift | 24 +++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/org/openslx/imagemaster/thrift/server/ImageServerHandler.java b/src/main/java/org/openslx/imagemaster/thrift/server/ImageServerHandler.java index c1d3aa8..dc1b8f1 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/server/ImageServerHandler.java +++ b/src/main/java/org/openslx/imagemaster/thrift/server/ImageServerHandler.java @@ -4,8 +4,12 @@ import org.apache.log4j.Logger; import org.apache.thrift.TException; import org.openslx.imagemaster.server.ApiServer; import org.openslx.imagemaster.thrift.iface.AuthenticationException; +import org.openslx.imagemaster.thrift.iface.AuthorizationException; +import org.openslx.imagemaster.thrift.iface.FtpCredentials; +import org.openslx.imagemaster.thrift.iface.ImageData; import org.openslx.imagemaster.thrift.iface.ImageServer; import org.openslx.imagemaster.thrift.iface.InvalidTokenException; +import org.openslx.imagemaster.thrift.iface.ServerSessionData; import org.openslx.imagemaster.thrift.iface.SessionData; import org.openslx.imagemaster.thrift.iface.UserInfo; @@ -35,4 +39,26 @@ public class ImageServerHandler implements ImageServer.Iface return ApiServer.getUserFromToken( token ); } + @Override + public String startServerAuthentication(String organization) + throws TException { + // TODO Auto-generated method stub + return null; + } + + @Override + public ServerSessionData serverAuthenticate(String organization, + String challengeResponse) throws AuthenticationException, + TException { + // TODO Auto-generated method stub + return null; + } + + @Override + public FtpCredentials submitImage(ImageData imageDescription) + throws AuthorizationException, TException { + // TODO Auto-generated method stub + return null; + } + } diff --git a/src/main/thrift/imagemaster.thrift b/src/main/thrift/imagemaster.thrift index 7c59079..7f50dfc 100644 --- a/src/main/thrift/imagemaster.thrift +++ b/src/main/thrift/imagemaster.thrift @@ -7,6 +7,7 @@ namespace php testing typedef string ID typedef string Token +typedef string UUID enum AuthorizationError { GENERIC_ERROR, @@ -47,13 +48,34 @@ struct SessionData { 3: string serverAddress } +struct FtpCredentials { + 1: string username, + 2: string password +} + +struct ServerSessionData { + 1: ID sessionId +} + +struct ImageData { + 1: UUID uuid, + 2: string imageName + /* other rows */ +} + service ImageServer { bool ping(), SessionData authenticate(1:string username, 2:string password) throws (1:AuthenticationException failure), - UserInfo getUserFromToken(1:Token token) throws (1:InvalidTokenException failure) + UserInfo getUserFromToken(1:Token token) throws (1:InvalidTokenException failure), + + string startServerAuthentication(1:string organization), + + ServerSessionData serverAuthenticate(1:string organization, 2:string challengeResponse) throws (1:AuthenticationException failure), + + FtpCredentials submitImage(1:ImageData imageDescription) throws (1:AuthorizationException failure) } -- cgit v1.2.3-55-g7522