Giter Site home page Giter Site logo

Comments (15)

trocotronic avatar trocotronic commented on June 30, 2024

I do not recommend playing with Edistribucion backend in that way, as you'll be surely banned forever if anomaly activity is detected.
Said that, you can emulate what you asking for by removing/renaming edistribucion.access and edistribucion.session, which contain access credentials granted by the backend and session variables, all tied to the credentials set in credentials.py. If you rename both files and call a method (get_cups() or whatever), the API will login again by taking the user/password set in credentials.py. Therefore, you can alternate between a collection of *.access and *.session files to switch between users' portal.

Despite that, I would recommend you the correct way. Edistribucion has the capability to grant access to external users. For instance, an external user can grant you access to its portal and you will be able to access to its portal, all available with your own user/password. More info at https://zonaprivada.edistribucion.com/areaprivada/s/wp-authorizations

from edistribucion.

nikuxic avatar nikuxic commented on June 30, 2024

Aha!! Thanks a lot for all this information. I wasn't aware of that access for external. It will really help.
Again, thank you so much for being so quick and resolute responding.

from edistribucion.

nikuxic avatar nikuxic commented on June 30, 2024

Sorry to disturb again...

I got authorization to access as a external user. Through web I see the CUPS of the person that grant access to me. But using this API I don't :( . For example, 'edis.get_list_cups()' returns an empty array...

Is it possible to access authorized cups with this API?

Thank you so much.

PS: I'm not sure if this is the place to ask for this help.... Please, let me know

from edistribucion.

trocotronic avatar trocotronic commented on June 30, 2024

Do get_all_cups() or get_cups() return something?

from edistribucion.

nikuxic avatar nikuxic commented on June 30, 2024

They return something, but 'authorized' cups are not there

from edistribucion.

nikuxic avatar nikuxic commented on June 30, 2024

Just to give a hint...
In order to see the authorized cups on web site, I have to choose the proper "persona o razón". Maybe that's what we need to do somewhere inside the API code.
imagen

from edistribucion.

trocotronic avatar trocotronic commented on June 30, 2024

I do not have a way to scrap multiple identities, but let me try one approach.
Can you paste what do you get on get_login_info()? Please anonymize it before pasting here.

from edistribucion.

nikuxic avatar nikuxic commented on June 30, 2024

Note that:

  • I've changed all ids by replacing the last characters with '????'
  • I've changed names and DNIs
  • I have authorization from 2 users. But, in 'authList[0]' is myself (don't know why). 'authList[1]' is ok

from edistribucion.

nikuxic avatar nikuxic commented on June 30, 2024

Hi! Did you find any way to do it? Thank you.

from edistribucion.

trocotronic avatar trocotronic commented on June 30, 2024

from edistribucion.

nachoplus avatar nachoplus commented on June 30, 2024

Thank you for this great job!
Related to this, Can be avoided the load of credentials.py? I mean, this behaviour obligate to have a credentials.py in the working directory. I think that insted is better to have a login(user,passwd) method. More flexible for integrations

from edistribucion.

trocotronic avatar trocotronic commented on June 30, 2024

I pushed a new version with identities management. Now methods related with CUPS accept vis parameter. This parameter can be obtained via get_identities(), which will return a list of authorized supplies. If no parameter is provided, it takes the default identity.

Also Edistribucion() accept login and password arguments. If not provided, both are taken from credentials.py file.

Finally, no need to call login(), as it is called inside the initialization.

Refer to example3.py for examples on identity management.

Note: I cannot not test identity management, as I do not own other supplies nor other people grants access to me. So, please report if you detect inconsistencies.

from edistribucion.

nachoplus avatar nachoplus commented on June 30, 2024

I tried Edistribucion(login=user,password=password) but fail if not credentials.py exists in the working directory. May you catch the import error?. I mean:

try:
    import credentials
except:
    logging.warning("No credentials.py file found")

Thanks for suporting!

from edistribucion.

trocotronic avatar trocotronic commented on June 30, 2024

from edistribucion.

nikuxic avatar nikuxic commented on June 30, 2024

Hi!
I've just tried this new version 0.6.0 with my user and access to others.
It works perfectly!
Thank you so much!!

from edistribucion.

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.