Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow tokens to be provided via properties files #1483

Merged
merged 60 commits into from
Sep 16, 2015

Conversation

andy-berry-dev
Copy link
Member

BladeRunnerJS/brjs-site#113 is an associated PR which contains docs updates.

Andy Berry added 27 commits July 9, 2015 12:24
instead of implying the exception via a null value
TokenFinder exception to TokenReplacementException
reader so it can be decoupled from BRJS when it logs warnings
in a single message don't have to verify several messages that arent
applicable to the test
@andy-berry-dev andy-berry-dev added this to the 1.1 milestone Jul 30, 2015
@dchambers
Copy link
Contributor

The exception for the invalid token XXX can be fixed by adding XXX=@xxx@ to app-properties/default.properties.

Yes, let's do it that way since then we can point other people at this work around if they ever hit the same issue.

@thecapdan
Copy link
Contributor

Hi @andyberry88 . A few issues with this one.

1: The js bundle is truncated when I load the dashboard or any app on this build. This is the end of my dashboard bundle:

var FieldValuePropertyListener = require('br/presenter/node/FieldValuePropertyListener');
var ValidSelectionValidator = require('br/presenter/validator/ValidSelectionValidator');
va

2: Even when I include default.properties file with a replacement for my token, I still get the following error:

Caused by: org.bladerunnerjs.appserver.util.TokenReplacementException: An error occurred when the token finder 'JndiTokenFinder' attempted to locate a replacement for the the token 'IIII'.
        at org.bladerunnerjs.appserver.util.JndiTokenFinder.findTokenValue(JndiTokenFinder.java:38)

3: Can we have some nice docs on how to use this feature?

@andy-berry-dev
Copy link
Member Author

1: The js bundle is truncated when I load the dashboard or any app on this build. This is the end of my dashboard bundle:

This was caused by the incorrect encoding being used when calculating the Content-Length header and the browser truncating the response based on the header value being too small. Now fixed.

Even when I include default.properties file with a replacement for my token, I still get the following error:

I can't reproduce this. Tokens are working without any problems for me. Waiting for @thecapdan to confirm is this now works.

Can we have some nice docs on how to use this feature?

Docs changes branch is at BladeRunnerJS/brjs-site#113.

@andy-berry-dev
Copy link
Member Author

The exception for the invalid token XXX can be fixed by adding XXX=@xxx@ to app-properties/default.properties.

This doesn't quite work. Replacing @XXX@ with @XXX@ gets past the 'static' replacement but because the token is still there the JNDI token filter tries to replace the same thing and blows up because there is no replacement. The fix is to replace @XXX@ with @xxx@ since BRJS only supports uppercase characters in the token format. So app-properties/default.properties should look like XXX=@xxx@. I've verified with work in amCharts with @thecapdan.

@thecapdan
Copy link
Contributor

the 3 issues i described above have been addressed and fixed.

the suggested solution for the @III@ tokens did not work, changing the tokens to lowercase will work, i.e. IIII=@iii@

there's an encoding issue when we run the tests on windows, andrew is having a look

thecapdan added a commit that referenced this pull request Sep 16, 2015
…-749

Allow tokens to be provided via properties files
@thecapdan thecapdan merged commit 86333cd into develop Sep 16, 2015
@thecapdan thecapdan deleted the allow-tokens-static-files-749 branch September 16, 2015 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants