-
Notifications
You must be signed in to change notification settings - Fork 0
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
Starcounter.Authorization should not create Starcounter.Session unless required #91
Comments
I checked For now i see 2 differences, in the case of REST-API we have:
So for now as the solution i could suggest to use one of these options to filter such requests on the same line (https://github.com/Starcounter/Starcounter.Authorization/blob/3.x/Authorization/Authentication/TicketCreationStartupFilter.cs#L21) as we do for the |
We can't filter API requests by the HTTP method. There are APIs which are I think, that Like a lazy loading, don't create it unless someone is trying to fetch it. REST API may also use |
@miyconst wrote. Rest API handler is not necessarily returns JSON, it may return nothing, just a string, xml, or even a view-model, which is going to be serialized into JSON. |
Since its the This can also have side effects though. |
@habib535 in the case of Rest calls many times there will be no ViewModel...so we can't add a property that says skip me..when the viewmodel itself is not needed when doing rest calls. |
Hi everyone, @kegor , @miyconst . In Cronofy I had Rest callbacks from Cronofy working before, but now they are blocked and never reach my code, Cronofy gets a 404 response. |
Hi guys, on this line https://github.com/Starcounter/Starcounter.Authorization/blob/3.x/Authorization/Middleware/SecurityMiddleware.cs#L33 method |
@LarsTjernstrom could you debug |
@miyconst @LarsTjernstrom If the request is not from a viewmodel (Startup library) but our own @kegor |
@miyconst The root cause was Not Starcounter.Authorization, so we can delete those comments. |
@LarsTjernstrom you can always register a dynamic URL, for example: Handle.GET("/app/callback/{?}", (string uri) =>
{
if (uri != this.GetCustomerCallbackUri())
{
return 404;
}
// Process callback.
return 200;
}); |
Hi @miyconst, @mtornwall, @habib535 could you please share your vision on the things that are left here to do? I'm not sure on 100% that i have clear understanding. |
By the information from Konstantin:
So this is on hold for now. |
It turns out that
Starcounter.Authorization
will create newStarcounter.Session
for every request, even if it's a simple REST API request.This is very inefficient, because every REST API request would create a new
Starcounter.Session
which won't be used any more, but will consumer resources and eventually die with a timeout.This session spawn leads to the following exception under high load of REST API.
The text was updated successfully, but these errors were encountered: