Open mweinelt opened 2 years ago
❯ http post https://www.googleapis.com/geolocation/v1/geolocate\?key\=AIzaSyDGi15Zwl11UNe6Y-5XW_upsfyw31qwZPI -v
POST /geolocation/v1/geolocate?key=AIzaSyDGi15Zwl11UNe6Y-5XW_upsfyw31qwZPI HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 0
Host: www.googleapis.com
User-Agent: HTTPie/3.1.0
HTTP/1.1 403 Forbidden
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Date: Fri, 20 May 2022 12:39:33 GMT
Server: scaffolding on HTTPServer2
Transfer-Encoding: chunked
Vary: Origin, X-Origin, Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
{
"error": {
"code": 403,
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console API activation",
"url": "https://console.developers.google.com/apis/api/geolocation.googleapis.com/overview?project=404761575300"
}
]
},
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"domain": "googleapis.com",
"metadata": {
"consumer": "projects/404761575300",
"service": "geolocation.googleapis.com"
},
"reason": "SERVICE_DISABLED"
}
],
"errors": [
{
"domain": "usageLimits",
"extendedHelp": "https://console.developers.google.com",
"message": "Geolocation API has not been used in project 404761575300 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/geolocation.googleapis.com/overview?project=404761575300 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"reason": "accessNotConfigured"
}
],
"message": "Geolocation API has not been used in project 404761575300 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/geolocation.googleapis.com/overview?project=404761575300 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status": "PERMISSION_DENIED"
}
}
Tangentially related support for geoclue2
by default should be coming in version 102.
cc @edolstra, who is supposed to have access to these API keys.
In the GCP console I don't see anything wrong with the key. But I do vaguely remember that Google was going to deprecate this stuff.
"message": "Geolocation API has not been used in project 404761575300 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/geolocation.googleapis.com/overview?project=404761575300 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
Which is part of the response in https://github.com/NixOS/nixpkgs/issues/173758#issuecomment-1132856489
Enabling is apparently not free, $5 per 1000 requests, and I have no idea how many requests to expect.
Also, I got some emails from Google:
We have detected a publicly accessible Google API key associated with the following Google Cloud Platform project:
Project NixOS aszlig (id: api-project-404761575300) with API key AIzaSyDGi15Zwl11UNe6Y-5XW_upsfyw31qwZPI
The key was found at the following URL: https://github.com/ryantrinkle/nixpkgs/blob/08125c601e274fdaa4051781fa32e8fd8bf46a39/pkgs/applications/networking/browsers/firefox/common.nix
which suggests we shouldn't be using API keys in this manner.
According to the Archlinux chromium maintainer Google does not seem to want to support distros any longer. Still waiting for feedback from the Gentoo folks.
which suggests we shouldn't be using API keys in this manner.
We don't really have an option, and neither do other distros.
Gentoo seems to obfuscate their keys for that reason. They still rely on Google for geolocation and it works for them.
which suggests we shouldn't be using API keys in this manner.
Back then when I was getting those keys, we got explicit permission to do so, see 3c60e2ec39b11353779518e39a1d4aad13193b99 for the details.
Also cc @antiagainst, since according to https://groups.google.com/a/chromium.org/g/chromium-packagers/c/ZytNtRam5II they seem to be handling some of those issues since Paweł left.
@aszlig: Sorry I think you got the wrong person. I don't know about Google API key and Chromium stuff..
@antiagainst: Whoops, sorry for the noise, I didn't think that there would be another person with the exact same name at Google.
Just to inform everyone on the progress, I've got a reply via mail on Tuesday (June 21):
Thanks for reaching out. I've forwarded your issue to the appropriate internal team. (Out of my control) Hopefully they can help.
Hi, any news on this?
Hi, any news on this?
Not as far as I know... we tried multiple times to contact them but haven't heard back so far, maybe @mweinelt has better news.
No, I actually lack the contacts for that kind of ask.
Describe the bug
Geolocation support via Google APIs is broken in both Chromium and Firefox source builds.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
The browser should find out where I am.
Screenshots
n/a
Additional context
about:config
->geo.provider
made it work for me.Notify maintainers
@aszlig @primeos