A Groovy Apache Fortress
Shawn McKinney
A presentation from ApacheCon @Home 2020
https://apachecon.com/acah2020/
Of late, some experimentation around a couple of API sets, specifically AccessMgr and AdminMgr in Apache Fortress, a Role-Based Access Control system. The goal: To simplify and enhance the API interactions with Apache Fortress specifically, and security authorization systems in general. Admittedly, the fortress managers have grown over the years, both in number of methods, and their complexity. That is, as new use cases or features pop up, say dynamic constraints placed on roles, new APIs must be invented to handle the new patterns. While this is a good thing, the system’s evolving/adaptable, it’s bad from the standpoint of the number of methods users must learn, and having to maintain new method entry points into the system. Let’s take the [AdminMgr](https://github.com/apache/directory-f...) for example. It has over 50 public methods! Perhaps understandable when one considers all of the entities that are being processed. But also highly complicated and confusing for someone who is new to the space. What does groovy got to do with it? Enter Apache Groovy. As most of you know, a dynamic scripting language that sits on top of the Java virtual machine. It accelerates development through the elimination of boilerplate and bringing some convenience to longstanding irritations in the platform. Things like checked exceptions, brackets, even semi-colons are no longer required. Here it brought the means to rapidly iterate over some design patterns, in order to find easier to use call/response flows. The new GroovyAdmin manager has really just one method! Basically, the ‘doIt' passing an operation and entity names, along with a map, that contains the model (data). The map maps directly to the fortress model, using the same entity names and attributes. Similarly, the Access manager can be simplified. No longer do we need many methods to create the session (for example). Again, only one method, start, is needed. Again passing only a map containing the operands pertinent to the requires. One envisions how this API pattern works in a service-based setting. Instead of calling a groovy function, the client would invoke a service, passing a JSON map with the data. But it's expensive to code API gateways and so Groovy helps in the prototyping phase. It allows us to quickly get up to speed, giving more freedom to experiment with new ideas, possibly leading to more improvements and growth within the target systems themselves.
Code Monkey
Auf dieser Seite können Sie das Online-Video A Groovy Apache Fortress mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer The ASF 22 Oktober 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 277 Mal angesehen und es wurde von 5 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!