3rd party API keys

Asked by Peter Papp on 2017-08-21

Suppose in your code you want to use services provided by 3rd party. This 3rd party issues an API key to you, so you can identify yourself when you're making calls to their service. Their terms of use require that you do not share your API key.

However, your project is Open Source and resides on Launchpad.

Who do you make this happen? Is there a "hidden file" feature or something similar?

Question information

Language:
English Edit question
Status:
Answered
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
2017-08-23
Last reply:
2017-08-23
Colin Watson (cjwatson) said : #1

Access control only exists at the level of entire branches. (As far as I know this is true for all modern hosting sites, and it's certainly inherent in the design of both Bazaar and Git.) Furthermore, private branches are a paid feature on Launchpad. Much though I probably ought to be trying to sell you that, a private branch would be massive overkill for this kind of thing.

What I think you should do instead is have the API key be a build parameter for your project. That way, when you're doing your release builds, you can specify the "secret" API key, and document that anyone else who wants to build your project needs to get the third party to issue them their own API key.

Peter Papp (ppeter) said : #2

Hi Colin,

Thank you for your answer.

Forgive my ignorance, but I'm not sure what you mean. I searched Launchpad for "build parameter" but found nothing. Can you please elaborate a bit?

Thank you
Peter

Colin Watson (cjwatson) said : #3

This is not a Launchpad-specific thing. Most software build systems support some way to pass properties of some kind into the build; e.g. with the GNU autotools you can set things up to do something like "./configure --with-api-key=foo". You'd have to work out how to do something appropriate depending on the way your project is built.

Peter Papp (ppeter) said : #4

OK I see what you mean.

I'm using recipes to auto-build my branch on Launchpad. So I would have to write that key somewhere into the branch (qmake .pro file for example), which would mean it'd be public info. Mind as well put it in the source code. Same if I put it into build rules.

I'm sure I'm not the only one with this problem.

Anyways, I will figure out something. Thank you for taking the time to answer.

Colin Watson (cjwatson) said : #5

It is indeed not possible to have a recipe build something where some parts of the build need to be secret. In order to meet your requirements you'll need to use a different build process.

Peter Papp (ppeter) said : #6

:(

Anyways, thank you again.

Can you help with this problem?

Provide an answer of your own, or ask Peter Papp for more information if necessary.

To post a message you must log in.