forked from devgianlu/go-librespot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclienttoken.proto
124 lines (97 loc) · 2.33 KB
/
clienttoken.proto
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
syntax = "proto3";
package spotify.clienttoken.http.v0;
import "connectivity.proto";
option go_package = "go-librespot/proto/spotify/clienttoken/http/v0";
message ClientTokenRequest {
ClientTokenRequestType request_type = 1;
oneof request {
ClientDataRequest client_data = 2;
ChallengeAnswersRequest challenge_answers = 3;
}
}
message ClientDataRequest {
string client_version = 1;
string client_id = 2;
oneof data {
spotify.clienttoken.data.v0.ConnectivitySdkData connectivity_sdk_data = 3;
}
}
message ChallengeAnswersRequest {
string state = 1;
repeated ChallengeAnswer answers = 2;
}
message ClientTokenResponse {
ClientTokenResponseType response_type = 1;
oneof response {
GrantedTokenResponse granted_token = 2;
ChallengesResponse challenges = 3;
}
}
message TokenDomain {
string domain = 1;
}
message GrantedTokenResponse {
string token = 1;
int32 expires_after_seconds = 2;
int32 refresh_after_seconds = 3;
repeated TokenDomain domains = 4;
}
message ChallengesResponse {
string state = 1;
repeated Challenge challenges = 2;
}
message ClientSecretParameters {
string salt = 1;
}
message EvaluateJSParameters {
string code = 1;
repeated string libraries = 2;
}
message HashCashParameters {
int32 length = 1;
string prefix = 2;
}
message Challenge {
ChallengeType type = 1;
oneof parameters {
ClientSecretParameters client_secret_parameters = 2;
EvaluateJSParameters evaluate_js_parameters = 3;
HashCashParameters evaluate_hashcash_parameters = 4;
}
}
message ClientSecretHMACAnswer {
string hmac = 1;
}
message EvaluateJSAnswer {
string result = 1;
}
message HashCashAnswer {
string suffix = 1;
}
message ChallengeAnswer {
ChallengeType ChallengeType = 1;
oneof answer {
ClientSecretHMACAnswer client_secret = 2;
EvaluateJSAnswer evaluate_js = 3;
HashCashAnswer hash_cash = 4;
}
}
message ClientTokenBadRequest {
string message = 1;
}
enum ClientTokenRequestType {
REQUEST_UNKNOWN = 0;
REQUEST_CLIENT_DATA_REQUEST = 1;
REQUEST_CHALLENGE_ANSWERS_REQUEST = 2;
}
enum ClientTokenResponseType {
RESPONSE_UNKNOWN = 0;
RESPONSE_GRANTED_TOKEN_RESPONSE = 1;
RESPONSE_CHALLENGES_RESPONSE = 2;
}
enum ChallengeType {
CHALLENGE_UNKNOWN = 0;
CHALLENGE_CLIENT_SECRET_HMAC = 1;
CHALLENGE_EVALUATE_JS = 2;
CHALLENGE_HASH_CASH = 3;
}