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

Implement an Event Hubs Connection String Parser #11894

Closed
jsquire opened this issue Oct 16, 2020 · 2 comments
Closed

Implement an Event Hubs Connection String Parser #11894

jsquire opened this issue Oct 16, 2020 · 2 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Event Hubs good first issue This issue tracks work that may be a good starting point for a first-time contributor help wanted This issue is tracking work for which community contributions would be welcomed and appreciated

Comments

@jsquire
Copy link
Member

jsquire commented Oct 16, 2020

Summary

Event Hubs allows for authorization using a shared key and shared access signature that is supported using a service-specific shared access key credential. It is common for the shared key or shared access signature to be passed with the service endpoint and entity path as part of a connection string. To align with best practices, we would like to guide library users to down the path of using credentials for authorization within production applications. In order to assist with transforming a connection string for use with credential-based client creation, a parsing utility is desirable.

Scope of Work

  • Design and implementation of a means for parsing a Event Hubs connection string into its components. These should include:

    • FullyQualifiedNamespace
    • Endpoint
    • EventHubName
    • SharedAccessSignature
    • SharedAccessKeyName
    • SharedAccessKey

  • The parser should adhere to the current validation rules for connection string correctness. For example:

    • Only one form of authorization should be allowed (shared key or shared access signature)
    • The Endpoint must be present
    • The EntityPath is optional
    • All tokens which are present must have an associated value

  • The EventHubName reflects the EntityPath token of the connection string, if present.

  • The host name of the Endpoint should be reflected as the FullyQualifiedNamespace.

  • Unknown tokens in the connection string are rejected or ignored; they are not reflected in the set of parsed tokens.

  • The parsed values should be treated as read-only, if idiomatic to the language.

  • The proposed surface area of the parser, as well as any associated types that change the public API surface should be reviewed with the language architect, and approval obtained. Full board review is not necessary.

Success Criteria

  • The design of a parser detailed by the scope has been completed and approved by the language architect.

  • The parser has been implemented according to the design and is exposed as part of the public API of the library.

  • The tests necessary for its validation have been created or adjusted and pass reliably.

  • The existing test suite continues to produce deterministic results and pass reliably.

References

@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. Event Hubs needs-team-triage Workflow: This issue needs the team to triage. labels Oct 16, 2020
@ramya-rao-a ramya-rao-a added this to the [2020] November milestone Oct 19, 2020
@ramya-rao-a ramya-rao-a removed the needs-team-triage Workflow: This issue needs the team to triage. label Oct 19, 2020
@ramya-rao-a ramya-rao-a modified the milestones: [2020] November, Backlog Oct 21, 2020
@ramya-rao-a ramya-rao-a added good first issue This issue tracks work that may be a good starting point for a first-time contributor help wanted This issue is tracking work for which community contributions would be welcomed and appreciated labels Oct 21, 2020
@ramya-rao-a
Copy link
Contributor

PRs are welcome to add the connection string parser.

Code Pointers:

openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this issue Dec 3, 2020
@ramya-rao-a ramya-rao-a modified the milestones: Backlog, [2021] February Jan 12, 2021
maorleger added a commit to maorleger/azure-sdk-for-js that referenced this issue Jan 27, 2021
This commit adds the following to the Event Hubs package to satisfy the
requirements listed in Azure#11894:

- A helper methods `parseEventHubConnectionString` that validates and
parses a given connection string
- An interface `EventHubConnectionStringProperties` that defines the
output of the above method.
maorleger added a commit that referenced this issue Jan 28, 2021
## What

Add the following to the Event Hubs package:

-  A helper methods `parseEventHubConnectionString` that validates and
parses a given connection string
- An interface `EventHubConnectionStringProperties` that defines the
output of the above method.
 
## Why

In a [recent PR](#11949) the same change
has been made for ServiceBus to provide a parsing utility that can help transform a raw
connection string for use with credential-based client creation.

Implements #11894
@ramya-rao-a
Copy link
Contributor

Done with #12684

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Event Hubs good first issue This issue tracks work that may be a good starting point for a first-time contributor help wanted This issue is tracking work for which community contributions would be welcomed and appreciated
Projects
None yet
Development

No branches or pull requests

3 participants