Tuesday, October 30, 2018

Re: Hash of a Java Type

The hash is a hash of the class, not the value. It's there to ensure that the client and server use the exact same classes, with the same fields, of the same types, in the same order.
This means that the value is dependent on the version of oVirt that you're using, and only on the version of oVirt. IIRC, you should be able to find them in the serialization policy files, or of course in the JS files running in the browser (the hash is computed at compile-time, not at runtime, at least on the client-side, can't remember on the server)
Whenever you update oVirt, the hashes might change, which means that the way the objects are serialized/deserialized has changed; this means you'll then need to update your proxy to account for the changes.

On Tuesday, October 30, 2018 at 1:51:13 PM UTC+1, Anastasiya Ruzhanskaya wrote:
Are there any ideas about this hash function?

пн, 29 окт. 2018 г. в 11:38, Anastasiya Ruzhanskaya <anastasiya.ruzhanskaya@frtk.ru>:
Hello!
I am trying to build a proxy, which will intercept requests from oVirt and send errors if the action should not be performed. I just need to implement it in such a manner due to some legacy issues with using internal access control.

I think that by importing some information from oVirt I can easily parse the message in order to find the action type and id of the object on which it is performed.

The problem is with the answer: I need to send the valid answer.
I created a user in oVirt which is a read-only user. So, I get the following answer:

//OK[0,0,10,0,471,9,8,1,0,1,0,1,7,0,0,0,1,6,3,5,3,4,3,3,1,0,2,1,1,["java.util.ArrayList/4159755760","org.ovirt.engine.core.common.action.ActionReturnValue/4163585948","java.lang.String/2004016611","VAR__ACTION__SHUTDOWN","VAR__TYPE__VM","USER_NOT_AUTHORIZED_TO_PERFORM_ACTION","vm1","org.ovirt.engine.core.common.errors.EngineFault/2377218566","org.ovirt.engine.core.common.errors.EngineError/1938278732","ENGINE"],0,7]

I think the answer should be always pretty the same (maybe only for some cases another one). The only thing which I find tricky here is how to generate a valid hash value?

I found a function in sources of GWT but it accepts a serialization policy and the custom serializers (which is not appropriate for me as for incoming requests I will always look for action type and then object, and for answers I want just to generate this type errors, which I provided above, so I want to include to my proxy as minimum additional information as possible).

So, I would like to find an easy way of generation this hash values (org.ovirt.engine.core.common.errors.EngineFault/2377218566). Or probably it is even possible not ti generate them at all?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment