Skip to content
This repository was archived by the owner on Feb 4, 2021. It is now read-only.

Commit 7f9352e

Browse files
committed
Update oauth.proto
1 parent 91a7d80 commit 7f9352e

File tree

7 files changed

+728
-34
lines changed

7 files changed

+728
-34
lines changed

api/oauth.pb.go

Lines changed: 318 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/oauth.pb.gw.go

Lines changed: 96 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/oauth.swagger.json

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,54 @@
1515
"application/json"
1616
],
1717
"paths": {
18+
"/oauth/consent": {
19+
"get": {
20+
"operationId": "StartOauthConsent",
21+
"responses": {
22+
"200": {
23+
"description": "",
24+
"schema": {
25+
"$ref": "#/definitions/prolab_accountsStartOauthConsentResponse"
26+
}
27+
}
28+
},
29+
"parameters": [
30+
{
31+
"name": "consent_challenge",
32+
"in": "query",
33+
"required": false,
34+
"type": "string"
35+
}
36+
],
37+
"tags": [
38+
"OAuthService"
39+
]
40+
},
41+
"post": {
42+
"operationId": "OAuthConsent",
43+
"responses": {
44+
"200": {
45+
"description": "",
46+
"schema": {
47+
"$ref": "#/definitions/prolab_accountsOAuthConsentResponse"
48+
}
49+
}
50+
},
51+
"parameters": [
52+
{
53+
"name": "body",
54+
"in": "body",
55+
"required": true,
56+
"schema": {
57+
"$ref": "#/definitions/prolab_accountsOAuthConsentRequest"
58+
}
59+
}
60+
],
61+
"tags": [
62+
"OAuthService"
63+
]
64+
}
65+
},
1866
"/oauth/login": {
1967
"get": {
2068
"operationId": "StartOauthLogin",
@@ -65,6 +113,36 @@
65113
}
66114
},
67115
"definitions": {
116+
"prolab_accountsOAuthConsentRequest": {
117+
"type": "object",
118+
"properties": {
119+
"consent_challenge": {
120+
"type": "string"
121+
},
122+
"accept": {
123+
"type": "boolean",
124+
"format": "boolean"
125+
},
126+
"grant_scopes": {
127+
"type": "array",
128+
"items": {
129+
"type": "string"
130+
}
131+
},
132+
"remember": {
133+
"type": "boolean",
134+
"format": "boolean"
135+
}
136+
}
137+
},
138+
"prolab_accountsOAuthConsentResponse": {
139+
"type": "object",
140+
"properties": {
141+
"redirect_url": {
142+
"type": "string"
143+
}
144+
}
145+
},
68146
"prolab_accountsOAuthLoginRequest": {
69147
"type": "object",
70148
"properties": {
@@ -102,6 +180,53 @@
102180
"type": "string"
103181
}
104182
}
183+
},
184+
"prolab_accountsStartOauthConsentResponse": {
185+
"type": "object",
186+
"properties": {
187+
"skip": {
188+
"type": "boolean",
189+
"format": "boolean"
190+
},
191+
"redirect_url": {
192+
"type": "string"
193+
},
194+
"requested_scopes": {
195+
"type": "array",
196+
"items": {
197+
"type": "string"
198+
}
199+
},
200+
"client": {
201+
"$ref": "#/definitions/typeClient"
202+
}
203+
}
204+
},
205+
"typeClient": {
206+
"type": "object",
207+
"properties": {
208+
"id": {
209+
"type": "string"
210+
},
211+
"name": {
212+
"type": "string"
213+
},
214+
"uri": {
215+
"type": "string"
216+
},
217+
"contacts": {
218+
"type": "array",
219+
"items": {
220+
"type": "string"
221+
}
222+
},
223+
"logo_uri": {
224+
"type": "string"
225+
},
226+
"owner": {
227+
"type": "string"
228+
}
229+
}
105230
}
106231
}
107232
}

api/protos/oauth.proto

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ option go_package = "github.com/ProgrammingLab/prolab-accounts/api;api_pb";
88
import "google/api/annotations.proto";
99
import "google/protobuf/empty.proto";
1010

11+
import "type/client.proto";
12+
1113
service OAuthService {
1214
rpc StartOauthLogin (StartOauthLoginRequest) returns (StartOAuthLoginResponse) {
1315
option (google.api.http) = {
@@ -20,6 +22,17 @@ service OAuthService {
2022
body: "*"
2123
};
2224
}
25+
rpc StartOauthConsent (StartOauthConsentRequest) returns (StartOauthConsentResponse) {
26+
option (google.api.http) = {
27+
get: "/oauth/consent"
28+
};
29+
}
30+
rpc OAuthConsent (OAuthConsentRequest) returns (OAuthConsentResponse) {
31+
option (google.api.http) = {
32+
post: "/oauth/consent"
33+
body: "*"
34+
};
35+
}
2336
}
2437

2538
message StartOauthLoginRequest {
@@ -41,3 +54,25 @@ message OAuthLoginRequest {
4154
message OAuthLoginResponse {
4255
string redirect_url = 1;
4356
}
57+
58+
message StartOauthConsentRequest {
59+
string consent_challenge = 1;
60+
}
61+
62+
message StartOauthConsentResponse {
63+
bool skip = 1;
64+
string redirect_url = 2;
65+
repeated string requested_scopes = 3;
66+
type.Client client = 4;
67+
}
68+
69+
message OAuthConsentRequest {
70+
string consent_challenge = 1;
71+
bool accept = 2;
72+
repeated string grant_scopes = 3;
73+
bool remember = 4;
74+
}
75+
76+
message OAuthConsentResponse {
77+
string redirect_url = 1;
78+
}

api/protos/type/client.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
syntax = "proto3";
2+
3+
package programming_lab.prolab_accounts.type;
4+
5+
option go_package = "github.com/ProgrammingLab/prolab-accounts/api/type;type_pb";
6+
7+
message Client {
8+
string id = 1;
9+
string name = 2;
10+
string uri = 3;
11+
repeated string contacts = 4;
12+
string logo_uri = 5;
13+
string owner = 6;
14+
}

0 commit comments

Comments
 (0)