Does this fit a specific pattern?

Some time ago I found a mechanism for protection

  • control flow
  • and all parameters

web applications (controllers) for highjacking .

This method provides the following:

  • All request parameters are stored externally.
  • No parameter ever reaches the url
  • application control thread strictly receives state-driven server-side

The basic principle is as follows:

  • Define a FlowController

  • If the web page should include a link to another controller with certain parameters, ask FlowController to prepare a link

  • FlowController does not provide the link directly, but maintains a server-side state that stores all the information associated with the link [controller class, called, arguments to pass)

  • Ultimately, the FlowController does not return the actual link, but a random hash value that identifies server-side status

  • After the hashed link returns from the browser, it is passed to the FlowController, which looks at the associated state and controls the creation of the controller instance and passing arguments . >

Effects:

  • No link can be predicted.

  • Therefore, the controller cannot be called without obtaining permission from the FlowController.

  • All parameters retrieved form FlowController managed state passed to controllers can be trusted safely .

Wherein:

  • FlowController manages link states using the stack

  • FlowController provides return points: FlowControler :: TerminateFlow () forces the application to restore the last return point.

  • If the FlowController asks you to start a non-top thread, it will automatically delete all the threads above. Thus, if you return to an earlier state of the application, all subsequent states automatically become invalid.

Consequences:. You can call up certain sequences of operations — sequences of controllers — in pure subroutine mode: request a return point for installation. Start the first workflow controller. In the end, some controller will call FlowControler :: TerminateFlow (), and the control flow will return to the caller’s environment.

Note that the first controller to be called - the more general entire workflow of several controllers - does not know which other part of the applications requested its execution . The initiator of the workflow launched it using the “fire and swelling” mode: the workflow will eventually return to me. At some point, the workflow signals that this is being done. Important: It does not request a specific continuation controller. Thus, the workflow is completely separate from any caller.

Since I have never seen such a mechanism within the framework, I wonder if this is a new template.

Question: Is this a new template? If not, which template does it match?

PS: My other question contains details about how I found the template.

-1
source share
1 answer

This seems to be a combination of several templates, but if I were to choose one, I would say that this is the "Mediator"

+1
source

Source: https://habr.com/ru/post/902490/


All Articles