feat: add external-auth cli (#10052)

* feat: add `external-auth` cli

* Add subcommands

* Improve descriptions

* Add external-auth subcommand

* Fix docs

* Fix gen

* Fix comment

* Fix golden file
This commit is contained in:
Kyle Carberry
2023-10-09 23:04:35 +00:00
committed by GitHub
parent 20438ae6c2
commit 35538e1051
22 changed files with 613 additions and 105 deletions
+68 -8
View File
@@ -4561,7 +4561,7 @@ const docTemplate = `{
}
}
},
"/workspaceagents/me/gitauth": {
"/workspaceagents/me/external-auth": {
"get": {
"security": [
{
@@ -4574,14 +4574,20 @@ const docTemplate = `{
"tags": [
"Agents"
],
"summary": "Get workspace agent Git auth",
"operationId": "get-workspace-agent-git-auth",
"summary": "Get workspace agent external auth",
"operationId": "get-workspace-agent-external-auth",
"parameters": [
{
"type": "string",
"format": "uri",
"description": "Git URL",
"name": "url",
"description": "Match",
"name": "match",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "query",
"required": true
},
@@ -4596,7 +4602,54 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/agentsdk.GitAuthResponse"
"$ref": "#/definitions/agentsdk.ExternalAuthResponse"
}
}
}
}
},
"/workspaceagents/me/gitauth": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Agents"
],
"summary": "Removed: Get workspace agent git auth",
"operationId": "removed-get-workspace-agent-git-auth",
"parameters": [
{
"type": "string",
"description": "Match",
"name": "match",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Wait for a new token to be issued",
"name": "listen",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/agentsdk.ExternalAuthResponse"
}
}
}
@@ -6417,16 +6470,23 @@ const docTemplate = `{
}
}
},
"agentsdk.GitAuthResponse": {
"agentsdk.ExternalAuthResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"password": {
"type": "string"
},
"type": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"description": "Deprecated: Only supported on ` + "`" + `/workspaceagents/me/gitauth` + "`" + `\nfor backwards compatibility.",
"type": "string"
}
}
+64 -8
View File
@@ -4011,7 +4011,7 @@
}
}
},
"/workspaceagents/me/gitauth": {
"/workspaceagents/me/external-auth": {
"get": {
"security": [
{
@@ -4020,14 +4020,20 @@
],
"produces": ["application/json"],
"tags": ["Agents"],
"summary": "Get workspace agent Git auth",
"operationId": "get-workspace-agent-git-auth",
"summary": "Get workspace agent external auth",
"operationId": "get-workspace-agent-external-auth",
"parameters": [
{
"type": "string",
"format": "uri",
"description": "Git URL",
"name": "url",
"description": "Match",
"name": "match",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "query",
"required": true
},
@@ -4042,7 +4048,50 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/agentsdk.GitAuthResponse"
"$ref": "#/definitions/agentsdk.ExternalAuthResponse"
}
}
}
}
},
"/workspaceagents/me/gitauth": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": ["application/json"],
"tags": ["Agents"],
"summary": "Removed: Get workspace agent git auth",
"operationId": "removed-get-workspace-agent-git-auth",
"parameters": [
{
"type": "string",
"description": "Match",
"name": "match",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Wait for a new token to be issued",
"name": "listen",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/agentsdk.ExternalAuthResponse"
}
}
}
@@ -5651,16 +5700,23 @@
}
}
},
"agentsdk.GitAuthResponse": {
"agentsdk.ExternalAuthResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"password": {
"type": "string"
},
"type": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"description": "Deprecated: Only supported on `/workspaceagents/me/gitauth`\nfor backwards compatibility.",
"type": "string"
}
}