Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update connection type and auth type #20493

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5838,7 +5838,9 @@
"ManagedIdentity",
"UsernamePassword",
"None",
"SAS"
"SAS",
"ServicePrincipal",
"AccessKey"
],
"type": "string",
"description": "Authentication type of the connection target",
Expand All @@ -5848,17 +5850,8 @@
}
},
"ConnectionCategory": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ConnectionCategory

Is it not possible add categories, rather than change it to unconstrained string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are supporting more and more categories and updating swagger each time won't scale well. so we plan to change this back to a string, but we will check on server side and return an error message with supported categories.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I get it. How can you add categories without a contract change? Contract change will require an API version change. Once you do that, it's easy to add enum values. In fact, you can add enum values without an API version change as well, as long as it sets modelAsString in the x-ms-enum extension. I don't see the advantage of unconstrained string.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A constrained string needs to be modeled as an enum. Its not a good practice to accept a string and return a bad request if its not in the set u expect it to be. How do u expect your customers to know what the possible values are?

"enum": [
"PythonFeed",
Copy link
Member

@rkmanda rkmanda Sep 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please get an approval from the breaking changes review board. The relevant links are already present in the PR summary. Do not remove the breaking changes label especially without providing any justification. It will only take longer for the review to complete #Closed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required as it is modeled as a string

"ContainerRegistry",
"Git"
],
"type": "string",
"description": "Category of the connection",
"x-ms-enum": {
"name": "ConnectionCategory",
"modelAsString": true
}
"description": "Category of the connection"
},
"WorkspaceConnectionUsernamePassword": {
"type": "object",
Expand Down Expand Up @@ -5935,6 +5928,65 @@
"additionalProperties": false,
"x-ms-discriminator-value": "UsernamePassword"
},
"WorkspaceConnectionAccessKey": {
"type": "object",
"properties": {
"accessKeyId": {
"type": "string"
},
"secretAccessKey": {
ZhidaLiu marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"x-ms-secret": true
}
},
"additionalProperties": false
},
"AccessKeyAuthTypeWorkspaceConnectionProperties": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/WorkspaceConnectionPropertiesV2"
}
],
"properties": {
"credentials": {
"$ref": "#/definitions/WorkspaceConnectionAccessKey"
}
},
"additionalProperties": false,
"x-ms-discriminator-value": "AccessKey"
},
"WorkspaceConnectionServicePrincipal": {
"type": "object",
"properties": {
"clientId": {
"type": "string"
},
"clientSecret": {
ZhidaLiu marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"x-ms-secret": true
},
"tenantId": {
"type": "string"
}
},
"additionalProperties": false
},
"ServicePrincipalAuthTypeWorkspaceConnectionProperties": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/WorkspaceConnectionPropertiesV2"
}
],
"properties": {
"credentials": {
"$ref": "#/definitions/WorkspaceConnectionServicePrincipal"
}
},
"additionalProperties": false,
"x-ms-discriminator-value": "ServicePrincipal"
},
"WorkspaceConnectionPropertiesV2": {
"required": [
"authType"
Expand Down