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

Support dynamic OpenApiHttpTriggerAuthorization #435

Merged
merged 4 commits into from
Aug 22, 2022

Conversation

jackbatzner
Copy link
Contributor

@jackbatzner jackbatzner commented May 12, 2022

Address #434.

Ready for review @justinyoo

Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Would you please be able to take a look at my change requests?

public static IOpenApiHttpTriggerAuthorization Resolve(Assembly assembly)
{
var type = assembly.GetLoadableTypes()
.SingleOrDefault(p => p.GetInterface("IOpenApiHttpTriggerAuthorization", ignoreCase: true).IsNullOrDefault() == false);
Copy link
Contributor

Choose a reason for hiding this comment

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

This may throw an exception if there are more than one implementation. Like OpenApiConfigurationOptionsIgnoreAttribute, we might need to add this attribute class and filter it.


namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.FunctionApp.InProc.Configurations
{
public class OpenApiHttpTriggerAuthorization : DefaultOpenApiHttpTriggerAuthorization
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use this as MyOpenApiHttpTriggerAuthorization ?


namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.FunctionApp.InProc.Configurations
{
public class MyOpenApiHttpTriggerAuthorization : DefaultOpenApiHttpTriggerAuthorization
Copy link
Contributor

Choose a reason for hiding this comment

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

And remove this?

Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

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

@jackbatzner Thanks for your contribution! It LGTM

@justinyoo justinyoo merged commit 5dfe8cc into Azure:main Aug 22, 2022
@justinyoo justinyoo added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 22, 2022
@justinyoo justinyoo added this to the Release 202208 - v1.4.0 milestone Aug 22, 2022
Derich367 pushed a commit to Derich367/azure-functions-openapi-extension that referenced this pull request Aug 31, 2022
Derich367 pushed a commit to Derich367/azure-functions-openapi-extension that referenced this pull request Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request v1.4.0
Projects
None yet
2 participants