| Issue 17: | Optional encrypt of a place token | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Add an optional flag (maybe an annotation) to mark a place as encrypted.
Sep 16, 2010
Project Member
#1
gal.dol...@gmail.com
Status:
Fixed
Sep 16, 2010
Hello!
1. How use @PlaceDataEncrypted?
2. In PlaceManagerImpl.java:
public void onTokenChange(String token) {
...
data = typeJsonSerializer.deserialize(JSONParser.parse((encrypted ? Base64.decode(json) : json)));
...
}
Can be it is necessary to make as follows:
- add Crypter interface with encode/decode functions, class Base64 implements Crypter
- create any new class implements Crypter and set your own methods encode/decode
- set Crypter class for using in
public void onTokenChange(String token) {
...
data = typeJsonSerializer.deserialize(JSONParser.parse((encrypted ? Crypter.decode(json) : json)));
...
}
?
That will define your functions encode/decode, you can convert json format to userlike kind of link.
For example http://localhost/#example|&par1=val1&par2=val2 instead of http://localhost/#example|{"par1":"val1" "par2":"val2"}
Sep 16, 2010
A quick documentation: If you want all your places to get encrypted: <set-configuration-property name="app.encrypt.place" value="true" /> Otherwise annotate the places you want to encrypt with @PlaceDataEncrypted The default crypter is base64. To use your own you have to turn off the default: <set-configuration-property name="app.encrypt.base64" value="false" /> And bind you crypter in you gin module: bind(Cryper.class).to(JsonToUserlikeCrypter.class);
Sep 16, 2010
Big thanks! :) |