Closed jayhilden closed 10 years ago
@ThomasArdal and @Mpdreamz let me know what you think of my changes. If anything needs tweaking let me know. Also, I'd be happy to be a regular contributor to this project if you'd like any assistance.
Awesome! Will look at it tomorrow.
@ThomasArdal, I just noticed that there is an issue with the web UI, that has been corrected now as well.
I just added a new feature to this pull request: Now there is an Elmah MVC controller to go along with the Elmah.axd. This is very nice because you can then decorate the controller with the same [Authorize] attributes (and custom authorize attribute) that you would with all your other MVC sites.
I think ElmahController is redundant. That's what Elmah.MVC is for, right?
ElasticSearchErrorLogTest.CanGetErrors fails.
As to your comment about the MVC Controller being redundant for my company that was not true. Elmah.MVC provides
[VBClaimsAuthorize(PermissionVerb.View, PermissionNoun.ErrorLog)]
public class ElmahVBController : VBControllerBase
I wanted to provide a sample for anyone else who might be looking to do the more fine grain permissions that we did.
Oh I see. Being an example project and all, having an ElmahController is fine.
@ThomasArdal I just fixed the broken unit test and I made it so that any port can be used, I no longer assume port 9200 (or any port for that matter). The update is much cleaner, using the Uri class instead of string manipulation.
The only outstanding issue is that the test CanGetError is still ignored. Can you elaborate on how I might be able to mock that.
@jayhilden Just change the implementation in the error log class to use Get(Func, GetDescriptor>) instead of Get(string). All that Get(string) does, is call Get(Func, GetDescriptor>) anyway.
I think it would looks something like this:
session.Get
Can't remember the exact syntax. Then you can mock the Get(Func, GetDescriptor>) call.
@ThomasArdal I the code so that it uses the func instead of the static method. I then updated the unit test to mock the func. I think we are good to go.
Thank you very much @jayhilden
happy to help. Are you going to re-package and put the updates on NuGet?
The project is build on teamcity.codebetter.com and a new package is automatically build, every time someone pushes to master. Your changes are already on NuGet:
That's really cool @ThomasArdal, I'll have to take a look at how that works, I've never pushed anything to NuGet before. One thing I noticed on the website is that the dependencies still list the old version of NEST and Newtonsoft. Do those need to be updated manually in the .nuspec file?
Oh you're right. That's the nuspec files which needs an update. Do you mind doing another PR? :)
no problem, I'll create a new issue and see if I can do that this weekend
Created for issue #2
I've made the following enhancements: