23 Oct, 2014
4 commits
-
We can now differentiate between the time globally spent inside a filter and the time spend in the code of this filter: we simply excludes the time spent outside of this filter (when calling the next handler) git-svn-id: https://svn.forgerock.org/openig/trunk@649 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
With pausable/resumable LogTimer(s) it's possible to define more precise boundaries when counting time spent inside of a method. git-svn-id: https://svn.forgerock.org/openig/trunk@648 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
Notice that we kept them for GatewayServlet since this is not itself a Filter/Handler (so not decoratable) and that we may be interested in time spend in its service() method (Exchange creation and configuration may be significant) git-svn-id: https://svn.forgerock.org/openig/trunk@647 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
The timer decorator factorize some very common code in all of our filters handlers: LogTimer timer = logger.getTimer().start() /// ... timer.stop() git-svn-id: https://svn.forgerock.org/openig/trunk@646 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
22 Oct, 2014
1 commit
-
- Negatives values are no longer registered. - Reactivated corresponding unit test. git-svn-id: https://svn.forgerock.org/openig/trunk@642 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
21 Oct, 2014
3 commits
-
This decorator can be applied on any Filters or Handlers whose input/outputs needs to be observed. This decorator prints the message's values in the observed component's logSink or in its own configurable logSink (if one was specified). Multiple observation points can be specified depending on what you're interested in. Observation points for Filter: --- -- (request) -> | | -- (filtered-request) -> | F | <- (filtered-response) -- | | <- (response) -- --- Observation points for Handler: --- -- (request) -> | | | H | <- (response) -- | | --- git-svn-id: https://svn.forgerock.org/openig/trunk@637 dbb9e58e-28e6-4ce0-90e8-f11d9605b710 -
Decorators have the unique capability of transforming heap objects: they can encapsulate the original object into another compatible one (they still have to share the same interface), they can post-configure instances, ... Two levels of decorations are supported: per-instance and global. Global decoration allows to share widely a decoration for all objects managed inside of a Heap. This is very useful to avoid writing the same decoration over and over for each heap object. Per-instance decoration permits to selectively apply decoration on some instances. That can be very useful if you want to focus on a given heap object, without impacting others. Here is an example of decoration configuration for an instance: { "name": "Handler", "type": "ClientHandler", "capture": "request" <-- the decoration } An arbitrary number of decorations can be applied on any instance. The attribute name has to match a heap object name of the wanted decorator. The attribute value is the configuration that will be passed to the decorator when asked to decorate the heap object instance. Decorators have to be declared in the /heap/objects list, just like any other heap objects. The name of a decorator is the key that will be used to lookup the right decorator in the heap when decorations are processed. Global decorations are Heap-scoped decorations: all heap objects provided/managed by a given Heap will be decorated with that special decorator. They are inherited between heaps. Global decorations are enabled when a /heap/decorations object in the JSON configuration (system config or route config) is found. Each attributes of that object are representing a decoration configuration to be applied on heap objects. Example of global decoration configuration: { "heap": { "objects": [ ... ], "decorations": { "decorator-name": a JSON node representing the decoration config ... } } } Notice that, in order to prevent infinite recursions, decorators cannot be decorated themselves. git-svn-id: https://svn.forgerock.org/openig/trunk@635 dbb9e58e-28e6-4ce0-90e8-f11d9605b710 -
This case can happen when a component tries to resolve twice the same object declaration. This is unlikely to happen without any decorator support because all the heap interactions are going on in one place and it's easy to refactor the code to only resolve a declaration once. But when decorators comes into play, it's no more easy to share resolved objects references around. git-svn-id: https://svn.forgerock.org/openig/trunk@634 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
15 Oct, 2014
3 commits
-
- Reorganized imports. - Removed extra spaces. - Closed previously 'omitted' inputstreamreader in RouteBuilder. (OPENIG-312) git-svn-id: https://svn.forgerock.org/openig/trunk@623 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
Consider using Jackson for parsing the JSON configuration - Renamed JsonValueUtil to Json. - Renamed JsonValueUtilTest to JsonTest. git-svn-id: https://svn.forgerock.org/openig/trunk@622 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
configuration - Remove json simple from openig pom file configuration. (added com.fasterxml.jackson.core / databind) - Jackson throws now IOExceptions instead of json exceptions. - Added unit tests. - Fixed javadoc. git-svn-id: https://svn.forgerock.org/openig/trunk@621 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
24 Sep, 2014
1 commit
-
The "config" attribute is now optional and the declaration can be omitted for a better understanding/lisibility. Unit tests added. git-svn-id: https://svn.forgerock.org/openig/trunk@590 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
17 Sep, 2014
1 commit
-
This patch removes arbitrary use of exchange.session, but also shows using JwtSession where it could make sense, as in the federation tutorial. git-svn-id: https://svn.forgerock.org/openig/trunk@581 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
15 Sep, 2014
3 commits
-
Heap.get(String):Object gains type safety Heap.get(String, Class<T>):T Heap.getRequiredObject(JsonValue, Class<T>) has a shorter name Heap.resolve(JsonValue, Class<T>):T Heap.getObject(JsonValue, Class<T>) is replaced by a resolve variant that supports optional dependencies: Heap.resolve(JsonValue, Class<T>, boolean):T git-svn-id: https://svn.forgerock.org/openig/trunk@572 dbb9e58e-28e6-4ce0-90e8-f11d9605b710 -
Inline object declarations are a mean to ease understanding of Exchange processing. They permit to describe anonymously, inner objects when a reference to another heap object is required. That introduce, in the configuration files, some hierarchical support, easing the user to mentally represents his processing chain. This is done in a fully backward compatible way, without requiring any changes to existing object declarations (the one that requires other objects through references or names). The idea is to automatically extract inline declaration when the Heaplet is calling the get***Object() methods: if the provided JsonValue is a String, traditional object lookup is performed, but when the JsonValue represents a JSONObject (a Map), we try to turn this into a normal object declaration (just like what is done during heap initialisation). If the given JsonValue does not describe a valid declaration, a JsonValueException is thrown (again, just like the heap init process is doing). Notice that inline declarations do not require a 'name' attribute to be specified (like anonymous Java classes), so we generate a unique name based on the JsonPointer (represents the location of the node in the JSON structure). Notice that OPENIG-316 is partly resolved in this commit: HeapUtil methods have only been moved into the Heap interface: no additional type safety, no renaming. git-svn-id: https://svn.forgerock.org/openig/trunk@571 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
10 Sep, 2014
1 commit
-
OpenIG used to provide a default Session implementation based on the underlying Servlet container's HttpSession. This changeset intends to gives to the user the ability to change the session persistence strategy (in other words: changing the Session implementation). This can be done at the global level (in the config.json, declaring a SessionFactory object named 'Session') or on a per-route basis (with the new 'session' attribute). When an Exchanges comes into a route that declares a new session type, a new session is build (no existing session items are propagated) and replace the old session. When the exchange exits the route, the new session is closed (notify the session that it's time to persist its content) and is replaced by the old one. Really like a push/pop stack mechanism. Notice that the 2 sessions are completely separated (cannot access the old content from the new and vis-versa). First, that would defeat the purpose of different session persistence modes (if items are propagated, where should I persist them ?). Secondly, Session is not intended to share data between handlers/filters: the Exchange is basically a request-scoped Map that is designed for that purpose. The JWT based session is a session implementation whose persistence is done using an HTTP Cookie, the session's content being serialized as JSON (usable types are constrained, see list below) and used as the payload of an encrypted JSON Web Token (JWT). The use of the JWT session has a few constraints: * HTTP Cookies are size-limited to 4K -> Small objects can be stored * Only JSON compatible types are supported: * null * Java primitive types + their boxed equivalent * Strings (and any CharSequence) * List and Map (of the supported types, recursively) * Same client performing concurrent HTTP invocations (so within the same HTTP session) that will modify their own session content will see inconsistencies in the session. This is due to the fact that the JWT session is not shared, each concurrent Thread has its own instance and can modify it at will. At the end of the processing, each Thread will serialize its own session's content regardless of other Threads. git-svn-id: https://svn.forgerock.org/openig/trunk@565 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
08 Sep, 2014
2 commits
-
git-svn-id: https://svn.forgerock.org/openig/trunk@562 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@561 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
05 Sep, 2014
4 commits
-
This change eases references resolution when they are provided as a JSON String array (like ["RefOne", "RefTwo"]). git-svn-id: https://svn.forgerock.org/openig/trunk@559 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
KeyStore and related security objects are being more and more central to OpenIG: * Used by HttpClient * Needed for encryption / decryption This patch is a first step to provide a way to configure theses as usual heap objects (through JSON). KeyStore heap object is an abstraction around the keystore file (either JKS, PKCS12 or other depending on the platform capabilities). Specifying a password or not depends on he usage: * If KeyStore will be used to read private credentials (through a KeyManager for example), a password is required * If not (for a TrustManager), no password is required KeyManager and TrustManager are using a KeyStore heap object and are used within SSL mechanism (SSLContext) to provide a view on the KeyStore: * KeyManager when private credentials access is required. * TrustManager when only public information access is required Issues: OPENIG-295 Reviews: CR-4441 git-svn-id: https://svn.forgerock.org/openig/trunk@557 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
The previously introduced evaluate() method was a step in the right direction, allowing resolution of static (no references to ${exchange}) string JsonValue, returning a simple resolved String. While it works great, it's a shame that we don't benefit anymore of the JsonValue API, in particular the conversion methods (asURL(), ...). This fix uses a JsonTransformer to actually resolve any String wrapped JsonValue and creates a deep copy of the given JsonValue. git-svn-id: https://svn.forgerock.org/openig/trunk@556 dbb9e58e-28e6-4ce0-90e8-f11d9605b710 -
When a new heap object instance has to be created, we first have to find a Heaplet instance that will create the required object from the given JSON configuration. Heaplet instances are linked to the single object they created: they manage the heap object lifecycle with the start() and destroy() methods. The old behaviour was using Heaplet instances directly loaded and instantiated, meaning that a single Heaplet instance could be used to create multiple heap objects, somehow mixing states, which was very wrong. Now, HeapletFactory (instead of direct Heaplet) are found using the ServiceLoader discovery mechanism. They are responsible to create new Heaplet instances, meaning that we cannot anymore share a Heaplet instance for 2 or more heap objects. Heaplet class does not extends Indexed<Class> anymore (was only used because of the way Heaplets was looking for Heaplet instances). NestedHeaplet is now deprecated since its only duty was to implement the Indexed interface. All references to NestedHeaplet were replaced to GenericHeaplet (its parent class) in our code base to avoid ugly compiler warnings. As per OPENIG-302 comments, the HeapletFactory will be a short-lived concept since this additional layer introduction was the straw that broke the camel's back :) Issues: OPENIG-302 Reviews: CR-4457 git-svn-id: https://svn.forgerock.org/openig/trunk@555 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
26 Aug, 2014
1 commit
-
- Added unit tests. git-svn-id: https://svn.forgerock.org/openig/trunk@536 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
25 Aug, 2014
1 commit
-
git-svn-id: https://svn.forgerock.org/openig/trunk@529 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
21 Aug, 2014
1 commit
-
git-svn-id: https://svn.forgerock.org/openig/trunk@514 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
08 Aug, 2014
2 commits
-
git-svn-id: https://svn.forgerock.org/openig/trunk@507 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@502 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
04 Aug, 2014
1 commit
-
* Request.getEntity() never returns null, so it can't be used to determine if the request had a content or not * Added an isEmpty() method for this purpose * Updated HttpClient to use Entity.isEmpty() git-svn-id: https://svn.forgerock.org/openig/trunk@461 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
03 Aug, 2014
7 commits
-
* Non-expression values are still supported (fixed/static expression like "http://www.example.com") *Expressions are evaluated at runtime against the executed Exchange ("http://${exchange.host}:8080" will be resolved against the Exchange) * If evaluated expression returns null (evaluation error, or null result of a successful evaluation), a HandlerException is thrown * Added test case git-svn-id: https://svn.forgerock.org/openig/trunk@457 dbb9e58e-28e6-4ce0-90e8-f11d9605b710 -
* By default, the new Request is kept in the Exchange * If enabled, the original Request is restored in the Exchange git-svn-id: https://svn.forgerock.org/openig/trunk@454 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
They are currently not working, so I disabled them for now git-svn-id: https://svn.forgerock.org/openig/trunk@453 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@452 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@446 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
* Request.uri is now a MutableUri * Removed UriResolver since it was useless with both this new feature and the BeanResolver git-svn-id: https://svn.forgerock.org/openig/trunk@444 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
… order to add addition "enhanced" getters and setters for fields Provide better APIs for interacting with Message entities. Previously we were stuck with the esoteric BranchingInputStream which makes entities very hard (impossible?) to use in expressions and Groovy. * methods for getting the entity's content as JSON or as a plain String * methods for setting the entity's content to JSON or String data * simplification (I hope) of the branch life-cycle management * make Message closeable, delegating close to the entity and onto the branching input stream, allowing us to avoid alot of null-checking boilerplace. git-svn-id: https://svn.forgerock.org/openig/trunk@443 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
31 Jul, 2014
2 commits
-
… order to add addition "enhanced" getters and setters for fields More mechanical changes: * add encapsulation for cookies * required equals/hashCode implementations for unit tests. git-svn-id: https://svn.forgerock.org/openig/trunk@433 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
… order to add addition "enhanced" getters and setters for fields * perform mechanical changes to encapsulate fields for Message, Request, and Response * added Javadoc for getters and setters * Message no longer extends FieldMap since the expression library leverages the BeanResolver. Remaining non-mechanical changes (e.g. adding enhanced getters/setters) will be performed as separate changes. git-svn-id: https://svn.forgerock.org/openig/trunk@430 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
30 Jul, 2014
2 commits
-
Main entry point is OAuth2ClientFilter Supports: * OAuth 2.0 "authorization code" grant type * automatic token refresh * proactive and reactive authorization for SSO * user initiated login / logout * OpenID Connect Relying Party * OpenID Connect discovery via "well-known configuration" * multiple providers and optional "Nascar" page * session based persistence * CSRF prevention via 160 bit state nonces * manually tested against OpenAM 11 and Google. TODO: * more unit testing * cookie based session management via encrypted JWT tokens * attribute mappings per provider? (TBD) * consider replacing default login/logout URLs with handlers? git-svn-id: https://svn.forgerock.org/openig/trunk@424 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@420 dbb9e58e-28e6-4ce0-90e8-f11d9605b710