add oauth app connected

This commit is contained in:
lendry
2026-06-26 10:49:34 +03:00
parent d5e6b58955
commit b81c0cedbb
18 changed files with 838 additions and 59 deletions

View File

@@ -6,6 +6,10 @@ service OAuthCoreService {
rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse);
rpc Token (TokenRequest) returns (TokenResponse);
rpc UserInfo (UserInfoRequest) returns (UserInfoResponse);
rpc CheckOAuthConsent (CheckOAuthConsentRequest) returns (CheckOAuthConsentResponse);
rpc GrantOAuthConsent (GrantOAuthConsentRequest) returns (GrantOAuthConsentResponse);
rpc ListUserOAuthConsents (UserIdRequest) returns (ListUserOAuthConsentsResponse);
rpc RevokeOAuthConsent (RevokeOAuthConsentRequest) returns (MutationResponse);
}
service OtpService {
@@ -45,6 +49,7 @@ message AuthorizeRequest {
string scope = 4;
optional string state = 5;
optional string nonce = 6;
optional bool grantConsent = 7;
}
message AuthorizeResponse {
@@ -86,6 +91,57 @@ message UserInfoResponse {
optional bool phone_number_verified = 9;
}
message OAuthScopeInfo {
string slug = 1;
string name = 2;
optional string description = 3;
}
message OAuthClientPublicInfo {
string clientId = 1;
string name = 2;
}
message CheckOAuthConsentRequest {
string userId = 1;
string clientId = 2;
string scope = 3;
}
message CheckOAuthConsentResponse {
bool granted = 1;
OAuthClientPublicInfo client = 2;
repeated OAuthScopeInfo requestedScopes = 3;
}
message GrantOAuthConsentRequest {
string userId = 1;
string clientId = 2;
string scope = 3;
}
message GrantOAuthConsentResponse {
bool granted = 1;
}
message UserOAuthConsentItem {
string id = 1;
string clientId = 2;
string clientName = 3;
repeated OAuthScopeInfo scopes = 4;
string grantedAt = 5;
string updatedAt = 6;
}
message ListUserOAuthConsentsResponse {
repeated UserOAuthConsentItem consents = 1;
}
message RevokeOAuthConsentRequest {
string userId = 1;
string consentId = 2;
}
message SendOtpRequest {
string target = 1;
string channel = 2;