Google cloud KMS rest api to retrieve keyriings - google-cloud-kms

Is there a rest endpoint to retrieve keyrings at a project level directly in KMS rest appi.
As of now, current API needs keyrings on a per-location basis, I would like to get all keyRings on a specified project id, is there an endpoint. on Google CLoud UI you select a project and it simply lists all keyrings, is there an equivalent at Rest

There are REST and gRPC APIs for listing Key Rings.
GET https://cloudkms.googleapis.com/v1/projects/my-project/locations/loc/keyRings

If you want to find all keyrings in all locations, you need to list the available locations and enumerate the keyrings in each known location. KMS is fully regionalized for reliability reasons, so the service doesn't have APIs which interact with multiple regions.

Related

Website Restrict Google Maps API key dynamicly via SDK

my question: Is there any Google API / SDK I can use to be able to dynamically add "HTTP referrers (web sites)" (assign domains) to maps API key ?
Background
I'm building a web-application portal that will allow anyone to create a business website and assign a custom domain to it.
On that generated website customer will have google maps map pointing to address of their business.
Customer has an option to add custom domain to their business website created by my web-application (by CNAME to the my web-application)
Desired feature is that once the domain background job will get triggered that will add that domain/host to list of restricted domains/hosts for my Google Maps Api key so that their domain will be able to read google maps on their domanin
note: I Have cron job DNS lookup validation check implemented to ensure that domain is really assigned to the domain
live example
here is website generated by customer on my web-application http://sbs-sos.sajtka.sk/ he assigned a domain and pointed CNAME http://sbs-sos.sk/
Reason why the google map works is because I manually white-listed their domain. I need to automate this
please aware portal is not fully launched so many bugs are happening
The feature request to manage API keys restrictions via SDK was submitted in Google issue tracker in 2016:
https://issuetracker.google.com/issues/35829646
Currently, there are no any official SDK for that. However, the last update from Google says that they released experimental API to programmatically manage your API Keys and their restrictions.
The best way to handle thousands of authorized domains is to use an API to programmatically manage your API Keys and their restrictions, and we have recently launched a new service that allows you to do this.
This API is still in Alpha. If you are interested in becoming a Trusted Tester for this service, you can use the following form to sign up, please read the instructions carefully:
https://forms.gle/qx2SMcarWCAsbWVp7
Please note that this API is not part of the Google Maps Platform. After you fill out the form, you will be contacted by the API Keys API team with instructions on how to get started, and how to receive support.
API Keys API is currently free of charge. However, please note that use of Cloud Endpoints may be subject to charges at high traffic volume. You can check the pricing sheet here:
https://cloud.google.com/endpoints/pricing-and-quotas
I would suggest joining Trusted Tester program and try out this API.
I hope this helps!

Is it possible to use multiple Google Map Account under same Application?

I have a Web Application, which is hosted under a domain (say www.xx.com) and I have activated Google Map Account (say, MyAccount) for that Application as well. The Google Map Key under MyAccount; I have enabled for JavaScript Map API and Geocoding API only. There is another option in that Application, which uses Places API, which I haven't enabled due to the heavy costing for that what google have. But, one of my client want to use the Places API option and they have suggested me that to use Client Google Map Account (say, ClientAccount) for that particular Option; where I'll use their Map Key (under ClientAccount) while they sign-in into the Application. So, the following questions became relevant;
-Is it possible to use Dynamic Map Key under one Project?
Is there any violation of Terms? if yes,
- What is the alternative I can suggest to the client to achieve this requirement?
NB: I cannot make another instance of the application to host for the client as my services are under SaaS model.
Thanks,
Shenulal
Yes this should be possible, just send the customer's key with your Places API requests, and make sure they whitelist your domain in their key restrictions.

Is there possibility for registering URLs or domains in Google Maps API?

Is there a way to register Authorized URLs in Google Maps via an API?
Currently, I am manually adding URLs through the Google Maps Support portal, but I would like to be able to make an API call when a customer submits a new domain to my service.
Unfortunately, currently there is no way to manage API key restrictions programatically.
There is a feature request in Google issue tracker to make it possible:
https://issuetracker.google.com/issues/35829646
Please star this feature request to add your vote and subscribe to notifications, at the moment it has only 6 stars, not enough to increase its visibility.
Update from Google
The best way to handle thousands of authorized domains is to use an API to programmatically manage your API Keys and their restrictions, and we have recently launched a new service that allows you to do this.
This API is still in Alpha. If you are interested in becoming a Trusted Tester for this service, you can use the following form to sign up, please read the instructions carefully:
https://forms.gle/qx2SMcarWCAsbWVp7
Please note that this API is not part of the Google Maps Platform. After you fill out the form, you will be contacted by the API Keys API team with instructions on how to get started, and how to receive support.
API Keys API is currently free of charge. However, please note that use of Cloud Endpoints may be subject to charges at high traffic volume. You can check the pricing sheet here:
https://cloud.google.com/endpoints/pricing-and-quotas

Google API key Vs. Google Client ID

One of our customers is using google maps with a "Client ID". We've developed our product using the Google API Key. All of the features of the map are working properly using the API key, but we are unable to confirm that the client will get the same results with the Client ID since we do not have one. Two question, do you believe that the features will work the same using either the API or the Client ID? Second question, how much does it cost to purchase a Client ID?
Client IDs and API Keys are forms of authentication and authorization. There are easy-to-follow guidelines on their proper usage and their limits. Everything you need to know about them can be found in the documentation (also try seeing the docs per product in the 'For more information' section):
https://developers.google.com/maps/premium/overview#authentication_and_authorization
Related SO post and answer about using Client IDs for their Javascript API:
google maps api javascript usage
For pricing, read more about it here:
https://developers.google.com/maps/pricing-and-plans/
EDIT: There has been recent Google Maps Platform pricing and product changes You'll always need an API key and a valid billing account associated to your Project if you want to use the Google Maps Platform APIs. If you've never had a Client ID then you don't need to worry about it, just continue using your API keys.
You may run into some APIs (i.e. Speed Limits API) that seem to need a Premium Plan account. If you really need access to these, simply contact sales using this form.
P.S.
When using API keys, be sure to properly restrict them!

Using a business API key for reverse geocoding with Google

I'm working on a project that uses Google Maps APIs to reverse geocoding locations.
The customer is supposed to buy a licensed API key when rolling out to production.
Now I'm developing the application and I also need to test its functionality when using a valid, whether free or business, API key.
Let's pick a sample reverse geolocation request
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true
I have registered a developer account into https://code.google.com/apis/console/ and generated a server API key. Then I enabled Google Geolocation APIs and Google Maps API v3 (I think I need only the second).
When adding &key=XXX parameter to my previous request I get an error that the key is not valid.
Reading documentation with more attention, I discovered that the geolocation service I'm using is actually part of Maps Web Service APIs (Maps V3 APIs run on browser as Javascript). I tried to find those APIs into the Services list of my console but couldn't find anything more.
How do I use Google's reverse geocoding API with a business key for a project that will handle thousands of daily requests?
with no api key, the Google Geocoding API has the following limits in place: 2,500 requests per day.
Google Maps API for Business customers have higher limits: 100,000 requests per day.
to use to API for Business you have to use URL signing, see https://developers.google.com/maps/documentation/business/webservices/auth
NB: If you're switching from the free API services to a Maps API for Business implementation, you must remove the key parameter from your requests. Google Maps API web services will deny requests made with both a client ID and a key.