-
Notifications
You must be signed in to change notification settings - Fork 195
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
Conversation
7bed8fa
to
208f5a6
Compare
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.
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); |
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.
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 |
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.
Can we use this as MyOpenApiHttpTriggerAuthorization
?
|
||
namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.FunctionApp.InProc.Configurations | ||
{ | ||
public class MyOpenApiHttpTriggerAuthorization : DefaultOpenApiHttpTriggerAuthorization |
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.
And remove this?
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.
@jackbatzner Thanks for your contribution! It LGTM
Address #434.
Ready for review @justinyoo