-
Notifications
You must be signed in to change notification settings - Fork 74
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
add-auth-http-custom-support-in-rlc #1959
add-auth-http-custom-support-in-rlc #1959
Conversation
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.
do some self-reviews.
...ypespec-ts/test/integration/generated/authentication/http-custom/src/authHttpCustomClient.ts
Outdated
Show resolved
Hide resolved
...ypespec-ts/test/integration/generated/authentication/http-custom/src/authHttpCustomClient.ts
Show resolved
Hide resolved
...ypespec-ts/test/integration/generated/authentication/http-custom/src/authHttpCustomClient.ts
Show resolved
Hide resolved
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 think the approach is solid.
Do we have any SDKs today that use this kind of auth that we can test with?
I was also curious if we wanted to support NamedKeyCredential
as well though maybe that's too difficult to generically support at the moment.
...ypespec-ts/test/integration/generated/authentication/http-custom/src/authHttpCustomClient.ts
Show resolved
Hide resolved
...ypespec-ts/test/integration/generated/authentication/http-custom/src/authHttpCustomClient.ts
Outdated
Show resolved
Hide resolved
@xirzec I think event grid is using this way https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L6 |
Sorry, this is not a good example, eventgrid is using standard api key credential. I am not sure if it's their workaround or I am having some misunderstanding here. Confirming with @lmazuel offline. |
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.
Looks good! Thanks @qiaozha for driving the conversations on this. I like the current approach
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.
LGTM for the immediate problem and open with Option 3 once we notice this is a common requirement.
Confirmed with Laurent, that the eventgrid is not correctly written. |
fixes #1870
This PR is to support for http custom authentication like:
And use header like
Authorization: SharedAccessKey <put my key here>
to do the authentication.As discussed in Azure/azure-sdk-for-js#25683, we will not add a commn policy in azure core. Instead, we will add a policy in the codegen side for http custom cases.
Right now, I am adding a policy in the client factory function createClient like
And I am using KeyCredential as the credentials type in this case