Migration of existing Gluu scripts to Agama? #12435
Replies: 4 comments 3 replies
-
|
perhaps as easy as allowing code entry in the agama lab flow window (there's an import, but it's expecting json)? |
Beta Was this translation helpful? Give feedback.
-
|
No, we have no plans to do this. 1) You can still use interception scripts in Jans Auth Server... so there is no requirement to migrate. 2) Interception scripts are asynchronous, whereas Agama scripts are sequential. |
Beta Was this translation helpful? Give feedback.
-
It's unlikely we could build and offer such tool in the future
They are totally different paradigms. In Agama, flow structure and business logic are separated. In scripts, both things are intertwined
Import feature is to be able to supply a diagram (a flow chart). If you check your repository, there are json files alongside flow files in the
What nynymike actually meant is that control is inverted. In interception scripts you think/design in terms of step 1, step 2, etc., and in the script execution, the respective methods (prepare, authenticate, etc.) are called at every step and passed certain arguments In Agama, code is executed as in a regular computer program, starting with the first line and advancing to the next, until no more instructions are left - giving a sense of linear execution. In scripts, there is a "controller" logic that decides what methods to call and when. If someone reads a script from top to bottom, there is no way to get a good idea of what's happenning there
They are not tied to a single thread per user
As in the case of interception scripts, with Agama you have to know of certain classes available in the authentication server classpath. If you already have some experience with scripts in Janssen, you end up using the same classes
Gluu (
Modularity and reuse are the most important things that set Agama apart from interception scripts. The way you design is up to you, however there are some good practices to consider: https://docs.jans.io/stable/janssen-server/developer/agama/agama-best-practices/ Because flows look and behave like functions seen in classical imperative programming, you just need to follow the same principles used in everyday coding. Since flow diagrams can take a lot of screen space, you may have to break down stuff more than usual
The projects in the catalog: https://github.com/orgs/GluuFederation/repositories?q=agama are not really simplistic. Most of them are made up of a flow that calls other flows in turn
That's true. We hope people to reuse those flows in their own projects. |
Beta Was this translation helpful? Give feedback.
-
|
Excellent info, thanks much! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Any chance there's a migration capability, to take existing scripts from a gluu implementation into an agama flow?
Beta Was this translation helpful? Give feedback.
All reactions