Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 663ec87

Browse files
committed
workspaceagents: instance identity
1 parent 96daf47 commit 663ec87

File tree

5 files changed

+521
-0
lines changed

5 files changed

+521
-0
lines changed

coderd/apidoc/docs.go

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,114 @@ const docTemplate = `{
875875
}
876876
}
877877
},
878+
"/workspaceagents/aws-instance-identity": {
879+
"post": {
880+
"security": [
881+
{
882+
"CoderSessionToken": []
883+
}
884+
],
885+
"produces": [
886+
"application/json"
887+
],
888+
"tags": [
889+
"Workspaces"
890+
],
891+
"summary": "Authenticate agent on AWS instance",
892+
"operationId": "authenticate-agent-on-aws-instance",
893+
"parameters": [
894+
{
895+
"description": "Instance identity token",
896+
"name": "request",
897+
"in": "body",
898+
"required": true,
899+
"schema": {
900+
"$ref": "#/definitions/codersdk.AWSInstanceIdentityToken"
901+
}
902+
}
903+
],
904+
"responses": {
905+
"200": {
906+
"description": "OK",
907+
"schema": {
908+
"$ref": "#/definitions/codersdk.WorkspaceAgentAuthenticateResponse"
909+
}
910+
}
911+
}
912+
}
913+
},
914+
"/workspaceagents/azure-instance-identity": {
915+
"post": {
916+
"security": [
917+
{
918+
"CoderSessionToken": []
919+
}
920+
],
921+
"produces": [
922+
"application/json"
923+
],
924+
"tags": [
925+
"Workspaces"
926+
],
927+
"summary": "Authenticate agent on Azure instance",
928+
"operationId": "authenticate-agent-on-azure-instance",
929+
"parameters": [
930+
{
931+
"description": "Instance identity token",
932+
"name": "request",
933+
"in": "body",
934+
"required": true,
935+
"schema": {
936+
"$ref": "#/definitions/codersdk.AzureInstanceIdentityToken"
937+
}
938+
}
939+
],
940+
"responses": {
941+
"200": {
942+
"description": "OK",
943+
"schema": {
944+
"$ref": "#/definitions/codersdk.WorkspaceAgentAuthenticateResponse"
945+
}
946+
}
947+
}
948+
}
949+
},
950+
"/workspaceagents/google-instance-identity": {
951+
"post": {
952+
"security": [
953+
{
954+
"CoderSessionToken": []
955+
}
956+
],
957+
"produces": [
958+
"application/json"
959+
],
960+
"tags": [
961+
"Workspaces"
962+
],
963+
"summary": "Authenticate agent on Google Cloud instance",
964+
"operationId": "authenticate-agent-on-google-cloud-instance",
965+
"parameters": [
966+
{
967+
"description": "Instance identity token",
968+
"name": "request",
969+
"in": "body",
970+
"required": true,
971+
"schema": {
972+
"$ref": "#/definitions/codersdk.GoogleInstanceIdentityToken"
973+
}
974+
}
975+
],
976+
"responses": {
977+
"200": {
978+
"description": "OK",
979+
"schema": {
980+
"$ref": "#/definitions/codersdk.WorkspaceAgentAuthenticateResponse"
981+
}
982+
}
983+
}
984+
}
985+
},
878986
"/workspacebuilds/{workspacebuild}": {
879987
"get": {
880988
"security": [
@@ -1409,6 +1517,21 @@ const docTemplate = `{
14091517
}
14101518
}
14111519
},
1520+
"codersdk.AWSInstanceIdentityToken": {
1521+
"type": "object",
1522+
"required": [
1523+
"document",
1524+
"signature"
1525+
],
1526+
"properties": {
1527+
"document": {
1528+
"type": "string"
1529+
},
1530+
"signature": {
1531+
"type": "string"
1532+
}
1533+
}
1534+
},
14121535
"codersdk.AuditDiff": {
14131536
"type": "object",
14141537
"additionalProperties": {
@@ -1561,6 +1684,21 @@ const docTemplate = `{
15611684
"type": "boolean"
15621685
}
15631686
},
1687+
"codersdk.AzureInstanceIdentityToken": {
1688+
"type": "object",
1689+
"required": [
1690+
"encoding",
1691+
"signature"
1692+
],
1693+
"properties": {
1694+
"encoding": {
1695+
"type": "string"
1696+
},
1697+
"signature": {
1698+
"type": "string"
1699+
}
1700+
}
1701+
},
15641702
"codersdk.BuildInfoResponse": {
15651703
"type": "object",
15661704
"properties": {
@@ -2095,6 +2233,17 @@ const docTemplate = `{
20952233
}
20962234
}
20972235
},
2236+
"codersdk.GoogleInstanceIdentityToken": {
2237+
"type": "object",
2238+
"required": [
2239+
"json_web_token"
2240+
],
2241+
"properties": {
2242+
"json_web_token": {
2243+
"type": "string"
2244+
}
2245+
}
2246+
},
20982247
"codersdk.Healthcheck": {
20992248
"type": "object",
21002249
"properties": {
@@ -2777,6 +2926,14 @@ const docTemplate = `{
27772926
}
27782927
}
27792928
},
2929+
"codersdk.WorkspaceAgentAuthenticateResponse": {
2930+
"type": "object",
2931+
"properties": {
2932+
"session_token": {
2933+
"type": "string"
2934+
}
2935+
}
2936+
},
27802937
"codersdk.WorkspaceApp": {
27812938
"type": "object",
27822939
"properties": {

coderd/apidoc/swagger.json

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,102 @@
757757
}
758758
}
759759
},
760+
"/workspaceagents/aws-instance-identity": {
761+
"post": {
762+
"security": [
763+
{
764+
"CoderSessionToken": []
765+
}
766+
],
767+
"produces": ["application/json"],
768+
"tags": ["Workspaces"],
769+
"summary": "Authenticate agent on AWS instance",
770+
"operationId": "authenticate-agent-on-aws-instance",
771+
"parameters": [
772+
{
773+
"description": "Instance identity token",
774+
"name": "request",
775+
"in": "body",
776+
"required": true,
777+
"schema": {
778+
"$ref": "#/definitions/codersdk.AWSInstanceIdentityToken"
779+
}
780+
}
781+
],
782+
"responses": {
783+
"200": {
784+
"description": "OK",
785+
"schema": {
786+
"$ref": "#/definitions/codersdk.WorkspaceAgentAuthenticateResponse"
787+
}
788+
}
789+
}
790+
}
791+
},
792+
"/workspaceagents/azure-instance-identity": {
793+
"post": {
794+
"security": [
795+
{
796+
"CoderSessionToken": []
797+
}
798+
],
799+
"produces": ["application/json"],
800+
"tags": ["Workspaces"],
801+
"summary": "Authenticate agent on Azure instance",
802+
"operationId": "authenticate-agent-on-azure-instance",
803+
"parameters": [
804+
{
805+
"description": "Instance identity token",
806+
"name": "request",
807+
"in": "body",
808+
"required": true,
809+
"schema": {
810+
"$ref": "#/definitions/codersdk.AzureInstanceIdentityToken"
811+
}
812+
}
813+
],
814+
"responses": {
815+
"200": {
816+
"description": "OK",
817+
"schema": {
818+
"$ref": "#/definitions/codersdk.WorkspaceAgentAuthenticateResponse"
819+
}
820+
}
821+
}
822+
}
823+
},
824+
"/workspaceagents/google-instance-identity": {
825+
"post": {
826+
"security": [
827+
{
828+
"CoderSessionToken": []
829+
}
830+
],
831+
"produces": ["application/json"],
832+
"tags": ["Workspaces"],
833+
"summary": "Authenticate agent on Google Cloud instance",
834+
"operationId": "authenticate-agent-on-google-cloud-instance",
835+
"parameters": [
836+
{
837+
"description": "Instance identity token",
838+
"name": "request",
839+
"in": "body",
840+
"required": true,
841+
"schema": {
842+
"$ref": "#/definitions/codersdk.GoogleInstanceIdentityToken"
843+
}
844+
}
845+
],
846+
"responses": {
847+
"200": {
848+
"description": "OK",
849+
"schema": {
850+
"$ref": "#/definitions/codersdk.WorkspaceAgentAuthenticateResponse"
851+
}
852+
}
853+
}
854+
}
855+
},
760856
"/workspacebuilds/{workspacebuild}": {
761857
"get": {
762858
"security": [
@@ -1230,6 +1326,18 @@
12301326
}
12311327
}
12321328
},
1329+
"codersdk.AWSInstanceIdentityToken": {
1330+
"type": "object",
1331+
"required": ["document", "signature"],
1332+
"properties": {
1333+
"document": {
1334+
"type": "string"
1335+
},
1336+
"signature": {
1337+
"type": "string"
1338+
}
1339+
}
1340+
},
12331341
"codersdk.AuditDiff": {
12341342
"type": "object",
12351343
"additionalProperties": {
@@ -1377,6 +1485,18 @@
13771485
"type": "boolean"
13781486
}
13791487
},
1488+
"codersdk.AzureInstanceIdentityToken": {
1489+
"type": "object",
1490+
"required": ["encoding", "signature"],
1491+
"properties": {
1492+
"encoding": {
1493+
"type": "string"
1494+
},
1495+
"signature": {
1496+
"type": "string"
1497+
}
1498+
}
1499+
},
13801500
"codersdk.BuildInfoResponse": {
13811501
"type": "object",
13821502
"properties": {
@@ -1895,6 +2015,15 @@
18952015
}
18962016
}
18972017
},
2018+
"codersdk.GoogleInstanceIdentityToken": {
2019+
"type": "object",
2020+
"required": ["json_web_token"],
2021+
"properties": {
2022+
"json_web_token": {
2023+
"type": "string"
2024+
}
2025+
}
2026+
},
18982027
"codersdk.Healthcheck": {
18992028
"type": "object",
19002029
"properties": {
@@ -2550,6 +2679,14 @@
25502679
}
25512680
}
25522681
},
2682+
"codersdk.WorkspaceAgentAuthenticateResponse": {
2683+
"type": "object",
2684+
"properties": {
2685+
"session_token": {
2686+
"type": "string"
2687+
}
2688+
}
2689+
},
25532690
"codersdk.WorkspaceApp": {
25542691
"type": "object",
25552692
"properties": {

0 commit comments

Comments
 (0)