service-accounts

How to configure a non-default serviceAccount on a deployment

醉酒当歌 提交于 2019-12-06 17:26:45
问题 My Understanding of this doc page is, that I can configure service accounts with Pods and hopefully also deployments, so I can access the k8s API in Kubernetes 1.6+. In order not to alter or use the default one I want to create service account and mount certificate into the pods of a deployment. How do I achieve something similar like in this example for a deployment? apiVersion: v1 kind: Pod metadata: name: my-pod spec: serviceAccountName: build-robot automountServiceAccountToken: false 回答1:

How authenticate with gcloud credentials an Dialogflow API

六月ゝ 毕业季﹏ 提交于 2019-12-06 11:17:24
I have a Node JS app that make requests to a Dialogflow agent. I actually use a temporally token based request, but how can i change this to do it through google service credentials? ( https://cloud.google.com/docs/authentication/getting-started ). I have a credencial created (with billing added), and the service_account json file. I would like to use the Dialogflow package in node ( https://www.npmjs.com/package/dialogflow ) but i don't underestand how to use it with the json file. const projectId = 'ENTER_PROJECT_ID_HERE'; const sessionId = 'quickstart-session-id'; const query = 'hello';

Batch Request - SendAs Emails

时间秒杀一切 提交于 2019-12-06 09:09:29
问题 Is there a way to do a batch request to get SendAs emails from multiple or all users? Currently we are using a service account with user impersonation to go through each user and get the SendAs email list - lot of requests. GmailService as service - this is impersonated as the user. service.Users.Settings.SendAs.List("me").Execute(); P.S. I posted this in google group, but just read a post that said the forum is now read-only! It's weird that it allowed me to make a new post (and obviously i

C# Google Drive API list of files from my personal drive

孤街浪徒 提交于 2019-12-06 04:19:20
I am trying to connect to my own personal Google Drive account and gather a list of file names. What I have done: Installed all the NuGet packages required Added Google Drive to the API Manager in Google Developers Console Setup a Service Account and downloaded a P12 key for authentication Wrote the following code to call the API: string EMAIL = "myprojectname@appspot.gserviceaccount.com"; string[] SCOPES = { DriveService.Scope.Drive }; StringBuilder sb = new StringBuilder(); X509Certificate2 certificate = new X509Certificate2(@"c:\\DriveProject.p12", "notasecret", X509KeyStorageFlags

Using Google Cloud Source Repositories with service account

烂漫一生 提交于 2019-12-06 01:49:25
问题 Is it possible to access a Google Cloud Source Repository in an automated way, i.e. from a GCE instance using a service account? The only authentication method I am seeing in the docs is to use the gcloud auth login command, which will authenticate my personal user to access the repo, not the machine I am running commands from. 回答1: On GCE vms running gcloud source repos clone default ~/my_repo should work automatically without extra step of authentication, as it will use VMs service account.

Can the Google Apps Script Execution API be called by a service account?

主宰稳场 提交于 2019-12-05 16:06:29
问题 I'd like to use a service account to access a Google Sheet via the Apps Script Execution API, but it's not clear from the documentation whether this is supported. The steps I've tried (which result in a 403 status from the Execution API) are: Create a new (unbound) Apps Script Visit the linked Developer Console project Enable the Execution API Create a new service account within the same project (downloading the generated JSON file) Create a new Google Sheet and share it with the service

Google Service account user interfece

时光总嘲笑我的痴心妄想 提交于 2019-12-05 02:30:22
How can I login to a Google Service account with the normal web user interface, for example to google drive ? Now I can only login using API using script. You cant. A service account is a sudo user type thing. Yes it has a Google drive account, Google calendar ... but you cant log in to the web interface for Service accounts. Option / work around / Tip: There is a slight workaround. You could have the service account give your Google account access to a directory on its Google drive. Then when you login to Google Drive web you will be able to see the files. Tip: If you want to be able to

How to configure a non-default serviceAccount on a deployment

主宰稳场 提交于 2019-12-04 23:08:13
My Understanding of this doc page is, that I can configure service accounts with Pods and hopefully also deployments, so I can access the k8s API in Kubernetes 1.6+. In order not to alter or use the default one I want to create service account and mount certificate into the pods of a deployment. How do I achieve something similar like in this example for a deployment? apiVersion: v1 kind: Pod metadata: name: my-pod spec: serviceAccountName: build-robot automountServiceAccountToken: false MrHohn As you will need to specify 'podSpec' in Deployment as well, you should be able to configure the

Access Google spreadsheet from Google Appengine with service account : working once per hour

自作多情 提交于 2019-12-04 18:50:47
I have implemented the python code here below based on the documentation in order to access a spreadsheet accessible through a public link. It works once every hour. If I execute a few seconds after a success, I receive an error : Error opening spreadsheet no element found: line 1, column 0 Assumption: The access token has an expiry date of 1 hour. So the appengine would proceed to a token refresh after an hour, resetting the whole. Question: This code requests a new token for each request. So what should I do ? Save the token ? When I try the token_to_blob in order to save the token, I get an

Failing to authorize connection to own GAE endpoints API with service account

北战南征 提交于 2019-12-04 14:25:41
问题 I've been beating my head against the wall trying to successfully authorize an API hit on the Google App Engine (GAE) project I'm running from a python script using OAuth2 and a service account. I've created the service account, added the service account id to the allowed client ids in the api file, converted the private key from a .p12 to a .pem, and authorized the httplib2 call. I've tried passing the credentials using the .authorize() method and by loading the credentials as JSON and