18 Feb, 2015
2 commits
-
In order to match the classname to test, I rename the class FunctionTest to FunctionsTest. git-svn-id: https://svn.forgerock.org/openig/trunk@901 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
This patch adds a handler to generate a DES key. By using the handler, the reader can avoid the convoluted steps for generating a key with OpenAM. Applied review suggestions from Guillaume git-svn-id: https://svn.forgerock.org/openig/trunk@900 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
17 Feb, 2015
2 commits
-
Add a convenient method to evaluate an Expression that do not require any scope. git-svn-id: https://svn.forgerock.org/openig/trunk@898 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
The type of an Expression is now given at the creation time, which means we do not provide it anymore for the evaluation. Furthermore, it helps the developper as it knows the expected type of an Expression. git-svn-id: https://svn.forgerock.org/openig/trunk@897 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
09 Feb, 2015
3 commits
-
git-svn-id: https://svn.forgerock.org/openig/trunk@890 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@889 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@887 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
05 Feb, 2015
1 commit
-
git-svn-id: https://svn.forgerock.org/openig/trunk@883 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
04 Feb, 2015
2 commits
-
git-svn-id: https://svn.forgerock.org/openig/trunk@879 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
The correct way to handle the \\ in the JUEL expressions is to write it like that : ${'\\\\'}. git-svn-id: https://svn.forgerock.org/openig/trunk@878 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
03 Feb, 2015
4 commits
-
This tests was expecting a NPE that was thrown by `new StringReader()`. We were never going into the `readJson()` method... git-svn-id: https://svn.forgerock.org/openig/trunk@874 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@873 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
The soon-to-come Http framework needs a subset of the features provided by `Json`: only what is related to JSON parsing/writing. Everything else is related to `JsonValue` or more OpenIG specific types like `Heap`, `Expression`, ... So this is just a simple split, we now have: * `Json`: JSON parsing * `JsonValues`: OpenIG-related code git-svn-id: https://svn.forgerock.org/openig/trunk@872 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
Created a new class in utils for the StandardCharsets. When we will move to java 7, we just need to remove this file and update the package names to java.nio.charset.StandardCharsets. git-svn-id: https://svn.forgerock.org/openig/trunk@871 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
23 Jan, 2015
1 commit
-
git-svn-id: https://svn.forgerock.org/openig/trunk@852 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
22 Jan, 2015
1 commit
-
As the URI rebasing is done at different places in the code we'd like to have a BaseUriHandler/Filter in order to factor out the code. Following the same scheme as the "Timer" decorator, the "baseURI" decorator is created by default in the Gateway Servlet. (Named "baseUri" and created at startup time in the top-level heap.) * GatewayServlet.class, Route.class The creation of the "baseUri" decorator means the attribute class 'baseURI' is no longer needed as the URI rebasing is now directly done by the decorator. In the other hand, the heap initialization performed within both class constructors, contained a list of reservedFieldNames where the 'baseURI'was present. It has been removed from there as it is now a global decorator. * RouteTest.java Removed unit test 'testRouteIsRebasingTheRequestUri'(Duplicated in the RouteBuilder test, and the RouteBuilder has the responsability to apply decorators). git-svn-id: https://svn.forgerock.org/openig/trunk@843 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
20 Jan, 2015
1 commit
-
The previous commit introduced a regression, especially for GET messages being sent with an empty entity where they should have no entity at all. They were being falsely detected as messages with content because we were comparing `EMPTY_STREAM` with `Entity.head` (the branched content) instead of the `Entity.trunk` (`head` being re-created every time OpenIG tries to read the content, so in the `HttpBasicAuthFilter` for example, we push the Entity, then delegates to the next handler in chain, so when message is sent, the `head` is != from the `trunk` and cannot be == to `EMPTY_STREAM`) I could not reliably reproduce that in a unit test with a real HTTP Server because the failure also need the HTTPClient to re-use the same connection for 2 consecutive messages. Thus, I only added a small `Entity` unit test to make sure that `Entity.mayContainData()` behave correct even when the entity is pushed/popped. git-svn-id: https://svn.forgerock.org/openig/trunk@838 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
19 Jan, 2015
2 commits
-
IDE Eclipse divided by two the spaces length when special chars are used in the line. I choose to trust the IDE instead of checkstyle and diff, my mistake. Output is fine with IntelliJ. Looks like a bug in eclipse. git-svn-id: https://svn.forgerock.org/openig/trunk@837 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
Added unit tests for unicode usage. git-svn-id: https://svn.forgerock.org/openig/trunk@835 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
16 Jan, 2015
2 commits
-
The toString() method is now implemented and tested. We also decide to replace Expression constructor by a more conventional valueOf(...) factory method. A new Expression is now created by Expression exp = Expression.valueOf(<Expression string>); git-svn-id: https://svn.forgerock.org/openig/trunk@834 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
The `Entity.isEmpty()` method relied on `InputStream.available()` returning something different of `0` (zero) to detect if the entity was empty or not. This technic is not reliable enough since the javadoc clearly states that this return the number of bytes that can be read **without blocking**, that means that the result of this method depends on the network (and to some extension to the web container), not entirely on the message. The idea here is to now check if the wrapped stream is the `EMPTY_STREAM` instance to detect if the entity is empty or not. This is better than the old solution because we don't rely anymore on an external `InputStream` implementation, but that will not detect a user provided stream with no data inside. This is why `isEmpty()` has been renamed to `mayContainData()`. There is also a new `setEmpty()` method to mark the entity as empty (simply assign `EMPTY_STREAM` to the wrapped stram field). git-svn-id: https://svn.forgerock.org/openig/trunk@833 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
13 Jan, 2015
3 commits
-
git-svn-id: https://svn.forgerock.org/openig/trunk@821 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@820 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
That introduced an invalid behaviour: loosing the original header information that would be useful for the end server to generate messages with an appropriate contextual information. Reverted r766 & r767 git-svn-id: https://svn.forgerock.org/openig/trunk@819 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
02 Dec, 2014
3 commits
-
git-svn-id: https://svn.forgerock.org/openig/trunk@775 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
`HeapImpl.addDefaultDeclaration()` is now the way to add default object declarations in the heap. Default declarations are only included if no user-provided overriding declaration is found (only works for heap declarations, not for named inline declaration). git-svn-id: https://svn.forgerock.org/openig/trunk@772 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
`ConsoleLogSink` is now rendering each `LogEntry` on 2 lines with a line separator between entries, the objective being to improve console log readability. The first line is the header line and display the timestamp of the event (in the current system Locale), the entry's `LogLevel` and ends with the `Name` (leaf part) of the heap object that is the source of the log statement. ``` MON DEC 01 20:39:16 CET 2014 (INFO) _Router Added route 'oauth2-resources.json' defined in file '/Users/guillaume/tmp/demo/config/routes/oauth2-resources.json' ------------------------------ ``` Notice that a special treatment is done when logging a `Throwable`: a condensed stack trace is printed on the console and if (and only if) the `LogSink` has been assigned a `DEBUG` or `TRACE` level, the full stack trace is printed (independently of the entry's level). ``` MON DEC 01 15:28:10 CET 2014 (DEBUG) ResourceServer Initial token resolution has failed [ OAuth2TokenException] > Initial token resolution has failed [ OAuth2TokenException] > Authorization Server returned an error (error: bad_request, description: Could not read token in CTS) org.forgerock.openig.filter.oauth2.OAuth2TokenException: Initial token resolution has failed at org.forgerock.openig.filter.oauth2.cache.CachingAccessTokenResolver.resolve(CachingAccessTokenResolver.java:62) ... 33 more ------------------------------ ``` A new `stream` property has been added to `ConsoleLogSink` to let the user choose which PrintStream to use for printing messages: * `ERR`: Use System.err (default value, keep compatibility) * `OUT`: Use System.out * `AUTO`: Select System.out for `TRACE` to `INFO` messages, switching to System.err for `WARNING` and `ERROR`. `FileLogSink` implements a machine parseable `LogEntry` rendering: each entry is on one line and includes: * timestamp of the event (in the current system Locale), always have the same length * the entry's `LogLevel`, always 1 word, uppercase * the `Name` (leaf part) of the heap object that is the source of the log statement. * a `---` separator that segregates the beginning of the line (log statement's context) from the entry's message (the rest of the line) Notice that in the case of `Throwable` printing, the full stack trace is printed as commented lines. ``` MON DEC 01 17:46:21 CET 2014 DEBUG ResourceServer --- Initial token resolution has failed # org.forgerock.openig.filter.oauth2.OAuth2TokenException: Initial token resolution has failed # at org.forgerock.openig.filter.oauth2.cache.CachingAccessTokenResolver.resolve(CachingAccessTokenResolver.java:62) # at org.forgerock.openig.filter.oauth2.OAuth2ResourceServerFilter.filter(OAuth2ResourceServerFilter.java:205) # at org.forgerock.openig.decoration.capture.CaptureFilter.filter(CaptureFilter.java:62) ``` git-svn-id: https://svn.forgerock.org/openig/trunk@771 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
01 Dec, 2014
3 commits
-
git-svn-id: https://svn.forgerock.org/openig/trunk@769 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
contains a port number. git-svn-id: https://svn.forgerock.org/openig/trunk@767 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
Indeed, the host http header wasn't replaced when doing a rebaseUri, but not only in this case, with the setUri too. To solve this problem, a simple fix would be to do an update of the headers when getting them. - A unit test has been added for the DispatchHandler case. git-svn-id: https://svn.forgerock.org/openig/trunk@766 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
28 Nov, 2014
2 commits
-
The decorations are now applied in a more intuitive way: * Local decorations are declared inside of the heap object declaration (no changes here) ``` { "type": "Something", "decorator-name": "configuration ..." } ``` * Global decorations are declared in a top-level element called `globalDecorators` and are inherited by sub-heap. ``` "globalDecorators": { "decorator-name": "configuration ...", ... } ``` * Top-level handler decorations are declared as top-level attributes ``` "handler": "NameOfHandler" "decorator-name": "configuration ..." ``` Decorators are applied in this order: 1. local decorations 2. global decorations (inherited first, up to the ones declared in the requester heap) 3. top-level reference decorations (only if the heap object is the main `handler` object and retrieved with `HeapImpl.getHandler()`) Default configuration is now using the top-level reference decoration style. git-svn-id: https://svn.forgerock.org/openig/trunk@761 dbb9e58e-28e6-4ce0-90e8-f11d9605b710 -
This audit framework application maintains hit counters on a per-tag basis. Here is an output sample: ``` { "resources": { "completed": 1, "failed": 0, "flowing": 0 }, "main": { "completed": 12, "failed": 0, "flowing": 1 }, "monitor": { "completed": 11, "failed": 0, "flowing": 1 } } ``` `resources`, `main` and `monitor` being "non-standard" (or user-provided) tags. git-svn-id: https://svn.forgerock.org/openig/trunk@760 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
27 Nov, 2014
1 commit
-
The issue was due to the BeanELResolver involded by the use of Expression which was unable to get the right setter to set the URI. Solution was to create a RequestResolver, to guide it through the setters to get the right one and to finally be able to write the uri as expected. - added RequestResolver.class - added unit tests for the new RequestResolver class. - added unit tests for the AssignmentFilter about URI change. Thanks to Guillaume for his help. git-svn-id: https://svn.forgerock.org/openig/trunk@754 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
20 Nov, 2014
1 commit
-
The audit framework is a new OpenIG API that gives to users a deeper view (and probably a better understanding) of what's going on in the observed OpenIG system. This is an initial version of the audit framework that only supports `Exchange` flow observation: Filters and Handlers will send `AuditEvent` notifications both when an Exchange enters or exists. An `AuditEvent` is a notification that includes meta-information about the observed component emitter of the notification (its `Name` in particular), a timestamp, the exchange being captured and a set of tags that helps to qualify the event. Four tags are supported out-of-the-box: `request`, `response`, `completed` and `exception`. The user can add as many tags as wanted as part of the decoration configuration: "audit": "route-#1" // add a single tag to the decorated component "audit": [ "super-tag", "route-#2" ] // add all of theses tags "audit": boolean, object, ... // any other format will be ignored OpenIG provides a single `audit` decorator by default. Consumers of AuditEvent are `AuditEventListener`, they have to provide their own Heaplet implementation that extends `ConditionalListenerHeaplet`. They'll be automatically notified of emitted AuditEvents and can (optionally) filter the received event using the `condition` configuration attribute (condition is expressed as an `Expression` that needs to evaluate to a boolean). Examples of such event-filtering conditions: ${true} ${contains(tags, 'tag#1')} ${source.name.leaf == 'source'} git-svn-id: https://svn.forgerock.org/openig/trunk@736 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
19 Nov, 2014
1 commit
-
* also added test to ensure that it is possible to inline a route's handler and avoid the need for a heap. git-svn-id: https://svn.forgerock.org/openig/trunk@730 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
18 Nov, 2014
1 commit
-
- Renamed files - Fixed javadoc. - Fixed doc. - Thanks to Mark for his patch on chap-compatibility. git-svn-id: https://svn.forgerock.org/openig/trunk@719 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
17 Nov, 2014
2 commits
-
* updated all tests and default config * issue deprecation warning if heap/objects field is still used. git-svn-id: https://svn.forgerock.org/openig/trunk@718 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@717 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
13 Nov, 2014
2 commits
-
- Changed the default cipher algorithm from "DES/ECB/NoPadding" to "AES/ECB/PKCS5Padding". - Modified/added unit tests according to the new selected default cipher. - Updated javadoc. git-svn-id: https://svn.forgerock.org/openig/trunk@702 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
-
git-svn-id: https://svn.forgerock.org/openig/trunk@701 dbb9e58e-28e6-4ce0-90e8-f11d9605b710