Skip to content

Commit

Permalink
proper secrets definition for datastores
Browse files Browse the repository at this point in the history
  • Loading branch information
forteddyt committed Apr 13, 2021
1 parent a1cba95 commit 28509f7
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"contents": {
"contentsType": "AzureBlob",
"credentials": {
"credentialsType": "AccountKey"
"credentialsType": "AccountKey",
"secrets": {
"secretsType": "AccountKey",
"key": "string"
}
},
"accountName": "string",
"containerName": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"responses": {
"200": {
"body": {
"credentialsType": "AccountKey"
"secretsType": "AccountKey",
"key": "string"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/DatastoreCredentials"
"$ref": "#/definitions/DatastoreSecrets"
}
}
},
Expand Down Expand Up @@ -5726,38 +5726,156 @@
},
"additionalProperties": false
},
"DatastoreCredentials": {
"SecretsType": {
"enum": [
"AccountKey",
"Certificate",
"None",
"Sas",
"ServicePrincipal",
"SqlAdmin"
],
"type": "string",
"x-ms-enum": {
"name": "SecretsType",
"modelAsString": true
},
"additionalProperties": false
},
"DatastoreSecrets": {
"required": [
"credentialsType"
"secretsType"
],
"type": "object",
"properties": {
"credentialsType": {
"secretsType": {
"description": "Credential type used to authentication with storage.",
"$ref": "#/definitions/CredentialsType"
"$ref": "#/definitions/SecretsType"
}
},
"discriminator": "credentialsType",
"discriminator": "secretsType",
"additionalProperties": false
},
"AccountKeyDatastoreCredentials": {
"AccountKeyDatastoreSecrets": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/DatastoreCredentials"
"$ref": "#/definitions/DatastoreSecrets"
}
],
"properties": {
"key": {
"description": "Storage account key.",
"type": "string",
"type": "string"
}
},
"x-ms-discriminator-value": "AccountKey",
"additionalProperties": false
},
"CertificateDatastoreSecrets": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/DatastoreSecrets"
}
],
"properties": {
"certificate": {
"description": "Service principal certificate.",
"type": "string"
}
},
"x-ms-discriminator-value": "Certificate",
"additionalProperties": false
},
"NoneDatastoreSecrets": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/DatastoreSecrets"
}
],
"x-ms-discriminator-value": "None",
"additionalProperties": false
},
"SasDatastoreSecrets": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/DatastoreSecrets"
}
],
"properties": {
"sasToken": {
"description": "Storage container SAS token.",
"type": "string"
}
},
"x-ms-discriminator-value": "Sas",
"additionalProperties": false
},
"ServicePrincipalDatastoreSecrets": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/DatastoreSecrets"
}
],
"properties": {
"clientSecret": {
"description": "Service principal secret.",
"type": "string"
}
},
"x-ms-discriminator-value": "ServicePrincipal",
"additionalProperties": false
},
"SqlAdminDatastoreSecrets": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/DatastoreSecrets"
}
],
"properties": {
"password": {
"description": "SQL database password.",
"type": "string"
}
},
"x-ms-discriminator-value": "SqlAdmin",
"additionalProperties": false
},
"DatastoreCredentials": {
"required": [
"credentialsType"
],
"type": "object",
"properties": {
"credentialsType": {
"description": "Credential type used to authentication with storage.",
"$ref": "#/definitions/CredentialsType"
},
"secrets": {
"description": "Credential secrets",
"$ref": "#/definitions/DatastoreSecrets",
"x-ms-mutability": [
"create",
"update"
],
"x-ms-secret": true
}
},
"discriminator": "credentialsType",
"additionalProperties": false
},
"AccountKeyDatastoreCredentials": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/DatastoreCredentials"
}
],
"x-ms-discriminator-value": "AccountKey",
"additionalProperties": false
},
Expand Down Expand Up @@ -5792,15 +5910,6 @@
"description": "Service principal client ID.",
"type": "string"
},
"certificate": {
"description": "Service principal certificate.",
"type": "string",
"x-ms-mutability": [
"create",
"update"
],
"x-ms-secret": true
},
"thumbprint": {
"description": "Thumbprint of the certificate used for authentication.",
"pattern": "[a-zA-Z0-9_]",
Expand All @@ -5827,17 +5936,6 @@
"$ref": "#/definitions/DatastoreCredentials"
}
],
"properties": {
"sasToken": {
"description": "Storage container SAS token.",
"type": "string",
"x-ms-mutability": [
"create",
"update"
],
"x-ms-secret": true
}
},
"x-ms-discriminator-value": "Sas",
"additionalProperties": false
},
Expand Down Expand Up @@ -5870,15 +5968,6 @@
"format": "uuid",
"description": "Service principal client ID.",
"type": "string"
},
"clientSecret": {
"description": "Service principal secret.",
"type": "string",
"x-ms-mutability": [
"create",
"update"
],
"x-ms-secret": true
}
},
"x-ms-discriminator-value": "ServicePrincipal",
Expand All @@ -5899,15 +5988,6 @@
"description": "SQL database user name.",
"pattern": "[a-zA-Z0-9_]",
"type": "string"
},
"password": {
"description": "SQL database password.",
"type": "string",
"x-ms-mutability": [
"create",
"update"
],
"x-ms-secret": true
}
},
"x-ms-discriminator-value": "SqlAdmin",
Expand Down

0 comments on commit 28509f7

Please sign in to comment.