-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Include SharedAccessSignature in SB & EH connection string model #11909
Conversation
Looks like the catch is going to be in making the SharedAccessKey and SharedAccessKeyName optional in the EH & SB connection string models. That would be a breaking change for core-amqp |
const parsed = parseConnectionString< | ||
ServiceBusConnectionStringModel & { SharedAccessSignature: string } | ||
>(connectionString); | ||
const parsed = parseConnectionString<ServiceBusConnectionStringModel>(connectionString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be exposing parseConnectionString
methods from service-bus and event-hubs separately?
Which would be
export const parseSBConnectionString = (connectionString: string) =>
parseConnectionString<ServiceBusConnectionStringModel>(connectionString);
This way, users would also get the type info if they use parseSBConnectionString
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do that if the parseSBConnectionString method would then follow all the requirements logged in #11893 and #11894. If we are going with an intermediate offering in the meantime, then I would keep this as is in core-amqp
Also, this might be a good opportunity to gather all our core-amqp v2 requirements and see if we want to make the jump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other benefit of what @HarshaNalluru 's suggesting is that we can slim down the interface that we return since, as you've pointed out, the current interfaces have the [x: string]: any;
which I'd rather not be on the hook for in the future.
I've no objections to writing this off as a language idiom, if that's the will of the JS team. The intent behind the issues is:
|
Thanks all It does look like there are limitations to the parseConnectionString in core-amqp that we would not want to tie ourselves to. |
#11893 and #11894 are issues requesting a parser for Service Bus and Event Hubs connection strings.
We already have a method
parseConnectionString<T>(connectionString): T
exposed from@azure/core-amqp
that does something like this. The differences areEventHubConnectionStringModel
orServiceBusConnectionStringModel
or any type of their choice. If a user does not pass any type variable, they get a json object representing all the key value pairs in the connection string, but no help on the names of the keys.FullyQualifiedNamespace
orEventHubName
The main motivation behind the issues that were logged is to assist with transforming a connection string for use with credential-based client creation. With this PR, the parseConnectionString method along with the EH & SB connection string models are good enough for the time being, though not perfect.
@richardpark-msft, @HarshaNalluru, @bterlson, @jsquire, Thoughts?