Files
Nirav Parikh dd563582d0 adding permissions for cli.config.read and code fix for non admin use… (#313)
* adding permissions for cli.config.read and code fix for non admin users cli config download

Signed-off-by: Nirav Parikh <nir.parikh05@gmail.com>

* includes changes for nix, go version 1.21 and addressed review comments

Signed-off-by: nirparikh05 <nir.parikh05@gmail.com>

* fixed lints

Signed-off-by: nirparikh05 <nir.parikh05@gmail.com>

---------

Signed-off-by: Nirav Parikh <nir.parikh05@gmail.com>
Signed-off-by: nirparikh05 <nir.parikh05@gmail.com>
2024-06-03 12:57:00 +05:30

1072 lines
31 KiB
JSON

{
"swagger": "2.0",
"info": {
"title": "Partner Service",
"version": "3.0",
"contact": {
"name": "Paralus Dev"
}
},
"tags": [
{
"name": "PartnerService"
}
],
"schemes": [
"https"
],
"consumes": [
"application/json",
"application/yaml"
],
"produces": [
"application/json",
"application/yaml"
],
"paths": {
"/auth/v3/partner": {
"get": {
"operationId": "PartnerService_GetInitPartner",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v3Partner"
}
},
"403": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"404": {
"description": "Returned when the resource does not exist.",
"schema": {
"type": "string",
"format": "string"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"tags": [
"PartnerService"
]
},
"post": {
"operationId": "PartnerService_CreatePartner",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v3Partner"
}
},
"201": {
"description": "Returned when partner is created successfully.",
"schema": {}
},
"403": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"404": {
"description": "Returned when the resource does not exist.",
"schema": {
"type": "string",
"format": "string"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "Partner",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v3Partner"
}
}
],
"tags": [
"PartnerService"
]
}
},
"/auth/v3/partner/{metadata.name}": {
"get": {
"operationId": "PartnerService_GetPartner",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v3Partner"
}
},
"403": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"404": {
"description": "Returned when the resource does not exist.",
"schema": {
"type": "string",
"format": "string"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "metadata.name",
"description": "name of the resource",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "apiVersion",
"description": "API Version\n\nAPI Version of the resource",
"in": "query",
"required": true,
"type": "string",
"default": "system.k8smgmt.io/v3"
},
{
"name": "kind",
"description": "Kind\n\nKind of the resource",
"in": "query",
"required": true,
"type": "string",
"default": "Partner"
},
{
"name": "metadata.displayName",
"description": "Display Name\n\ndisplay name of the resource",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.description",
"description": "Description\n\ndescription of the resource",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.labels",
"description": "Labels\n\nThis is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.annotations",
"description": "Annotations\n\nThis is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.project",
"description": "Project\n\nProject of the resource",
"in": "query",
"required": true,
"type": "string"
},
{
"name": "metadata.organization",
"description": "Organization\n\nOrganization to which the resource belongs",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.partner",
"description": "Partner\n\nPartner to which the resource belongs",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.id",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.urlScope",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.createdAt",
"in": "query",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "metadata.modifiedAt",
"in": "query",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "spec.host",
"description": "Host\n\nHost of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.domain",
"description": "Domain\n\nDomain of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.tosLink",
"description": "TOS\n\nTerms of service url of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.logoLink",
"description": "Logo\n\nLogo url of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.notificationEmail",
"description": "Notification Email\n\nNotification email of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.helpdeskEmail",
"description": "Helpdesk Email\n\nHelpdesk email of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.productName",
"description": "Product Name\n\nProduct Name",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.supportTeamName",
"description": "Support Team Name\n\nSupport Team Name",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.opsHost",
"description": "OPS Host\n\nOperations host of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.favIconLink",
"description": "Fav Icon Link\n\nFav Icon Link",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.isTOTPEnabled",
"description": "TOTP Enabled\n\nTOTP Enabled flag at the partner level",
"in": "query",
"required": false,
"type": "boolean"
},
{
"name": "spec.settings",
"description": "Settings\n\nSettings of the partner",
"in": "query",
"required": false,
"type": "object"
},
{
"name": "status.conditionType",
"description": "Condition Type\n\ntype of the status condition",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "status.conditionStatus",
"description": "Condition Status\n\nstatus of the condition",
"in": "query",
"required": false,
"type": "string",
"enum": [
"StatusNotSet",
"StatusSubmitted",
"StatusOK",
"StatusFailed"
],
"default": "StatusNotSet"
},
{
"name": "status.lastUpdated",
"description": "Last Updated\n\nwhen the condition status is last updated",
"in": "query",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "status.reason",
"description": "Reason\n\nreason of the last condition status",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"PartnerService"
]
},
"delete": {
"operationId": "PartnerService_DeletePartner",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v3Partner"
}
},
"204": {
"description": "Returned when partner is deleted successfully.",
"schema": {}
},
"403": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"404": {
"description": "Returned when the resource does not exist.",
"schema": {
"type": "string",
"format": "string"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "metadata.name",
"description": "name of the resource",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "apiVersion",
"description": "API Version\n\nAPI Version of the resource",
"in": "query",
"required": true,
"type": "string",
"default": "system.k8smgmt.io/v3"
},
{
"name": "kind",
"description": "Kind\n\nKind of the resource",
"in": "query",
"required": true,
"type": "string",
"default": "Partner"
},
{
"name": "metadata.displayName",
"description": "Display Name\n\ndisplay name of the resource",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.description",
"description": "Description\n\ndescription of the resource",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.labels",
"description": "Labels\n\nThis is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.annotations",
"description": "Annotations\n\nThis is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.project",
"description": "Project\n\nProject of the resource",
"in": "query",
"required": true,
"type": "string"
},
{
"name": "metadata.organization",
"description": "Organization\n\nOrganization to which the resource belongs",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.partner",
"description": "Partner\n\nPartner to which the resource belongs",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.id",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.urlScope",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.createdAt",
"in": "query",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "metadata.modifiedAt",
"in": "query",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "spec.host",
"description": "Host\n\nHost of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.domain",
"description": "Domain\n\nDomain of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.tosLink",
"description": "TOS\n\nTerms of service url of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.logoLink",
"description": "Logo\n\nLogo url of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.notificationEmail",
"description": "Notification Email\n\nNotification email of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.helpdeskEmail",
"description": "Helpdesk Email\n\nHelpdesk email of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.productName",
"description": "Product Name\n\nProduct Name",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.supportTeamName",
"description": "Support Team Name\n\nSupport Team Name",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.opsHost",
"description": "OPS Host\n\nOperations host of the partner",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.favIconLink",
"description": "Fav Icon Link\n\nFav Icon Link",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "spec.isTOTPEnabled",
"description": "TOTP Enabled\n\nTOTP Enabled flag at the partner level",
"in": "query",
"required": false,
"type": "boolean"
},
{
"name": "spec.settings",
"description": "Settings\n\nSettings of the partner",
"in": "query",
"required": false,
"type": "object"
},
{
"name": "status.conditionType",
"description": "Condition Type\n\ntype of the status condition",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "status.conditionStatus",
"description": "Condition Status\n\nstatus of the condition",
"in": "query",
"required": false,
"type": "string",
"enum": [
"StatusNotSet",
"StatusSubmitted",
"StatusOK",
"StatusFailed"
],
"default": "StatusNotSet"
},
{
"name": "status.lastUpdated",
"description": "Last Updated\n\nwhen the condition status is last updated",
"in": "query",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "status.reason",
"description": "Reason\n\nreason of the last condition status",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"PartnerService"
]
},
"put": {
"operationId": "PartnerService_UpdatePartner",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v3Partner"
}
},
"403": {
"description": "Returned when the user does not have permission to access the resource.",
"schema": {}
},
"404": {
"description": "Returned when the resource does not exist.",
"schema": {
"type": "string",
"format": "string"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "metadata.name",
"description": "name of the resource",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PartnerServiceUpdatePartnerBody"
}
}
],
"tags": [
"PartnerService"
]
}
}
},
"definitions": {
"PartnerServiceUpdatePartnerBody": {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"default": "system.k8smgmt.io/v3",
"description": "API Version of the resource",
"title": "API Version",
"readOnly": true
},
"kind": {
"type": "string",
"default": "Partner",
"description": "Kind of the resource",
"title": "Kind",
"readOnly": true
},
"metadata": {
"type": "object",
"example": {
"name": "some-name",
"project": "defaultproject"
},
"properties": {
"displayName": {
"type": "string",
"description": "display name of the resource",
"title": "Display Name"
},
"description": {
"type": "string",
"description": "description of the resource",
"title": "Description"
},
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "labels of the resource",
"title": "Labels"
},
"annotations": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "annotations of the resource",
"title": "Annotations"
},
"project": {
"type": "string",
"description": "Project of the resource",
"title": "Project"
},
"organization": {
"type": "string",
"description": "Organization to which the resource belongs",
"title": "Organization"
},
"partner": {
"type": "string",
"description": "Partner to which the resource belongs",
"title": "Partner"
},
"id": {
"type": "string",
"readOnly": true
},
"urlScope": {
"type": "string",
"readOnly": true
},
"createdAt": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"modifiedAt": {
"type": "string",
"format": "date-time",
"readOnly": true
}
},
"description": "metadata of the resource",
"title": "Metadata"
},
"spec": {
"$ref": "#/definitions/v3PartnerSpec",
"description": "Spec of the resource",
"title": "Spec"
},
"status": {
"$ref": "#/definitions/commonv3Status",
"description": "Status of the resource",
"title": "Status",
"readOnly": true
}
},
"description": "Partner",
"title": "Partner",
"required": [
"apiVersion",
"kind",
"metadata",
"spec",
"project"
]
},
"commonv3Status": {
"type": "object",
"properties": {
"conditionType": {
"type": "string",
"description": "type of the status condition",
"title": "Condition Type",
"readOnly": true
},
"conditionStatus": {
"$ref": "#/definitions/v3ConditionStatus",
"enum": [
"StatusNotSet",
"StatusSubmitted",
"StatusOK",
"StatusFailed"
],
"description": "status of the condition",
"title": "Condition Status",
"readOnly": true
},
"lastUpdated": {
"type": "string",
"format": "date-time",
"description": "when the condition status is last updated",
"title": "Last Updated",
"readOnly": true
},
"reason": {
"type": "string",
"description": "reason of the last condition status",
"title": "Reason",
"readOnly": true
}
},
"description": "status of a resource",
"title": "Status",
"readOnly": true
},
"googlerpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
}
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"protobufNullValue": {
"type": "string",
"enum": [
"NULL_VALUE"
],
"default": "NULL_VALUE",
"description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\nThe JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value."
},
"v3ConditionStatus": {
"type": "string",
"enum": [
"StatusNotSet",
"StatusSubmitted",
"StatusOK",
"StatusFailed"
],
"default": "StatusNotSet",
"title": "$title: ConditionStatus\n$description: status of a condition for a resource"
},
"v3Metadata": {
"type": "object",
"example": {
"name": "some-name",
"project": "defaultproject"
},
"properties": {
"name": {
"type": "string",
"description": "name of the resource",
"title": "Name"
},
"displayName": {
"type": "string",
"description": "display name of the resource",
"title": "Display Name"
},
"description": {
"type": "string",
"description": "description of the resource",
"title": "Description"
},
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "labels of the resource",
"title": "Labels"
},
"annotations": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "annotations of the resource",
"title": "Annotations"
},
"project": {
"type": "string",
"description": "Project of the resource",
"title": "Project"
},
"organization": {
"type": "string",
"description": "Organization to which the resource belongs",
"title": "Organization"
},
"partner": {
"type": "string",
"description": "Partner to which the resource belongs",
"title": "Partner"
},
"id": {
"type": "string",
"readOnly": true
},
"urlScope": {
"type": "string",
"readOnly": true
},
"createdAt": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"modifiedAt": {
"type": "string",
"format": "date-time",
"readOnly": true
}
},
"description": "metadata of the resource",
"title": "Metadata",
"required": [
"name",
"project"
]
},
"v3Partner": {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"default": "system.k8smgmt.io/v3",
"description": "API Version of the resource",
"title": "API Version",
"readOnly": true
},
"kind": {
"type": "string",
"default": "Partner",
"description": "Kind of the resource",
"title": "Kind",
"readOnly": true
},
"metadata": {
"$ref": "#/definitions/v3Metadata",
"description": "Metadata of the resource",
"title": "Metadata"
},
"spec": {
"$ref": "#/definitions/v3PartnerSpec",
"description": "Spec of the resource",
"title": "Spec"
},
"status": {
"$ref": "#/definitions/commonv3Status",
"description": "Status of the resource",
"title": "Status",
"readOnly": true
}
},
"description": "Partner",
"title": "Partner",
"required": [
"apiVersion",
"kind",
"metadata",
"spec"
]
},
"v3PartnerSpec": {
"type": "object",
"properties": {
"host": {
"type": "string",
"description": "Host of the partner",
"title": "Host"
},
"domain": {
"type": "string",
"description": "Domain of the partner",
"title": "Domain"
},
"tosLink": {
"type": "string",
"description": "Terms of service url of the partner",
"title": "TOS"
},
"logoLink": {
"type": "string",
"description": "Logo url of the partner",
"title": "Logo"
},
"notificationEmail": {
"type": "string",
"description": "Notification email of the partner",
"title": "Notification Email"
},
"helpdeskEmail": {
"type": "string",
"description": "Helpdesk email of the partner",
"title": "Helpdesk Email"
},
"productName": {
"type": "string",
"description": "Product Name",
"title": "Product Name"
},
"supportTeamName": {
"type": "string",
"description": "Support Team Name",
"title": "Support Team Name"
},
"opsHost": {
"type": "string",
"description": "Operations host of the partner",
"title": "OPS Host"
},
"favIconLink": {
"type": "string",
"description": "Fav Icon Link",
"title": "Fav Icon Link"
},
"isTOTPEnabled": {
"type": "boolean",
"description": "TOTP Enabled flag at the partner level",
"title": "TOTP Enabled"
},
"settings": {
"type": "object",
"description": "Settings of the partner",
"title": "Settings"
}
},
"description": "Partner Specification",
"title": "Partner Specification"
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "X-API-KEYID",
"in": "header"
},
"ApiTokenAuth": {
"type": "apiKey",
"name": "X-API-TOKEN",
"in": "header"
},
"BasicAuth": {
"type": "basic"
}
},
"security": [
{
"ApiKeyAuth": [],
"ApiTokenAuth": [],
"BasicAuth": []
}
]
}