Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Introduce a base type for executing auth and resource filters. #5575

Closed
wants to merge 1 commit into from

Conversation

pranavkm
Copy link
Contributor

No description provided.

@pranavkm
Copy link
Contributor Author

GitHub is suppressing the diff for the file changes because it's too large. 😞 Should I send an offline review for this?

Copy link
Member

@rynowak rynowak left a comment

Choose a reason for hiding this comment

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

ResourceInvoker didn't show up in the changelist for me. Did you forgot it?

ControllerContext controllerContext,
IFilterMetadata[] filters,
ObjectMethodExecutor objectMethodExecutor)
: base(diagnosticSource, logger, controllerContext, filters, controllerContext?.ValueProviderFactories)
Copy link
Member

Choose a reason for hiding this comment

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

when can ControllerContext be null?

{
await Next(ref next, ref scope, ref state, ref isCompleted);
}
await InvokeFilterPipelineAsync();
Copy link
Member

Choose a reason for hiding this comment

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

Ideally everything in this method should be in the base class. Nothing here is specific to controllers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is. We kick off the invocation from the subtype, and get called back at the end of resource filter invocation.

Copy link
Member

Choose a reason for hiding this comment

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

We kick off the invocation from the subtype

Whatever the opposite of that statement is, that's what I am suggesting,

finally
// The invoker is implemented using a 'Taskerator' or perhaps an 'Asyncerator' (both terms are correct
// and in common usage). This method is the main 'driver' loop and will call into the `Next` method
// (`await`ing the result) until a terminal state is reached.
Copy link
Member

Choose a reason for hiding this comment

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

IMA let you finish but there are some of the best comments of all time.

@@ -1455,7 +1010,6 @@ private static void Rethrow(ResultExecutedContext context)
private enum Scope
{
Invoker,
Copy link
Member

Choose a reason for hiding this comment

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

Can the state here ever be Invoker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could call this Outer. But it's basically the beginning of the "inner" loop.

Copy link
Member

Choose a reason for hiding this comment

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

So then the scope here is Resource since we're inside resource filters

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I'll rename it.

FilterAsync = filterAsync;
}

public int Index { get; }
Copy link
Member

Choose a reason for hiding this comment

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

Drop the index from this, it's never used

@pranavkm pranavkm closed this Jan 3, 2017
@pranavkm pranavkm deleted the prkrishn/ResourceInvoker branch January 3, 2017 19:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants