mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
921 B
Protocol Buffer
43 lines
921 B
Protocol Buffer
2 years ago
|
syntax = "proto3";
|
||
|
option go_package = ".;providerpb";
|
||
|
|
||
|
package proto;
|
||
|
|
||
|
message InitReq {
|
||
|
string client_id = 1;
|
||
|
string client_secret = 2;
|
||
|
string redirect_url = 3;
|
||
|
}
|
||
|
|
||
|
message GetTokenReq { string code = 1; }
|
||
|
|
||
|
message Token {
|
||
|
string access_token = 1;
|
||
|
string token_type = 2;
|
||
|
string refresh_token = 3;
|
||
|
int64 expiry = 4;
|
||
|
}
|
||
|
|
||
|
message ProviderResp { string name = 1; }
|
||
|
|
||
|
message NewAuthURLReq { string state = 1; }
|
||
|
|
||
|
message NewAuthURLResp { string url = 1; }
|
||
|
|
||
|
message GetUserInfoReq { Token token = 1; }
|
||
|
|
||
|
message GetUserInfoResp {
|
||
|
string username = 1;
|
||
|
uint64 provider_user_id = 2;
|
||
|
Token token_refreshed = 3;
|
||
|
}
|
||
|
|
||
|
message Enpty {}
|
||
|
|
||
|
service Oauth2Plugin {
|
||
|
rpc Init(InitReq) returns (Enpty) {}
|
||
|
rpc Provider(Enpty) returns (ProviderResp) {}
|
||
|
rpc NewAuthURL(NewAuthURLReq) returns (NewAuthURLResp) {}
|
||
|
rpc GetToken(GetTokenReq) returns (Token) {}
|
||
|
rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoResp) {}
|
||
|
}
|