Archived

This forum has been archived. Please start a new discussion on GitHub.

Adding Invocation Context

I preface this question by indicating that I'm coming from a CORBA background so if its simply a matter of pointing me in the right direction then please do so.

In another topic I raised the issue of security and to a lesser degree credentials. When I used CORBA before, I ran into the issue that support in the resident ORB of the day was insufficient to support even a simple GSSUP-based model. So, we created tokens and piggy-backed them atop requests using a ServiceContext.

If I need to implement a similar model in ICE, what is the best way to approach that. I've seen the Ice.Context, but its unclear how it could be used without explicitly calling methods that take the context. Even then, my understanding of what the Context is could be completely wrong.

Thanks in advance and btw, this really does look like a decent maturing product.

Comments

  • Well I think part of this I've answered myself. The Ice.Context is a pretty rough equivalent that by default comes from __defaultContext(). I looked through the code, but it wasnt readily apparent to me how one changes this.

    It appears the proxy uses the reference to answer the question. I'd assume that there is one reference per referant to a servant, but that may be incorrect. Even so, the reference is initialized with context or none at all. If none at all it uses _emptyContext. I could end up backtracing this to the construction of the reference, but I figure its better to ask here.

    How does one set a default context for (a) all objects or (b) a specific set of objects (i.e. by type or classification).

    My reference frame for this is the C# -- IceCS distribution 2.1.1
  • matthew
    matthew NL, Canada
    I don't think using Context in this way is a very good model. I would recommend using sessions which are validated using Glacier. The session is then tied to the set of credentials that the session was initial authenticated with. The session should then facade all requests to the backend server.

    That being said, to answer your question. If you want a given context to be sent by default with all requests then call setDefaultContext on the communicator object.

    Regards, Matthew