Google Maps API keys at least are based on the entire URL, not just the domain name. For example, the key for http://drupal.org/newsite is different from http://drupal.org/oldsite is different from the SSL site https://drupal.org/oldsite.

For Google at least, it would be useful to store the base URL instead of just the domain name.

I have a patch to do this, let me know if you're interested.

CommentFileSizeAuthor
#2 keys_api.patch2.99 KBscottgifford

Comments

greenskin’s picture

A patch would be very helpful, thanks.

scottgifford’s picture

StatusFileSize
new2.99 KB

Here's what I'm using right now. It could use a little cleanup.

It changes the API so that keys_api_get_key takes a URL as the second parameter. If no URL is given, it will figure it out on its own. Really I think it should always be figuring it out on its own, there's no reason the calling module should need to understand the details of how API keys are generated.

It doesn't have any backwards compatibility, but I think that would be fairly straightforward to add.

avpaderno’s picture

Status: Active » Needs work
geodaniel’s picture

Subscribing to this. Would be great to get this into the module once it has backwards compatibility.

greenskin’s picture

Status: Needs work » Closed (won't fix)

Drupal 5 no longer supported. Closing to clean queue.