summaryrefslogtreecommitdiffstats
path: root/src/main/thrift/imagemaster.thrift
blob: 7c5907912504c49e3308ebb42a26428114b89cc2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
 * Define some namespace/package name for our stuff
 */

namespace java org.openslx.imagemaster.thrift.iface
namespace php testing

typedef string ID
typedef string Token

enum AuthorizationError {
	GENERIC_ERROR,
	NOT_AUTHENTICATED,
	NO_PERMISSION
}

enum AuthenticationError {
	GENERIC_ERROR,
	INVALID_CREDENTIALS,
	ACCOUNT_SUSPENDED,
	BANNED_NETWORK
}

exception AuthorizationException {
	1: AuthorizationError number,
	2: string message
}

exception AuthenticationException {
	1: AuthenticationError number,
	2: string message
}

exception InvalidTokenException {
}

struct UserInfo {
	1: string userId,
	2: string firstName,
	3: string lastName,
	4: string eMail
}

struct SessionData {
	1: ID sessionId,
	2: Token authToken,
	3: string serverAddress
}

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)

}