mirror of
https://github.com/Alexander-D-Karpov/concord.git
synced 2026-03-16 22:04:15 +03:00
90 lines
1.7 KiB
Protocol Buffer
90 lines
1.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package concord.auth.v1;
|
|
|
|
option go_package = "github.com/Alexander-D-Karpov/concord/api/gen/go/auth/v1;authv1";
|
|
|
|
import "google/api/annotations.proto";
|
|
|
|
message LoginPasswordRequest {
|
|
string handle = 1;
|
|
string password = 2;
|
|
}
|
|
|
|
message LoginOAuthRequest {
|
|
string provider = 1;
|
|
string code = 2;
|
|
string redirect_uri = 3;
|
|
}
|
|
|
|
message Token {
|
|
string access_token = 1;
|
|
int64 expires_in = 2;
|
|
string refresh_token = 3;
|
|
string token_type = 4;
|
|
}
|
|
|
|
message RefreshRequest {
|
|
string refresh_token = 1;
|
|
}
|
|
|
|
message LogoutRequest {
|
|
string refresh_token = 1;
|
|
}
|
|
|
|
message OAuthBeginRequest {
|
|
string provider = 1;
|
|
string redirect_uri = 2;
|
|
}
|
|
|
|
message OAuthBeginResponse {
|
|
string auth_url = 1;
|
|
string state = 2;
|
|
}
|
|
|
|
message RegisterRequest {
|
|
string handle = 1;
|
|
string password = 2;
|
|
string display_name = 3;
|
|
}
|
|
|
|
message EmptyResponse {}
|
|
|
|
service AuthService {
|
|
rpc Register(RegisterRequest) returns (Token) {
|
|
option (google.api.http) = {
|
|
post: "/v1/auth/register"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc LoginPassword(LoginPasswordRequest) returns (Token) {
|
|
option (google.api.http) = {
|
|
post: "/v1/auth/login"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc LoginOAuth(LoginOAuthRequest) returns (Token) {
|
|
option (google.api.http) = {
|
|
post: "/v1/auth/oauth"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc OAuthBegin(OAuthBeginRequest) returns (OAuthBeginResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/auth/oauth/begin"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc Refresh(RefreshRequest) returns (Token) {
|
|
option (google.api.http) = {
|
|
post: "/v1/auth/refresh"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc Logout(LogoutRequest) returns (EmptyResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/auth/logout"
|
|
body: "*"
|
|
};
|
|
}
|
|
} |