-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a91446
commit b28e684
Showing
7 changed files
with
323 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
syntax = "proto3"; | ||
|
||
package spotify.clienttoken.http.v0; | ||
|
||
import "connectivity.proto"; | ||
|
||
option optimize_for = CODE_SIZE; | ||
option java_package = "com.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 { | ||
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
syntax = "proto3"; | ||
|
||
package spotify.clienttoken.data.v0; | ||
|
||
option optimize_for = CODE_SIZE; | ||
option java_package = "com.spotify.clienttoken.data.v0"; | ||
|
||
message ConnectivitySdkData { | ||
PlatformSpecificData platform_specific_data = 1; | ||
string device_id = 2; | ||
} | ||
|
||
message PlatformSpecificData { | ||
oneof data { | ||
NativeAndroidData android = 1; | ||
NativeIOSData ios = 2; | ||
NativeWindowsData windows = 4; | ||
} | ||
} | ||
|
||
message NativeAndroidData { | ||
int32 major_sdk_version = 1; | ||
int32 minor_sdk_version = 2; | ||
int32 patch_sdk_version = 3; | ||
uint32 api_version = 4; | ||
Screen screen_dimensions = 5; | ||
} | ||
|
||
message NativeIOSData { | ||
int32 user_interface_idiom = 1; | ||
bool target_iphone_simulator = 2; | ||
string hw_machine = 3; | ||
string system_version = 4; | ||
string simulator_model_identifier = 5; | ||
} | ||
|
||
message NativeWindowsData { | ||
int32 something1 = 1; | ||
int32 something3 = 3; | ||
int32 something4 = 4; | ||
int32 something6 = 6; | ||
int32 something7 = 7; | ||
int32 something8 = 8; | ||
bool something10 = 10; | ||
} | ||
|
||
message Screen { | ||
int32 width = 1; | ||
int32 height = 2; | ||
int32 density = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters