Comments (23)
I've made my own async version of the Google apis which has more or less full functionality by building on top of the official api. I'm going to try to see if my employer will allow me to make them public and will report back
from aiogoogle.
ok so i got approval, its going through legal
from aiogoogle.
Hey @thehesiod, thanks for chiming in.
The 2 data.py files I added, are only here for convenience. You can still load your own 1. auth discovery document 2. discovery discovery document. In the auth module, I try to borrow as much code as I can from Google's already existing auth libraries. Namely: the google-auth
package & https://github.com/googleapis/google-auth-library-python.
from aiogoogle.
I found a way to get this working on a GCE instance with a service account. I'm using the google metadata server to get an auth token, and passing it into the Aiogoogle instance. The token needs to be refreshed periodically, so it's wrapped in a loop which checks the token's expiry time, and refreshes once the token lifetime is < 1200 seconds. This feels a bit hacky, but seems to work well enough after some preliminary testing. Maybe it's useful for anyone hoping to use aiogoogle on a GCE/GKE instance with a service account.
https://gist.github.com/booya/e10554cb6302a0a4b43dcdd16a9e4147
from aiogoogle.
Hey guys, I just added basic service account support in version 1.0.0.
Right now, you can authenticate as a service account in two ways:
- Load the service account key as a Python dict and pass it to Aiogoogle as
service_account_creds
. - Point the
GOOGLE_APPLICATION_CREDENTIALS
environment variable at the location of the JSON key file.
We're still missing automatic detection from:
- Google Cloud SDK
- Google App Engine environment
- Google Compute Engine environment
Adding them should be easy though, if someone's up for the task.
You can find more info here in the docs.
from aiogoogle.
Thanks!
Unfortunately, I'm very busy these days + I don't have much use for most of Google Cloud Products. This might change in a month or two, but for now, I'm open to merging pull requests.
If you have the time and willing to help me implement this feature, please let me know, so we can work on it together.
Cheers :)
from aiogoogle.
Hey I would love to work on this with you!!! how do I start?
from aiogoogle.
Cool! Thanks @OdinTech3.
What extra interfaces you think we'll need in order to fully support service accounts?
from aiogoogle.
@omarryhan Were you referring to me?
from aiogoogle.
@OdinTech3 Yes :)
from aiogoogle.
I am not well versed with the details of the google api codebase, but this is something i am researching and want to really take on, but need to familiarize myself with your codebase and google's.
Where could I reach you if i need to clarify things, is your email that you put on github good?
from aiogoogle.
Sure, take your time. I need to do some research as well.
Yes [email protected] is my email. Feel free to email me there. If you want me to create a public Discord chat or something similar, I'm also open to that.
from aiogoogle.
I made a public Trello board for this feature. Let me know if you would like to join so I can add you as a member. https://trello.com/b/pOLVsBFI/aiogoogle-service-accounts-feature
from aiogoogle.
from aiogoogle.
Cool, what's your email?
from aiogoogle.
from aiogoogle.
awesome lib! I'm going to try to get this rolling as I've hit enough resource issues trying to get our systems working with the original google api which is a giant resource hog.
from aiogoogle.
btw may want to move this to aio-libs group
from aiogoogle.
I'm conflicted between using this, or something which inherits and overrides behavior from the google-python API client for reason of the various tweaks it has added over time. How much was the original API client code integrated into this project? I'm worried because of stuff like data.py, which is supposed to come dynamically.
from aiogoogle.
Hi, @gregorth @ivankosenko @MrMrRobat @dm0 @thehesiod @OdinTech3
I'll try to put some hours into this feature this week. Can you tell me your use cases? What APIs you most certainly need, what APIs you can live without and what are not that important?
It seems like we might be getting Asyncio support in Google's main auth library soon: googleapis/google-auth-library-python#465. Will the features introduced in this PR kill the need for adding service accounts support here? I personally don't think so. I think that we still need a way to make the Aiogoogle
object understand service account creds and be able to accept it this way:
async with Aiogoogle(service_account_creds=service_accound_dict) as aiogoogle:
...
And obviously, also be able to grab and refresh an access token using the service account creds. Generally, I think that this is the most important feature to add right now. Features like getting the default service account creds from a compute or app engine can wait or maybe not even needed at all because we can always use Google's auth lib.
Any thoughts?
from aiogoogle.
@thehesiod did you ever get it through Legal?
from aiogoogle.
@Omeryl just pinged again, the signal I got last time was positive. We've been using it w/o issues for awhile now. I even added credential caching support back
from aiogoogle.
I'm going to close this. Please open a new feature request if there's a specific service-account feature that you want.
from aiogoogle.
Related Issues (20)
- Ability to upload from AsyncIterable object HOT 6
- Can we provide a way to test the package end to end? HOT 1
- URL formatting issue HOT 3
- URL encoding issues with Calendar IDs HOT 1
- Aiogoogle doesn't support the beta Drive Labels API HOT 5
- Token is not getting refreshed after its expired after around 1 hour HOT 17
- Inconsistent response. HOT 5
- Unclosed client session HOT 4
- URL formatting breaks the people.connections.list method HOT 1
- Updating google drive file contents yields corrupted file due to multipart HOT 5
- Authentication using application default method HOT 1
- HttpError doesn't include JSON error response with the "pipe_to" option enabled HOT 1
- paginn issue HOT 2
- Requesting Google Drive list with multiple pages always results in user_creds of None HOT 3
- Issue with `ServiceAccountCreds` with `universe_domain` HOT 2
- FYI sending messages with Gmail doesn't work HOT 1
- UserCreds oauth token not refreshed after 1hour HOT 1
- `trio` support broken: unexpected keyword argument 'auth_manager' HOT 3
- Using pipe_to and pipe_from HOT 13
- Module import error : contextvars HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiogoogle.