Code Monkey home page Code Monkey logo

Comments (11)

wip-abramson avatar wip-abramson commented on August 17, 2024

I also see this optional body in the Swagger docs which we are not tracking at all:

{
  "mediation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "metadata": {},
  "recipient_keys": [
    "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
  ],
  "routing_keys": [
    "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
  ],
  "service_endpoint": "http://192.168.56.102:8020"
}

from aries-cloudcontroller-python.

wip-abramson avatar wip-abramson commented on August 17, 2024

Also can we review accept_connection(). This is a helper function combining receive_invitation and accept_invitation. However in doing so we lose ability to pass arguments into these functions.

Suggest we add arguments from both the this function. Not sure. Perhaps we shouldn't even have this helper method as it might confuse people?

from aries-cloudcontroller-python.

wip-abramson avatar wip-abramson commented on August 17, 2024

receive_invitation() also seems to use string boolean values instead of actual bool for auto_accept

from aries-cloudcontroller-python.

wip-abramson avatar wip-abramson commented on August 17, 2024

There also seems to be some funny behavior going on with the create_invitation auto_accept argument. This actually is a bool. But for some reason it only works if False is passed in. If I set this to True I get the following error msg:

TypeError: Invalid variable type: value should be str, int or float, got True of type <class 'bool'>

Seems weird. Also if I set it to "true" it works. Thinking possible its because we define this as auto_accept: bool: None?

Not sure. Otherwise could even be an ACA-Py bug. Worth exploring

from aries-cloudcontroller-python.

wip-abramson avatar wip-abramson commented on August 17, 2024

Similarly happens with the receive_invitation auto accept argument hmm.

from aries-cloudcontroller-python.

wip-abramson avatar wip-abramson commented on August 17, 2024

Ah I think I might know whats going on. See controllers/base.py the admin_request function. I think we need to make sure the params is a JSON serialized object.

Not actually confident what this line does but don't think it does that.

        params = {k: v for (k, v) in (params or {}).items() if v is not None}

from aries-cloudcontroller-python.

morrieinmaas avatar morrieinmaas commented on August 17, 2024

Currently the create_invitation function specifies optional parameters public and multi_use. Both inputs are specified as String values.

This is not in line with the Swagger and while it works if I pass in a string public="true" they should be boolean values.

@kaysiz if you are going through the API anyway be good to pick this up along the way.

@wip-abramson I've just had a look at that. I'm not sure whether there is possibly some confusion. Whilst I agree that in the python function it makes more sense to pass True or False the python way, in swagger/JSON it is actually "true" and "false" as booleans see also. But maybe that's what you mean or I'm misunderstanding?

from aries-cloudcontroller-python.

wip-abramson avatar wip-abramson commented on August 17, 2024

Yeah so I think we pass bools to the python function. Then need to serialize the params to turn True into true.

I think we are missing that serialization step in our code.

from aries-cloudcontroller-python.

morrieinmaas avatar morrieinmaas commented on August 17, 2024

ah alright, thanks for clarifying

from aries-cloudcontroller-python.

morrieinmaas avatar morrieinmaas commented on August 17, 2024

Also can we review accept_connection(). This is a helper function combining receive_invitation and accept_invitation. However in doing so we lose ability to pass arguments into these functions.

Suggest we add arguments from both the this function. Not sure. Perhaps we shouldn't even have this helper method as it might confuse people?

That is an interesting question. WYT we should do? Happy to implement either, but am pretty impartial with a tendency towards taking away the fct altogether might be good because less is more sometimes. However, i do see how that is convenient to have🤷‍♂️

from aries-cloudcontroller-python.

wip-abramson avatar wip-abramson commented on August 17, 2024

I also have a tendency to remove altogether. Lets do that.

Think it's not this libraries job to simplify.

from aries-cloudcontroller-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.