Skip to content

Commit 2436511

Browse files
atrakhConvex, Inc.
authored andcommitted
Add endpoints for managing oauth apps (#39155)
GitOrigin-RevId: 547858e591a2c1b28a1536a1c5eb30a528109398
1 parent 3fa6c21 commit 2436511

File tree

3 files changed

+507
-2
lines changed

3 files changed

+507
-2
lines changed

npm-packages/dashboard/dashboard-openapi.json

Lines changed: 272 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,181 @@
19501950
}
19511951
}
19521952
},
1953+
"/teams/{team_id}/oauth_apps": {
1954+
"get": {
1955+
"operationId": "list_oauth_apps_for_team",
1956+
"parameters": [
1957+
{
1958+
"name": "team_id",
1959+
"in": "path",
1960+
"description": "",
1961+
"required": true
1962+
}
1963+
],
1964+
"responses": {
1965+
"200": {
1966+
"description": "",
1967+
"content": {
1968+
"application/json": {
1969+
"schema": {
1970+
"type": "array",
1971+
"items": {
1972+
"$ref": "#/components/schemas/OauthAppResponse"
1973+
}
1974+
}
1975+
}
1976+
}
1977+
}
1978+
}
1979+
}
1980+
},
1981+
"/teams/{team_id}/oauth_apps/check": {
1982+
"post": {
1983+
"operationId": "check_oauth_app",
1984+
"parameters": [
1985+
{
1986+
"name": "team_id",
1987+
"in": "path",
1988+
"description": "",
1989+
"required": true
1990+
}
1991+
],
1992+
"requestBody": {
1993+
"content": {
1994+
"application/json": {
1995+
"schema": {
1996+
"$ref": "#/components/schemas/CheckOauthAppArgs"
1997+
}
1998+
}
1999+
},
2000+
"required": true
2001+
},
2002+
"responses": {
2003+
"200": {
2004+
"description": "",
2005+
"content": {
2006+
"application/json": {
2007+
"schema": {
2008+
"$ref": "#/components/schemas/OauthAppResponse"
2009+
}
2010+
}
2011+
}
2012+
}
2013+
}
2014+
}
2015+
},
2016+
"/teams/{team_id}/oauth_apps/register": {
2017+
"post": {
2018+
"operationId": "register_oauth_app",
2019+
"parameters": [
2020+
{
2021+
"name": "team_id",
2022+
"in": "path",
2023+
"description": "",
2024+
"required": true
2025+
}
2026+
],
2027+
"requestBody": {
2028+
"content": {
2029+
"application/json": {
2030+
"schema": {
2031+
"$ref": "#/components/schemas/RegisterOauthAppArgs"
2032+
}
2033+
}
2034+
},
2035+
"required": true
2036+
},
2037+
"responses": {
2038+
"200": {
2039+
"description": "",
2040+
"content": {
2041+
"application/json": {
2042+
"schema": {
2043+
"$ref": "#/components/schemas/OauthAppResponse"
2044+
}
2045+
}
2046+
}
2047+
}
2048+
}
2049+
}
2050+
},
2051+
"/teams/{team_id}/oauth_apps/{client_id}/delete": {
2052+
"post": {
2053+
"operationId": "delete_oauth_app",
2054+
"parameters": [
2055+
{
2056+
"name": "team_id",
2057+
"in": "path",
2058+
"description": "",
2059+
"required": true,
2060+
"schema": {
2061+
"$ref": "#/components/schemas/TeamId"
2062+
}
2063+
},
2064+
{
2065+
"name": "client_id",
2066+
"in": "path",
2067+
"description": "The client ID of the OAuth app to delete",
2068+
"required": true,
2069+
"schema": {
2070+
"type": "string"
2071+
}
2072+
}
2073+
],
2074+
"responses": {
2075+
"200": {
2076+
"description": ""
2077+
}
2078+
}
2079+
}
2080+
},
2081+
"/teams/{team_id}/oauth_apps/{client_id}/update": {
2082+
"post": {
2083+
"operationId": "update_oauth_app",
2084+
"parameters": [
2085+
{
2086+
"name": "team_id",
2087+
"in": "path",
2088+
"description": "",
2089+
"required": true,
2090+
"schema": {
2091+
"$ref": "#/components/schemas/TeamId"
2092+
}
2093+
},
2094+
{
2095+
"name": "client_id",
2096+
"in": "path",
2097+
"description": "The client ID of the OAuth app to update",
2098+
"required": true,
2099+
"schema": {
2100+
"type": "string"
2101+
}
2102+
}
2103+
],
2104+
"requestBody": {
2105+
"content": {
2106+
"application/json": {
2107+
"schema": {
2108+
"$ref": "#/components/schemas/UpdateOauthAppArgs"
2109+
}
2110+
}
2111+
},
2112+
"required": true
2113+
},
2114+
"responses": {
2115+
"200": {
2116+
"description": "",
2117+
"content": {
2118+
"application/json": {
2119+
"schema": {
2120+
"$ref": "#/components/schemas/OauthAppResponse"
2121+
}
2122+
}
2123+
}
2124+
}
2125+
}
2126+
}
2127+
},
19532128
"/teams/{team_id}/projects": {
19542129
"get": {
19552130
"operationId": "get_projects_for_team",
@@ -2688,7 +2863,11 @@
26882863
"deleteCloudBackup",
26892864
"disableTeamExceedingSpendingLimits",
26902865
"setSpendingLimit",
2691-
"applyReferralCode"
2866+
"applyReferralCode",
2867+
"createOAuthApplication",
2868+
"updateOAuthApplication",
2869+
"deleteOAuthApplication",
2870+
"verifyOAuthApplication"
26922871
]
26932872
},
26942873
"AuditLogActor": {
@@ -3060,6 +3239,22 @@
30603239
},
30613240
"additionalProperties": false
30623241
},
3242+
"CheckOauthAppArgs": {
3243+
"type": "object",
3244+
"required": [
3245+
"clientId",
3246+
"redirectUri"
3247+
],
3248+
"properties": {
3249+
"clientId": {
3250+
"type": "string"
3251+
},
3252+
"redirectUri": {
3253+
"type": "string"
3254+
}
3255+
},
3256+
"additionalProperties": false
3257+
},
30633258
"CloudBackupId": {
30643259
"type": "integer",
30653260
"format": "int64",
@@ -3950,6 +4145,38 @@
39504145
}
39514146
}
39524147
},
4148+
"OauthAppResponse": {
4149+
"type": "object",
4150+
"required": [
4151+
"clientId",
4152+
"appName",
4153+
"redirectUris",
4154+
"verified"
4155+
],
4156+
"properties": {
4157+
"appName": {
4158+
"$ref": "#/components/schemas/AppName"
4159+
},
4160+
"clientId": {
4161+
"type": "string"
4162+
},
4163+
"clientSecret": {
4164+
"type": [
4165+
"string",
4166+
"null"
4167+
]
4168+
},
4169+
"redirectUris": {
4170+
"type": "array",
4171+
"items": {
4172+
"type": "string"
4173+
}
4174+
},
4175+
"verified": {
4176+
"type": "boolean"
4177+
}
4178+
}
4179+
},
39534180
"OptIn": {
39544181
"oneOf": [
39554182
{
@@ -4345,6 +4572,25 @@
43454572
}
43464573
}
43474574
},
4575+
"RegisterOauthAppArgs": {
4576+
"type": "object",
4577+
"required": [
4578+
"appName",
4579+
"redirectUris"
4580+
],
4581+
"properties": {
4582+
"appName": {
4583+
"$ref": "#/components/schemas/AppName"
4584+
},
4585+
"redirectUris": {
4586+
"type": "array",
4587+
"items": {
4588+
"type": "string"
4589+
}
4590+
}
4591+
},
4592+
"additionalProperties": false
4593+
},
43484594
"RemoveMemberArgs": {
43494595
"type": "object",
43504596
"required": [
@@ -4834,6 +5080,31 @@
48345080
},
48355081
"additionalProperties": false
48365082
},
5083+
"UpdateOauthAppArgs": {
5084+
"type": "object",
5085+
"properties": {
5086+
"appName": {
5087+
"oneOf": [
5088+
{
5089+
"type": "null"
5090+
},
5091+
{
5092+
"$ref": "#/components/schemas/AppName"
5093+
}
5094+
]
5095+
},
5096+
"redirectUris": {
5097+
"type": [
5098+
"array",
5099+
"null"
5100+
],
5101+
"items": {
5102+
"type": "string"
5103+
}
5104+
}
5105+
},
5106+
"additionalProperties": false
5107+
},
48375108
"UpdatePaymentMethodArgs": {
48385109
"type": "object",
48395110
"required": [

npm-packages/dashboard/src/components/teamSettings/AuditLogItem.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ function EntryAction({
561561
</>
562562
);
563563
}
564+
case "verifyOAuthApplication": {
565+
return <span>verified an OAuth application</span>;
566+
}
567+
case "deleteOAuthApplication": {
568+
return <span>deleted an OAuth application</span>;
569+
}
570+
case "createOAuthApplication": {
571+
return <span>created an OAuth application</span>;
572+
}
573+
case "updateOAuthApplication": {
574+
return <span>updated an OAuth application</span>;
575+
}
564576
default:
565577
// eslint-disable-next-line no-case-declarations, @typescript-eslint/no-unused-vars
566578
const notAllowed: never = action;

0 commit comments

Comments
 (0)